[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-users] routine that returns events problems



Hello list,
I have a routine that returns events such as these
-> a Routine
-> ( 'instrument': X, 'buf': Buffer(...), 'dur': 0.125, 'val': x, 
  'type': note )
-> ( 'instrument': X, 'buf': Buffer(...), 'dur': 0.125, 'val': x, 
  'type': note )
-> ( 'instrument': X, 'buf': Buffer(...), 'dur': 0.125, 'val': x, 
  'type': note )
-> ( 'instrument': X, 'buf': Buffer(...), 'dur': 0.125, 'val': x, 
  'type': note )
-> ( 'type': rest, 'dur': 1.5 )
-> ( 'instrument': X, 'buf': Buffer(...), 'dur': 0.5, 'val': x, 
  'type': note )
-> ( 'instrument': X, 'buf': Buffer(...), 'dur': 0.5, 'val': x, 
  'type': note )
-> ( 'instrument': X, 'buf': Buffer(...), 'dur': 0.5, 'val': x, 
  'type': note )
-> ( 'instrument': X, 'buf': Buffer(...), 'dur': 0.5, 'val': x, 
  'type': note )

and I'd like to use it as a routine on its own, or plugging it into a pbind
so for example something like this works as I would expect:
r = <some routine as described>  
Pbindf(r, \otherKey, Pwhite(0,1), \otherKey2, Pwhite(1,1000))

the problem arises when I want to use a construction like this with nodeproxies
let's say I start like this
~kick = NodeProxy.audio(s, 2);
~kick[0] = Pbindf(r);

this is fine, the pattern plays, but it plays immediately when ~kick[0] is assigned to it (which is strange), and then when I try to apply an effect like this
~kick[1] = \filter -> { arg in;
GVerb.ar(
Shaper.ar(~someWaveShaperBuffer, in * \gain.kr(1)),
\size.kr(10),
\time.kr(1),
\damp.kr(0.1)
);
};

it has no effect, and also looking at the nodeproxy's 'scope' (from its edit gui) shows no signal.
however just taking the duration values from the routine like so restores the normal nodeproxy functionality:
~x = (instrument: \X, \buf, someBuffer);
~kick[0] = Pbindf(~x, \dur, r.collect(_.dur));

so it seems something about the routine returning events bypasses the normal nodeproxy roles and immediately plays the events 'outside' the nodeproxy context


Really hope someone can shed light on what I might be doing wrong

PS: the routines i'm using are being generated by my own class for parsing strings representing rhythms you can find here https://github.com/Endut/RhythmCompiler
and the events are being created and programmatically added to the routine like so: event.value.embedInStream;