A little confused on programming sequencer grid spaces to midi notes.

117 views
Skip to first unread message

Zachary Rogers

unread,
Aug 23, 2017, 2:59:04 PM8/23/17
to Lightjams
Hi all,

Title is pretty explanatory. Anyone have any code written up for this or a clear explanation on programming it myself? New LJ user.

Thanks,

-Z

Mathieu

unread,
Aug 23, 2017, 3:31:01 PM8/23/17
to ligh...@googlegroups.com
Hi,

I'm not sure to understand what you mean by "spaces to midi notes"? Do you want to create a sequencer that moves forward each time a midi note is pressed?

Zachary Rogers

unread,
Aug 23, 2017, 4:08:37 PM8/23/17
to Lightjams
Wow, thank you for your quick reply, Mathieu! I love your software.

On my sequencer grid, how do I assign a midi note to move the source to a corresponding space(pixel) on the x-axis? 

So if I hit C1 on my keyboard, it moves the source (on my sequencer grid) to the first pixel on the x-axis. If I hit C#1, it moves the source to the second pixel. If I hit C2, it moves the source to the 13th pixel.

I hope I'm making sense. It seems like this would be the most simple setup for controlling scene changes via midi keyboard, but I haven't seen anyone else's workflow on how to accomplish this.

Thanks for your help.

Mathieu

unread,
Aug 23, 2017, 4:14:56 PM8/23/17
to Lightjams
Ok, I understand now :)

Try this for the x slider of your source: xtopercent(midi.note.latest(1)-37)

C1 is note 37. C#1 is 38, D1 is 39, etc. This is for channel 1, so modify midi.note.latest(channel) to use the channel you want.

Zachary Rogers

unread,
Aug 23, 2017, 4:20:33 PM8/23/17
to Lightjams
Ah, perfect! I'll try this today.

--
You received this message because you are subscribed to a topic in the Google Groups "Lightjams" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lightjams/H6xRrUviTJY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lightjams+...@googlegroups.com.
To post to this group, send email to ligh...@googlegroups.com.
Visit this group at https://groups.google.com/group/lightjams.
For more options, visit https://groups.google.com/d/optout.

Zachary Rogers

unread,
Nov 14, 2017, 10:44:53 PM11/14/17
to Lightjams
Hi Mathieu,

This setup has been working really well and everyone has been loving my lights. I hope you can help me one more time. I've been trying to figure out the syntax, but I haven't been able to find the right commands and how exactly to use them.

In order to simplify my midi setup, how would I change this so that when I hit one midi note, the source is moved along the x-axis to a random point within a certain range? I'm hoping to have just two buttons, when the first one is hit, the source moves to a random point in between 0% - 50% and the second button moves the source to a random point in between 51% - 100%.

Thank you again,

-Z

Mathieu

unread,
Nov 15, 2017, 9:38:03 AM11/15/17
to Lightjams
Hi,

Here's a formula using OSC:

if(onbeat(osc(0)), xtopercent(randint(0, grid.lastx/2)), if(onbeat(osc(1)), xtopercent(randint(grid.lastx/2+1, grid.lastx)), last ))

Replace osc(0) and osc(1) by your MIDI notes.

Zachary Rogers

unread,
Nov 15, 2017, 11:20:07 AM11/15/17
to ligh...@googlegroups.com
Would not have been able to figure that one out by myself. Thank you very much, Mathieu!

--

Joe Citizen

unread,
Jan 3, 2018, 8:28:12 PM1/3/18
to Lightjams
HI Mathieu, 

Thanks for this awesome software! Really loving it, but the programming side is completely baffling - can we please have some step by step tutorials on it for us non-programmers?

I'm using a korg nanopad to test lighting changes using MIDI. Starting to understand the xtopercent(midi.note.latest(1)-37) math, and have used this for scene changes (useful!) but how can I use this for both a scene changing group and attached to (for instance) a 'X' slider for intensity? In other words, can I use lower numbers to trigger scene changes, and higher numbers for slider changes, whilst remaining on the same channel?

Thanks in advance,

Joe

Mathieu

unread,
Jan 3, 2018, 9:06:58 PM1/3/18
to Lightjams
The midi.note.latest function takes optional parameters called firstNoteIndex and lastNoteIndex. So if you want to use it to track only note from 1 to 37, you can try: midi.note.latest(1,1,37). 


Joe Citizen

unread,
Jan 3, 2018, 11:01:27 PM1/3/18
to Lightjams
Thanks very much for quick reply..
Reply all
Reply to author
Forward
0 new messages