I’m going to try and modify ~swingify to use my own groove templates with patterns.
Before I start I wondered if anyone had tried this before to help me get started?
Thanks.
hi Lewis, any news on the topic? i would be curious to hear from some adjustments made on the ~swingify.
A way to introduce some news patterns from different inspirations (natural sound or other piece of audio…)
thanks ^^
been cheesing myself with the following
SynthDef(\reee,{|out=0,dur|Out.ar(out,Saw.ar(300,EnvGen.kr(Env.perc(releaseTime: dur) ,doneAction: 2)))}).add;
(
Pchain(
~swingify,
Pbind(\instrument, \reee,
\dur, 0.25
),
(swingBase: 3, swingAmount: 0.2, swingThreshold: 0.05)
).play;
)
still great though =D
I ended up with this:
Prout({ |ev|
var now, nextTime=0,
thisShouldQuant, nextShouldQuant=false, witch,
quantTimes1, quantTimes2, quantBase1, quantBase2,
quantBaseDif1, quantBaseDif2, quantBaseDif,
quantThreshold, quantAmount, adjust;
while { ev.notNil } {
now = nextTime;
nextTime = now + ev.delta;
thisShouldQuant = nextShouldQuant;
witch = q.groovebutt_hindi_dic[i]; // chooses 1 of 5 templates
quantTimes1 = q.quantArray_dic[ witch ][0]; // an array of deltas to quant to shown in number boxes
quantTimes2 = q.quantArray_dic[ witch ][1];
quantBase1 = quantTimes1.indexIn(now%4);
quantBase2 = quantTimes2.indexIn(now%4);
quantBaseDif1 = quantTimes1[quantBase1] - (now%4);
quantBaseDif2 = quantTimes2[quantBase2] - (now%4);
quantBaseDif = quantBaseDif1.blend(
quantBaseDif2,
q.grooveTemplateSlid_dic[ witch ] // crossfades between 2 groove arrays in each template
); // these have to be same size
quantThreshold = q.groovyTempleThreshBoxes_dec[ witch ];
quantAmount = q.groovyTempleAmtBoxes_dec[ witch ];
nextShouldQuant = quantBaseDif.abs <= (quantThreshold ? 0);
adjust = quantBaseDif * quantAmount;
if( thisShouldQuant,
{
ev[\timingOffset] = (ev[\timingOffset] ? 0) + adjust;
if( nextShouldQuant.not,
{ ev.sustain = ev.use{~sustain.value} - adjust }
);
},
{
if( nextShouldQuant,
{ ev.sustain = ev.use{~sustain.value} + adjust }
);
}
);
ev = ev.yield;
};
})
If there are any glaring errors I would be happy to hear, but seems to work OK in a Pchain before input pattern.
I used FluidAmpSlice to get grooves from audio if needed.
https://learn.flucoma.org/reference/ampslice/
I think the values below were from Ableton’s MPC53% groove.
ATB,
L.
1 Like