Quantcast

Question about sequencing without pattern

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

Question about sequencing without pattern

chanof
This post was updated on .
Hi there i try to obtain a  stream of trig and also duration messages from the sequence without pattern,
I need it for scale the envelope for every specific duration of each step.
Cold some one help me about?
Thanks


{
        g={Dseq([Dshuf(((1/8!14) ++ (1/16!4)), 4)],inf)}!1;
        t= Duty.ar(g,0,g);
        r = TDuty.ar(g,0,g,0,0);
        //u= Trig.ar(r,t);
        e= EnvGen.ar(Env([1/8,1,1,1/8,1/8],[0.001,t-0.002-(1/64),0.001,1/64]),r);
        SinOsc.ar(440+SinOsc.ar(1740,0,220))*e
}.play
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Question about sequencing without pattern

Fredrik Olofsson
hi,
this is difficult and your example have big problems.

first, if you use the same Dseq in multiple places (see 'g' inside both Duty and TDuty in your example) it will behave in a non-intuitive way as it will not copy but rather take values from the same stream.  to fix that you can wrap your Dseq in a Pstutter.  it will repeat each value from the stream.  in my example below i use g twice so Dstutter 2.

another issue is the envelope triggering.  you'll need to delay it slightly.

note that what makes this difficult is in part the Dshuf.  if you make your patterns deterministic your code can be simplified.

{
        var g, t, d, e;
        //g=Dstutter(2, Dseq([Dseq(((1/8!4) ++ (1/16!4)), 4)],inf));  //deterministic dseq durations
        g=Dstutter(2, Dseq([Dshuf(((1/8!14) ++ (1/16!4)), 4)],inf));  //dseq durations with stutter two because we use g twice
        t=TDuty.ar(g*3);  //trigger
        d=Demand.ar(t, 0, g); //duration
        d.poll(t);
        e= EnvGen.ar(Env([1,1,0],[0,d]),TDelay.ar(t, ControlDur.ir));
        SinOsc.ar(440)*e!2
}.play(fadeTime:0)

_f

> 7 mar 2017 kl. 23:41 skrev chanof <[hidden email]>:
>
> Hi there i try to abtain a  stream of trig and also duration messages from
> the sequence without pettern,
> I need it for scale the envelope for every specific duration of each step.
> Cold some some one help me about?
> Thanks
>
>
> {
> g={Dseq([Dshuf(((1/8!14) ++ (1/16!4)), 4)],inf)}!1;
> t= Duty.ar(g,0,g);
> r = TDuty.ar(g,0,g,0,0);
> //u= Trig.ar(r,t);
> e= EnvGen.ar(Env([1/8,1,1,1/8,1/8],[0.001,t-0.002-(1/64),0.001,1/64]),r);
> SinOsc.ar(440+SinOsc.ar(1740,0,220))*e
> }.play
>
>
>
>
> --
> View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Question-about-sequencing-without-pattern-tp7631054.html
> Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.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/


  #|
     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: Question about sequencing without pattern

chanof
Thanks Fredrik, your share is very useful, could you help me about create two instances of the same sequence algorithm, one to the left and the other to the right, it don't work like before.

{
        var g, t, d, e;
        //g=Dstutter(2, Dseq([Dseq(((1/8!4) ++ (1/16!4)), 4)],inf));  //deterministic dseq durations
            g={Dstutter(2, Dseq([Dshuf(((1/8!14) ++ (1/16!4)), 4)],inf))}!2;  //two istance of the same sequence
        t=TDuty.ar(g*3);  //trigger
        d=Demand.ar(t, 0, g); //duration
        d.poll(t);
        e= EnvGen.ar(Env([1,1,0],[0,d]),TDelay.ar(t, ControlDur.ir));
        SinOsc.ar(440)*e
}.play(fadeTime:0)




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

Re: Question about sequencing without pattern

Fredrik Olofsson
happy that i can help.
yes, multichannel expansion together with demand rate ugens is hard.
one way to do it is to wrap _everything inside a function.  like this...
{
        {
                var g, t, d, e;
                g=Dstutter(2, Dseq([Dshuf(((1/8!14) ++ (1/16!4)), 4)],inf));
                t=TDuty.ar(g*3);  //trigger
                d=Demand.ar(t, 0, g); //duration
                d.poll(t);
                e= EnvGen.ar(Env([1,1,0],[0,d]),TDelay.ar(t, ControlDur.ir));
                SinOsc.ar(440)*e
        }!2;
}.play(fadeTime:0)


another, perhaps better, way is to only wrap the demand rate related ugens inside a function.  like here...
{
        var seq= {
                var g, t, d;
                g=Dstutter(2, Dseq([Dshuf(((1/8!14) ++ (1/16!4)), 4)],inf));
                t=TDuty.ar(g*3);  //trigger
                d=Demand.ar(t, 0, g); //duration
                EnvGen.ar(Env([1,1,0],[0,d]),TDelay.ar(t, ControlDur.ir));
        }!2;
        SinOsc.ar(440)*seq;
}.play(fadeTime:0)

_f

> 9 mar 2017 kl. 21:54 skrev chanof <[hidden email]>:
>
> Thanks Fredrik, your share is very useful, could you help me about create two
> instances of the same sequence algorithm, one to the left and the other to
> the right, it don't work like before.
>
> {
>        var g, t, d, e;
>        //g=Dstutter(2, Dseq([Dseq(((1/8!4) ++ (1/16!4)), 4)],inf));
> //deterministic dseq durations
>    g={Dstutter(2, Dseq([Dshuf(((1/8!14) ++ (1/16!4)), 4)],inf))}!2;  //two
> istance of the same sequence
>        t=TDuty.ar(g*3);  //trigger
>        d=Demand.ar(t, 0, g); //duration
>        d.poll(t);
>        e= EnvGen.ar(Env([1,1,0],[0,d]),TDelay.ar(t, ControlDur.ir));
>        SinOsc.ar(440)*e
> }.play(fadeTime:0)
>
>
>
>
>
>
>
>
> --
> View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Question-about-sequencing-without-pattern-tp7631054p7631094.html
> Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.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/


  #|
     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: Question about sequencing without pattern

chanof
Thanks all clear, yes the second one is perfect, but i can't understand why the sequence run at the half frequency/speed, but the envelope length is right (0.125..ecc)
Thanks
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Question about sequencing without pattern

Fredrik Olofsson
not sure i understand what you are trying to do, but this works quite ok i think...
(
{
        var dur= 2.5;
        var legato= 0.75;
        var seq= {
                var g, t, d;
                g=Dstutter(2, Dseq([Dshuf(((1/8!14) ++ (1/16!4)), 4)],inf))*dur;
                t=TDuty.ar(g);  //trigger
                d=Demand.ar(t, 0, g); //duration
                EnvGen.ar(Env([1,1,0],[0,d*legato]),TDelay.ar(t, ControlDur.ir));
        }!2;
        SinOsc.ar([440, 660])*seq;
}.play(fadeTime:0)
)

_f

> 9 mar 2017 kl. 23:42 skrev chanof <[hidden email]>:
>
> Thanks all clear, yes the second one is perfect, but i can't understand why
> the sequence run at the half frequency/speed, but the envelope length is
> right (0.125..ecc)
> Thanks
>
>
>
> --
> View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Question-about-sequencing-without-pattern-tp7631054p7631099.html
> Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.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/


  #|
     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: Question about sequencing without pattern

chanof
Thanks Fredrik fro your special help!
Loading...