11(
22// og test
33s.waitForBoot{
4+ var buf = Buffer .read(s,FluidFilesPath ("Nicol-LoopE-M.wav" ));
5+ var slicepoints = Buffer (s);
46
5- Task {
6- var buf = Buffer .read(s,"/Users/macprocomputer/Desktop/_flucoma/code/flucoma-core-src/AudioFiles/Nicol-LoopE-M.wav" );
7- var slicepoints = Buffer (s);
8-
9- FluidBufAmpSlice .process(s,buf,indices: slicepoints,fastRampUp: 10 ,fastRampDown: 2205 ,slowRampUp: 4410 ,slowRampDown: 4410 ,onThreshold: 10 ,offThreshold: 5 ,floor: -40 ,minSliceLength: 4410 ,highPassFreq: 20 ,action: {
10- FluidWaveform (buf,slicepoints,bounds: Rect(0 ,0 ,1600 ,400 )).front;
11- });
12-
13- }.play(AppClock );
7+ FluidBufAmpSlice .process(s,buf,indices: slicepoints,fastRampUp: 10 ,fastRampDown: 2205 ,slowRampUp: 4410 ,slowRampDown: 4410 ,onThreshold: 10 ,offThreshold: 5 ,floor: -40 ,minSliceLength: 4410 ,highPassFreq: 20 ,action: {
8+ defer {FluidWaveform(buf,slicepoints,bounds: Rect(0 ,0 ,1600 ,400 )).front};
9+ });
1410}
1511)
1612
17- (
13+
1814(
1915// embed it in a different window
2016s.waitForBoot{
2117
22- var buf = Buffer .read(s,"/Users/macprocomputer/Desktop/_flucoma/code/flucoma-core-src/AudioFiles/ Nicol-LoopE-M.wav" );
18+ var buf = Buffer .read(s,FluidFilesPath ( " Nicol-LoopE-M.wav") );
2319 var slicepoints = Buffer (s);
2420
2521 FluidBufAmpSlice .process(s,buf,indices: slicepoints,fastRampUp: 10 ,fastRampDown: 2205 ,slowRampUp: 4410 ,slowRampDown: 4410 ,onThreshold: 10 ,offThreshold: 5 ,floor: -40 ,minSliceLength: 4410 ,highPassFreq: 20 ,action: {
26- fork( {
22+ defer {
2723 ~win = Window ("test" ,Rect (0 ,0 ,1600 ,400 ));
28- FluidWaveform (buf,slicepoints,bounds: Rect(100 ,100 ,1400 ,200 ),parent: ~win ).front;
29- },AppClock );
24+ FluidWaveform (buf,slicepoints,bounds: Rect(100 ,100 ,1400 ,200 ),parent: ~win );
25+ ~win .front;
26+ };
3027 });
31-
3228}
3329)
3430
@@ -78,6 +74,8 @@ s.waitForBoot{
7874 ~pitch_analysis = Buffer (s);
7975 FluidBufPitch .processBlocking(s,~audio ,features: ~pitch_analysis );
8076
77+ s.sync;
78+
8179 ~fw = FluidWaveform (bounds: Rect(100 ,100 ,1200 ,300 ));
8280
8381 ~fw .addImageLayer(~mels ,1 ,1 );
@@ -111,7 +109,7 @@ s.waitForBoot{
111109
112110 s.sync;
113111
114- ~fw = FluidWaveform (~audio ,~indices ,~pitch_analysis ,imageBuffer: ~mels ,bounds: Rect(100 ,100 ,1200 ,300 ),imageColorScaling: 1 ,imageColorScheme: 1 ).front ;
112+ ~fw = FluidWaveform (~audio ,~indices ,~pitch_analysis ,imageBuffer: ~mels ,bounds: Rect(100 ,100 ,1200 ,300 ),imageColorScaling: 1 ,imageColorScheme: 1 );
115113}
116114)
117115
@@ -132,11 +130,11 @@ s.waitForBoot{
132130
133131 s.sync;
134132
135- ~fw = FluidWaveform (~audio ,~indices ,~pitch_analysis ,bounds: Rect(100 ,100 ,1200 ,300 ),imageColorScaling: 1 ,imageColorScheme: 1 ).front ;
133+ ~fw = FluidWaveform (~audio ,~indices ,~pitch_analysis ,bounds: Rect(100 ,100 ,1200 ,300 ),imageColorScaling: 1 ,imageColorScheme: 1 );
136134}
137135)
138136
139-
137+ // adding layers one at a time kinda test
140138(
141139s.waitForBoot{
142140 // do some analysis
@@ -163,25 +161,26 @@ s.waitForBoot{
163161)
164162
165163(
166- // plot most of it, but then...
167- ~fw = FluidWaveform (bounds: Rect(100 ,100 ,1200 ,300 ));
164+ // plot some of it, but then...
165+ ~fw = FluidWaveform (bounds: Rect(100 ,450 ,1200 ,300 ));
168166~fw .addImageLayer(~mels ,2 ,imageColorScaling: 1 );
169- ~fw .addAudioLayer(~audio ,Color (1 ,1 ,1 ,0.5 ));
170- ~fw .addIndicesLayer(~indices ,~audio ,Color .black);
171167~fw .front;
172168)
173169
174- // add one more
175- ~fw .addFeaturesLayer(~pitch_analysis ,[Color .cyan,Color .yellow]).front;
170+ // add one feature at a time
171+ ~fw .addAudioLayer(~audio ,Color (1 ,1 ,1 ,0.5 )).refresh;
172+
173+ ~fw .addIndicesLayer(~indices ,~audio ,Color .black).refresh;
174+
175+ ~fw .addFeaturesLayer(~pitch_analysis ,[Color .cyan,Color .yellow]).refresh;
176176
177177// check how many layers
178178~fw .layers
179179
180180(
181181// plot differen components with different colors
182- s.waitForBoot {
182+ Routine {
183183 ~audio = Buffer .read(s,FluidFilesPath ("Nicol-LoopE-M.wav" ));
184- // ~audio = Buffer.read(s,FluidFilesPath("Tremblay-ASWINE-ScratchySynth-M.wav"));
185184 ~resynth = Buffer (s);
186185 ~n_components = 3 ;
187186 ~resynths = {Buffer (s)} ! ~n_components ;
@@ -196,7 +195,9 @@ s.waitForBoot{
196195 ~hopSize = 256 ;
197196
198197 s.sync;
199- FluidBufNMF .processBlocking(s,~audio ,resynth: ~resynth ,activations: ~activations ,components: ~n_components );
198+
199+ FluidBufNMF .processBlocking(s,~audio ,resynth: ~resynth ,activations: ~activations ,components: ~n_components ,resynthMode: 1 );
200+
200201 2 .do{
201202 arg i;
202203 FluidBufHPSS .processBlocking(s,~audio ,harmonic: ~harm [i],percussive: ~perc [i],maskingMode: i,harmFilterSize: 51 ,percFilterSize: 91 );
@@ -220,35 +221,30 @@ s.waitForBoot{
220221
221222 ~colors = FluidViewer .createCatColors.collect{
222223 arg color;
223- // color.alpha_(0.4);
224224 color;
225225 };
226226
227227 s.sync;
228228
229- // ~resynths.postln;
230- ~melsfw = FluidWaveform (bounds: Rect(0 ,0 ,1600 ,400 ));
229+ defer {
230+ ~melsfw = FluidWaveform (bounds: Rect(0 ,0 ,1600 ,400 ));
231231
232- // ~n_components.do{
233- // arg i;
234- // ~fw.addAudioLayer(~resynths [i],~colors[i]);
235- // };
232+ ~n_components .do{
233+ arg i;
234+ ~melsfw .addImageLayer( ~mels [i],~colors [i], 1 , 1 );
235+ };
236236
237- ~n_components .do{
238- arg i;
239- ~melsfw .addImageLayer(~mels [i],~colors [i],1 ,1 );
240- };
237+ ~melsfw .front;
241238
242- ~melsfw .front;
239+ ~binaryfw = FluidWaveform (bounds: Rect(0 ,400 ,1600 ,400 ));
240+ ~binaryfw .addImageLayer(~percmels [1 ],~colors [0 ],1 );
241+ ~binaryfw .addImageLayer(~harmmels [1 ],~colors [1 ],1 );
242+ ~binaryfw .front;
243243
244- ~binaryfw = FluidWaveform (bounds: Rect(0 ,400 ,1600 ,400 ));
245- ~binaryfw .addImageLayer(~percmels [1 ],~colors [0 ],1 );
246- ~binaryfw .addImageLayer(~harmmels [1 ],~colors [1 ],1 );
247- ~binaryfw .front;
248-
249- ~softfw = FluidWaveform (bounds: Rect(0 ,0 ,1600 ,400 ));
250- ~softfw .addImageLayer(~percmels [0 ],~colors [0 ],1 );
251- ~softfw .addImageLayer(~harmmels [0 ],~colors [1 ],1 );
252- ~softfw .front;
253- }
244+ ~softfw = FluidWaveform (bounds: Rect(0 ,800 ,1600 ,400 ));
245+ ~softfw .addImageLayer(~percmels [0 ],~colors [0 ],1 );
246+ ~softfw .addImageLayer(~harmmels [0 ],~colors [1 ],1 );
247+ ~softfw .front;
248+ };
249+ }.play;
254250)
0 commit comments