[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] convert audio files tempo/dur to globol tempo
- To: sc-users@xxxxxxxxxxxxxxxx
- Subject: Re: [sc-users] convert audio files tempo/dur to globol tempo
- From: David Hughes <mr.mr.shoes@xxxxxxxxxxxxxx>
- Date: Fri, 6 Mar 2009 15:17:52 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Yg4HOi8Py/nNtqA20hG7g1dghQ8Tvv9rXT0AMvGNJQo=; b=xHYDuraRnbpjM67BrdxG7vbzDzb6vZUb/S6pz20isdbQ4fpmRGfSWLPxDd9O4s1NNT G0dX7ihO4vCfEye6oo+my4zvQLh1BOoEYd5dBEd5E83TbMDESxKUoECDbsrcUBYNOMDX jETUwKx399tZouIYIxyvallW4egq2ga7E9DKA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=rl9sP3FF9i09IRZREyt2xnh/NC455KgztuIpEYXf+2bHVlbk+MyN76r1CXb0y+UyQ8 BDmpMXZoBpjHLW1iZT2JRTvKa38eF3Xe9zhUmpTslB6FfhzuTg+4n/LloHkXjrI/ywSK eAmKVAWvRUGnF98P/KHDK6UpTIP5VezCILupY=
- In-reply-to: <22337935.post@xxxxxxxxxxxxxxx>
- List-id: SuperCollider users mailing list <sc-users.create.ucsb.edu>
- References: <22337935.post@xxxxxxxxxxxxxxx>
- Reply-to: sc-users@xxxxxxxxxxxxxxxx
- Sender: owner-sc-users@xxxxxxxxxxxxxxxx
Hia again.
sorry for the ill thought out post, basically thinking out loud
(well, more being loud than thinking :))
I've made progress since i last posted. i just happened to trundled my way through the math. it will probably take a day or two more for it to sink in properly.
anyway here is what i've got so far
a = Buffer.read(s,"sounds/break"); //8 beats
(
~rateScale = {arg numOfBars=2,numOfBeats=8,tempo=120,buffer,barMeterBeatVal=1;
//barMeterBeatVal 0.125 = 1/32 Beat, 0.25 = 1/16 Beat, 0.5 = 1/8 Beat
//1 = 1/4 Beat, 2 = 1/2 Beat
var barMeterNumBeats,tempoDur,fileDur,calcRatio;
barMeterNumBeats = numOfBeats/numOfBars;
tempoDur =(((barMeterBeatVal*60)/tempo)*(numOfBeats/numOfBars));
fileDur = ((buffer.numFrames/buffer.sampleRate)/numOfBars);
calcRatio = (tempoDur/fileDur);
calcRatio.reciprocal;
};
)
1.0*~rateScale.value(2,8,150,a,1);
(
SynthDef(\test,{arg out=0,gate=1,buffer,rate=1;
Out.ar(out,
PlayBuf.ar(1,buffer,BufRateScale.kr(buffer)*rate,1,0)*
EnvGen.kr(Env.asr(0.001,1,0.1,\sine),gate,doneAction:2));
}).memStore;
)
(
Pbind(\instrument,\test,
\tempo,180/60,
\dur,8,
\buffer,a,
\rate,Pseq([1.0,0.5],inf)*~rateScale.value(2,8,180,a,1);,
\legato,1).play(quant:0);
Pbind(\dur,1,
\legato,0.01,
\freq,600).play(quant:0);
)
cheers
d.shoes