Quantcast

Pbind and Pdef timing

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Pbind and Pdef timing

M Loader
Hi,

Not sure how to word this, so I hope the below question makes sense.

When I use Pbind and Pdef to create rhythms which I can change on-the-fly, how can I stop it “cutting” the sound it is already making and wait until the sound has finished before running the new code? I have noticed this happening for example when I change the \cntl array to [1,1,1,0,0] and re-run the Pdef(\player, ~player).play;

I have had a look in the help files and online but think I might have missed something, would it be a clock function or a wait command?

Many thanks,
Mint

// -  Pbind and Pdef example - 

(
SynthDef(\perc, { |freq=115, amp=1, cntl=1, releaseTime=0.2, outBus=0|
var sig;
sig = SinOsc.ar(freq, 0.1*pi, amp);
sig = sig*EnvGen.ar(Env.perc(0.01, releaseTime), levelScale: cntl, doneAction:2);
sig = Pan2.ar(sig);
Out.ar(outBus, sig);
}).add;
)
(
~player = Pbind(
\instrument, \perc,
\freq, 115,
\amp, 1,
\cntl, Pseq([1,0,0,1,1,0], inf),
\dur, 0.3,
);
)

Pdef(\player, ~player).play;
Pdef(\player).stop;
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pbind and Pdef timing

Fredrik Olofsson
hi,
i guess by 'cutting' you mean 'not quantizing'.  if so then...

//first set the default clock's tempo
TempoClock.default.tempo= 100/60;

//then change the dur to something that divides evenly to a bar
(
~player = Pbind(
        \instrument, \perc,
        \freq, 115+100.rand,
        \amp, 1,
        \cntl, Pseq([1,1,1,0,0,0], inf),
        //\cntl, Pseq([1,0,0,1,1,0], inf),
        \dur, 0.5  //here eight notes at 100bpm instead of your previous 0.3 at 60bpm (the default)
);
)

//last set quant - here pdef will start playing at the next 3/4 bar (3/4 because i guessed that your pattern was 6 eightnotes)
Pdef(\player).quant= 3;

Pdef(\player, ~player).play
//change ~player and then .play again

Pdef(\player).stop;

that should keep everything together.

but perhaps you meant to wait until cntl is finished regardless of beats&bars&clock?  that's also possible but a bit more complicated.  email again if so.
_f

> 7 jan 2017 kl. 14:25 skrev M Loader <[hidden email]>:
>
> Hi,
>
> Not sure how to word this, so I hope the below question makes sense.
>
> When I use Pbind and Pdef to create rhythms which I can change on-the-fly, how can I stop it “cutting” the sound it is already making and wait until the sound has finished before running the new code? I have noticed this happening for example when I change the \cntl array to [1,1,1,0,0] and re-run the Pdef(\player, ~player).play;
>
> I have had a look in the help files and online but think I might have missed something, would it be a clock function or a wait command?
>
> Many thanks,
> Mint
>
> // -  Pbind and Pdef example -
>
> (
> SynthDef(\perc, { |freq=115, amp=1, cntl=1, releaseTime=0.2, outBus=0|
> var sig;
> sig = SinOsc.ar(freq, 0.1*pi, amp);
> sig = sig*EnvGen.ar(Env.perc(0.01, releaseTime), levelScale: cntl, doneAction:2);
> sig = Pan2.ar(sig);
> Out.ar(outBus, sig);
> }).add;
> )
> (
> ~player = Pbind(
> \instrument, \perc,
> \freq, 115,
> \amp, 1,
> \cntl, Pseq([1,0,0,1,1,0], inf),
> \dur, 0.3,
> );
> )
>
> Pdef(\player, ~player).play;
> Pdef(\player).stop;


  #|
     fredrikolofsson.com     musicalfieldsforever.com
  |#


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pbind and Pdef timing

.o0o.
In reply to this post by M Loader

i think i understand. youre killing the synthdef.

maybe this works better for you....at least if i got what you mean.

you can reevaluate the code and it will be updatet on your

next beat.


best


flo.


(
Pdef(\tong,
    Pbind(
    \instrument, \perc,
    \freq, 115,
    \amp, 1,
    \cntl, Pseq([0,0,1,1,1,0], inf), //change while playing and cmd+enter
    \dur, 0.3,
)
).play;
)


Am 07/01/2017 um 14:25 schrieb M Loader:

