reinstated step playback

feature-synchronisation
bombinans 2023-10-26 10:44:21 +11:00
parent 9f7b83a44e
commit 5e0e9df5f4
4 changed files with 26 additions and 26 deletions

View File

@ -4,7 +4,8 @@
~modes = [
[ "saw", \pos_saw ],
[ "reverse", \pos_reverse ],
[ "sine", \pos_sine ]
[ "sine", \pos_sine ],
[ "step", \pos_step ],
];
~outputDir = Platform.recordingsDir +/+ "GrainBuffers";
@ -17,9 +18,9 @@
~speeds = [ 1, 1, 1, 1 ]; // hacky speed quantisation
~posb = Array.new(4);
~rectriggerb = Array.new(4);
~patterns = Array.new(4);
~players = Array.new(4);
~loopsynths = Array.new(4);
~patterns = [ nil, nil, nil, nil ];
~players = [ nil, nil, nil, nil ];
~loopsynths = [ nil, nil, nil, nil ];
// create the control busses
@ -36,28 +37,28 @@
});
// set up the Patterns which drive the position synths
(0..3).do({ |i|
~patterns.add(~makePattern.value(i, 0, ~speeds[i]));
});
(0..3).do({|i|
~players.add(~patterns[i].play(~tc, quant: ~beatsperbar))
});
// (0..3).do({ |i|
// ~patterns.add(~makePattern.value(i, 0, ~speeds[i]));
// });
//
// (0..3).do({|i|
// ~players.add(~patterns[i].play(~tc, quant: ~beatsperbar))
// });
~setmode = {
arg track, mode;
if( ~grainmodes[track] != mode, {
~grainmodes[track] = mode;
if(~players[track].isNil.not,{
~players[track].stop;
~patterns[track].free;
});
~patterns[track] = ~makePattern.value(track, mode, ~speeds[track]);
~players[track] = ~patterns[track].play(~tc, quant: ~beatsperbar);
});
};
~setspeed = {
arg track, speed;
[ "setspeed", track, speed ].postln;
if( ~speeds[track] != speed, {
~speeds[track] = speed;
~players[track].stop;
@ -95,4 +96,3 @@
});
}
)

View File

@ -112,7 +112,7 @@ OSCdef.freeAll;
~to.button('/track/dust', 0, { |v| ~granulator.dust_(v) });
~to.button('/track/back', 0, { |v| ~granulator.back_(v)});
~to.button('/track/slope', 0, { |v| ~granulator.slope_(v) });
~to.button('/track/slope', 1, { |v| ~granulator.slope_(v) });
~to.button('/track/chorus', 0, { |v| ~granulator.chorus_(v) });
~to.slider('/track/harmonics', 2, TouchOSCScale(0.5, 3), { |v|

View File

@ -15,7 +15,7 @@ Routine.run({
~usbinput1 = 2;
~usbinput2 = 3;
~bpm = 85;
~bpm = 90;
~bps = ~bpm / 60;
~beatsperbar = 4;
~buflen = ~beatsperbar / ~bps;
@ -38,9 +38,9 @@ Routine.run({
s.sync;
("./sequencer.scd").loadRelative;
s.sync;
"please wait for the interface to load...".postln;
~buflen.sleep;
"loading interface".postln;
("./interface.scd").loadRelative;
"ok go!".postln;
});
)

View File

@ -15,11 +15,12 @@ SynthDef(\pos_reverse, {
Out.kr(out, EnvGen.kr(Env([1, 0], length), doneAction: Done.freeSelf))
}).add();
// SynthDef(\pos_step, {
// arg out, speed=1, steps=8;
// var stepwise = LFSaw.kr(speed, 1, 0.5 * steps, 0.5 * steps).floor;
// Out.kr(out, stepwise / steps);
// }).add;
SynthDef(\pos_step, {
arg out, length=1;
var levels = (0..8) / 8, times = (length / 8) ! 7;
Out.kr(out, EnvGen.kr(Env(levels: levels, times: times, curve: \hold), doneAction: Done.freeSelf));
}).add();
SynthDef(\lfo, {
arg out, freq=1, amp=0;
@ -42,4 +43,3 @@ SynthDef(\metronome, {
).add;
)