First time here? Check out the FAQ!
x

How to produce a trigger event at specified "onset values" ?

0 votes
64 views
For example, an onset value of 2.5 would be between "beats" or "pulses" 2 & 3, where the beat/pulse rate is defined with an expression using !BPM.

I want to supply some onset-values via OSC to a module that can then generate a trigger at each of the onset values, in terms of the BPM (or some fraction thereof).

update:
I found the "gateWhen" Capytalk message, although I've so far only found examples of it being used within the gate field of a Multisample.  I'm looking for a module that can accept an OscillatorTimeIndex, set as a linear ramp from -1...1 (or perhaps a "tick" message within a local parameter), and then output a trigger whenever the time-index reaches a specified value, defined using the "gateWhen" message.  Right now I'm attempting to use a Constant, as well as a SoundToGlobalController.. my only reservation going forward with this however, is that neither outputs a gate as is, therefore I'm not sure where or how the gateWhen message might work.

I'm thinking something like this might work in the "right field of the right module"**:

1 gateWhen: TIME-INDEX = (((1.5 || 2.5 || 3.618 || 4.382 ) / 2) - 1.0)

provided I use the correct syntax and the collect: message to map over the array of values (then "OR" them together using something similar to a "reduce" function or the like).

** I'm trying a separate StepSequencer next as well to try to generate the triggers at specific onset times.
asked Jan 31 in Using Kyma by thom-jordan (Practitioner) (460 points)
edited Jan 31 by thom-jordan

1 Answer

+1 vote

One approach would be to use the StepSequencer.  Let's say that you wanted a pattern of onsets that you gave in your example and that the total cycle time in beats is 8.  Then in the Durations field, you could use:

{
| prevOnset |
prevOnset := 0.

#(1.5 2.5  3.618 4.382 8) collect: [:onset | 
    | dur |
    dur := onset - prevOnset.
    prevOnset := onset.
    dur]}

In the KeyDowns field, you would use:

0 1

and in this case you would set the endIndex to 4.

In the Rate field, you would use:

!BPM / 60

This is in terms of fractions of a beat, and you can change the duration of a beat by changing !BPM.  Your Array could contain EventValues (mapped to OSC as you described) rather than those fixed values in the example.  Just ensure that the final value in the Array is the "bar length" or the cycle length of the sequence so you can compute the final duration in the sequence.

 

answered Jan 31 by ssc (Savant) (56,310 points)
A-ha ! Thank you very much for clarifying the entire approach here... there is lots of meaning and valuable info for me packed into the solution here.. this should keep me going with variations on this theme for awhile, after implementing this one particular use case. Thanks again !
...