// -  Pbind and Pdef example - 

(
SynthDef(\perc, { |freq=115, amp=1, cntl=1, releaseTime=0.2, outBus=0|
var sig;
sig = SinOsc.ar(freq, 0.1*pi, amp);
sig = sig*EnvGen.ar(Env.perc(0.01, releaseTime), levelScale: cntl, doneAction:2);
sig = Pan2.ar(sig);
Out.ar(outBus, sig);
}).add;
)
(
~player = Pbind(
\instrument, \perc,
\freq, 115,
\amp, 1,
\cntl, Pseq([1,0,0,1,1,0], inf),
\dur, 0.3,
);
)

Pdef(\player, ~player).play;
Pdef(\player).stop;

ROMANES EUNT DOMUS
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pbind and Pdef timing

M Loader
In reply to this post by Fredrik Olofsson
Hi Fredrik,

Quantising was the word I was looking for instead of cutting, thank you. What I was thinking was to just change the rhythm of the next beat, which after playing with your code I can do with the quant=1.

Experimenting and thinking about this way of coding opens up lots more ideas for me and would help me run multiple Pbind’s in time, this is the part I love with SuperCollider when I learn something new and it opens up so many more possibilities and ideas.

I general don’t think in terms musical bars/beats etc and just fill an array for \cntl with how many 1’s and 0’s I feel like, very chaotic! So I think now is the time to start take more note of the structure of the music I make.

Thank you very much for help.
Mint



> On 7 Jan 2017, at 15:42, Fredrik Olofsson <[hidden email]> wrote:
>
> hi,
> i guess by 'cutting' you mean 'not quantizing'.  if so then...
>
> //first set the default clock's tempo
> TempoClock.default.tempo= 100/60;
>
> //then change the dur to something that divides evenly to a bar
> (
> ~player = Pbind(
> \instrument, \perc,
> \freq, 115+100.rand,
> \amp, 1,
> \cntl, Pseq([1,1,1,0,0,0], inf),
> //\cntl, Pseq([1,0,0,1,1,0], inf),
> \dur, 0.5  //here eight notes at 100bpm instead of your previous 0.3 at 60bpm (the default)
> );
> )
>
> //last set quant - here pdef will start playing at the next 3/4 bar (3/4 because i guessed that your pattern was 6 eightnotes)
> Pdef(\player).quant= 3;
>
> Pdef(\player, ~player).play
> //change ~player and then .play again
>
> Pdef(\player).stop;
>
> that should keep everything together.
>
> but perhaps you meant to wait until cntl is finished regardless of beats&bars&clock?  that's also possible but a bit more complicated.  email again if so.
> _f
>
>> 7 jan 2017 kl. 14:25 skrev M Loader <[hidden email]>:
>>
>> Hi,
>>
>> Not sure how to word this, so I hope the below question makes sense.
>>
>> When I use Pbind and Pdef to create rhythms which I can change on-the-fly, how can I stop it “cutting” the sound it is already making and wait until the sound has finished before running the new code? I have noticed this happening for example when I change the \cntl array to [1,1,1,0,0] and re-run the Pdef(\player, ~player).play;
>>
>> I have had a look in the help files and online but think I might have missed something, would it be a clock function or a wait command?
>>
>> Many thanks,
>> Mint
>>
>> // -  Pbind and Pdef example -
>>
>> (
>> SynthDef(\perc, { |freq=115, amp=1, cntl=1, releaseTime=0.2, outBus=0|
>> var sig;
>> sig = SinOsc.ar(freq, 0.1*pi, amp);
>> sig = sig*EnvGen.ar(Env.perc(0.01, releaseTime), levelScale: cntl, doneAction:2);
>> sig = Pan2.ar(sig);
>> Out.ar(outBus, sig);
>> }).add;
>> )
>> (
>> ~player = Pbind(
>> \instrument, \perc,
>> \freq, 115,
>> \amp, 1,
>> \cntl, Pseq([1,0,0,1,1,0], inf),
>> \dur, 0.3,
>> );
>> )
>>
>> Pdef(\player, ~player).play;
>> Pdef(\player).stop;
>
>
>  #|
>     fredrikolofsson.com     musicalfieldsforever.com
>  |#
>
>
> _______________________________________________
> sc-users mailing list
>
> info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
> archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
> search: http://www.listarc.bham.ac.uk/lists/sc-users/search/


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Loading...