midi.control to increase speed

43 views
Skip to first unread message

Joe Citizen

unread,
Nov 10, 2018, 3:41:45 AM11/10/18
to Lightjams
I thought I had this figured out, but I don't. How can I increase speed of a wave (decrease time for each cycle) using midi.control? I've been trying sawtooth(midi.control(2,1)+1)/2 (I don't have the midi CC yet, so the '+1' is just to give me a value to test the idea), but this just decreases the wave shape, not speed everything up. I've tried using grid.speed, but can't seem to make that work either - any suggestions please?

Joe Citizen

unread,
Nov 10, 2018, 3:58:36 AM11/10/18
to Lightjams


On Saturday, 10 November 2018 21:41:45 UTC+13, Joe Citizen wrote:
I thought I had this figured out, but I don't. How can I increase speed of a wave (decrease time for each cycle) using midi.control? I've been trying sawtooth(midi.control(2,1)+1)/2 (I don't have the midi CC yet, so the '+1' is just to give me a value to test the idea), but this just decreases the wave shape, not speed everything up. I've tried using grid.speed, but can't seem to make that work either - any suggestions please?

I've looked at the strobe formula that changes over time as found elsewhere on these forums - it uses: strobe(scale(fadein.linear(10, osc(0)), 0.05, 1)) - where I've replaced the strobe with a sawtooth and the osc message with midi.control (2,1). This is a nice effect (and I'm learning how scale can be used..), but how can I limit this effect before the midi.control note finishes? Use a counter..? but how?

Joe Citizen

unread,
Nov 10, 2018, 4:08:37 AM11/10/18
to Lightjams
This probably sits in the 'share your crazy math formulas' section.. here's what I'm doing:

randpulse(1,50,1) - sawtooth(scale(fadein.sigmoid(2, midi.control (2,0)+1*3), 1, 0.05))

I like the effect, but how can I reverse it after a certain amount of time, without waiting for the midi.control to finish? Hmmn...

Mathieu

unread,
Nov 10, 2018, 8:44:45 AM11/10/18
to ligh...@googlegroups.com
>> How can I increase speed of a wave (decrease time for each cycle) using midi.control?

Subtract the value of the midi control like this:

sawtooth(10.1-midi.control(2,1)/10)

So when the CC value is 0%, you get 10.1s and when it's 100% you get 0.1s.

If you prefer, you can use the scale function like this to do the same thing:

sawtooth(scale(midi.control(2,1),0,100, 10.1,0.1))

Joe Citizen

unread,
Nov 10, 2018, 6:01:39 PM11/10/18
to Lightjams
Thank you Mathieu. The scale function makes a lot more sense to me! 

A quick question regarding midi.control and midi.note - and I should say that I'm not actually using an instrument to generate midi but am just using it as a protocol for external sensors - but how does LJ know which channel the CC messages come in on? If for instance I write midi.control (2,1) then I want note 2 its velocity (a nice constantly changing variable) - if I just send it ch 1 will it always just learn ch 1? 

Also, how does LJ handle note on and note off messages? Thanks.

Mathieu

unread,
Nov 10, 2018, 6:24:27 PM11/10/18
to ligh...@googlegroups.com
>> how does LJ know which channel the CC messages come in on?

All MIDI messages come with the channel information. 

>> how does LJ handle note on and note off messages?

Note off It sets the note value to 0. Note on normally sets the note value to something other than 0.

Joe Citizen

unread,
Nov 10, 2018, 11:08:27 PM11/10/18
to Lightjams
Thank you!
Reply all
Reply to author
Forward
0 new messages