First time here? Check out the FAQ!
x

SoundtoGlobalController - generating repeating ramp (forwards and backwards)

0 votes
274 views
Hi (me again, sorry).

Ok, so i'm trying to trial some things prior to purchasing a Monome Arc and one of the things i'm interested in doing is generating a !hotvalue or signal which i can then in turn use to send out from Kyma via OSC to control the leds on the encoders of the Arc.  I'm trying to take a !TimeIndex_rate control (that's present within NEL GrainFrame) and use that to create a !GeneratedArcLEDNumber (using a STGC) that moves from 0 to 63 (the 64 leds on the Arc) - so the faster the !TimeIndex_rate the faster the Leds will light up and appear to cycle round the Arc.  Using a negative !TimeIndex_rate will cause the Leds to travel backwards round the Arch (anti-clockwise).  

As guided to I'm looking into the accumulateWhile: options which is largely doing what i want except i can't work out how i'd clip it so that it accumulates between 0 and 63 and resets automatically when it hits 63 (to start the Arc from the first LED again and keep it spinning).  I can't refer to the !GeneratedArcLEDNumber within the STGC.

Here is what I'm using:

(!Size * !TimeIndex_rate) accumulateWhile: !Accumulate initialValue: !TimeIndexPosition reset: !Reset

I'm probably approaching the wrong way - any hints would be much appreciated; hopefully what i'm trying to do makes sense.

Thanks so much!

Geoff
asked Jul 5, 2020 in Capytalk & Smalltalk by ghood (Master) (3,060 points)
Edit: I wonder whether using a sample with a ramp loaded in that I could traverse through forward and backwards at different rates would do what I want...

1 Answer

0 votes

0 to 63 (the 64 leds on the Arc) - so the faster the !TimeIndex_rate the faster the Leds will light up and appear to cycle round the Arc.  Using a negative !TimeIndex_rate will cause the Leds to travel backwards round the Arch (anti-clockwise).  

To generate 0 to 63 in a cycle, you could set the Value of the SoundToGlobalController to:

(1 bpm: !BPM) countTriggersMod: 64 reverse: !Reverse reset: !Reset 

Here's an example Sound.

answered Jul 5, 2020 by ssc (Savant) (127,060 points)
Thanks but is there a way that links it to the !TimeIndex_rate as in my example, not a BPM (which is relying on a trigger to step through the values).

I think I'm getting close via:

(!TimeIndex_rate gt: 0) true: ((1 repeatingRamp: ('StravinskyH71093.wav' sampleFileDuration s) * (!TimeIndex_rate inverse) abs)) * 63 false: ((1 repeatingRamp: ('StravinskyH71093.wav' sampleFileDuration s) * (!TimeIndex_rate inverse) abs) negated * 63) + 63

This cycles 0 to 63 slower/faster depending on the !TimeIndex_rate and 63 to 0 when !TimeIndex_rate is negative.  However, it doesn't behave as I'd like when it crosses from positive to negative (true to false).
I think I’ve managed to get it working using a sample with a ramp loaded, that I can reverse through and is based on rate.
...