InstrGateSpawner - delta

View: New views
3 Messages — Rating Filter:   Alert me  

InstrGateSpawner - delta

by mrmrShoes :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In the instrgatespawner help it says that the delta can take a

delta - a float, function or stream in beats,

i've been playing around with this code which is a striped down version of the examples in the help.
(
InstrGateSpawner({arg freq,mod,rq=0.5, width,env, dur, tempo;
  var gate;
  gate = Trig1.kr(1,dur/tempo);
 
  RLPF.ar(
    Pulse.ar(freq,
           width,
             0.5)*
    EnvGen.kr(env,gate,0.15,doneAction:2),
    mod,
    rq)
    },
    [
    Pseq([31,32,37,38,42,45,50,51,32,33,33,33,32].midicps,inf),
    Patch({ SinOsc.kr(0.1).range(190,3000)}),
    0.1,
    Patch({FSinOsc.kr(0.01).range(0.01,0.99)}),
    Env.adsr(0.02,0.02,0.5,0.25),
    Pseq([0.21,0.01,0.125,0.25,0.25,1.0,0.25,0.21,0.02,0.25,0.21,0.21,0.21,0.01],inf),
    TempoPlayer.new
    ],
 0.25
//Pseq([0.25,0.25,0.25,0.5,1.0],inf)
).play(atTime:1)
)


 I have been trying to sequence the notes duration aswell as the spawner's delta with pattern's. i keep getting an error when placing a pattern to control the delta.

InstrSynthDef built: f-1502058850*1920215820
ERROR: Message 'default' not understood.
RECEIVER:
   nil
ARGS:

a fixed float works fine. i'm probably missing something simple. in the help file a Pfunc is used to update the delta randomly but i was hoping to be able to define a sequence with a pattern, which is also covered but i'm just not getting it.
sorry if this has been covered before.
 cheers

mrmrshoes




Re: InstrGateSpawner - delta

by felix-38 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

yes, this bug was on my list.  I couldn't figure it out.   I just fixed it and you can update from svn.
(the bug was that the args array was accidentally being altered whenever I called this.children)

your example works now.

also, Tempo.kr now works inside InstrSpawner so you don't need to pass in a tempo arg


InstrGateSpawner({arg freq,mod,rq=0.5, width,env, dur;
 var gate;
 gate = Trig1.kr(1,dur/Tempo.kr);

 RLPF.ar(
   Pulse.ar(freq,
          width,
            0.5)*
   EnvGen.kr(env,gate,0.15,doneAction:2),
   mod,
   rq)
   },
   [
       Pseq([31,32,37,38,42,45,50,51,32,33,33,33,32].midicps,inf),
       Patch({ SinOsc.kr(0.1).range(190,3000)}),
       0.1,
       Patch({FSinOsc.kr(0.01).range(0.01,0.99)}),
       Env.adsr(0.02,0.02,0.5,0.25),
       Pseq([0.21,0.01,0.125,0.25,0.25,1.0,0.25,0.21,0.02,0.25,0.21,0.21,0.21,0.01],inf)
   ],
    // 0.25
    Pseq([0.25,0.25,0.25,0.5,1.0],inf)
)
.play(atTime:1)




On Fri, Jul 11, 2008 at 11:49 PM, mrmrShoes <mr.mr.shoes@...> wrote:



 I have been trying to sequence the notes duration aswell as the spawner's
delta with pattern's.


also play around with:
    Pfunc({ arg igs;
        (igs.beat * sample.beatsize).wrap(0,sample.end) // in samples
    }),

you will get the igs passed in to your func.
igs.delta will be whatever the current delta till the next event is.

so you can do legato as PFunc({ |igs| igs.delta * 0.9 })

actually a PIGdelta and PIGSbeat pattern might be useful

then you can express legatos like this:

PIGdelta.new * Pseq([0.9,1.1,0.2],inf)


-f;lix

 
i keep getting an error when placing a pattern to
control the delta.

InstrSynthDef built: f-1502058850*1920215820
ERROR: Message 'default' not understood.
RECEIVER:
  nil
ARGS:

a fixed float works fine. i'm probably missing something simple. in the help
file a Pfunc is used to update the delta randomly but i was hoping to be
able to define a sequence with a pattern, which is also covered but i'm just
not getting it.
sorry if this has been covered before.
 cheers

mrmrshoes




--
View this message in context: http://www.nabble.com/InstrGateSpawner---delta-tp18413175p18413175.html
Sent from the Supercollider - User mailing list archive at Nabble.com.


_______________________________________________
sc-users mailing list

info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/


Re: InstrGateSpawner - delta

by mrmrShoes :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hia Felix

i've updated
Thanks alot for you time and help. I'm sorry for being a constant pain with this.
Thanks again
mrmrshoes
  


LightInTheBox - Buy quality products at wholesale price