Trggering two midi notes at the same time

97 views
Skip to first unread message

Chris W

unread,
Jan 20, 2020, 7:24:13 PM1/20/20
to Lightjams
Hi folks
I would like to trigger two midi notes from the same pad press on my Novation Launchpad. The first Midi note will set the colour of the pad when it is pressed the second midi note will trigger a playback on my lighting desk. I also want it to toggle so second key press is required to return the state to normal. I had thought the code would look like this but Lightjams dosent like the code. 

toggle((midi.note(1,12)+(midi.note(2,97))

What do I need to change?
Thanks for your help
Chris

Robin Larsson

unread,
Jan 21, 2020, 5:06:27 AM1/21/20
to Lightjams
Hi Chris,

To start with, you need to patch your midicontroll as an output device in the patch (probably on Midi Note 2, since you wrote midi.note(2,97). There may not be a fixture profile for your specific controller, in that case you need to make one, but its fairly straight forward (atleast for most controllers, Akai APC40mk2 is a bit of a b*tch in this regard for example). 
When you have your profile, make sure you patch it on the correct universe/midichannel and on the correct adress if your controller doesnt start from note 1 on the feedback and you dont want to take up more channels than neccesary.

Then go in to Configuration (CTRL+L), and in the MIDI tab make sure that the Use tickbox for Midi Output for your controller is ticked.

Then you use the LEDs in the same way you do with your other lights, use a source that control an attribute. 
In that source you simply use Midi input, either via formula ( toggle(midi.note(1,12)) for example), or just select the Midi tab in source controls and select your input there. You can set things like toggle, fade in/out and min/max values there with tickboxes :) 

I usually have a LED trigger grid for my controllers that only control LEDs and separate sources in other grids (and things like Grid activation) to control my effects for the lighting rig. 

Different controllers works in different ways, but most I´ve used listen to the same channel/note that they send when pressed, sometimes on a different midichannel. Some controllers listen to all midichannels and react differently to the same value sent depending on which channel it was sent to. Controllers with single or dual color LEDs usually only have a few different values they want, RGB LEDs can be a bit "intense" to control...
So check your manual, see what it says about Midi feedback if you are unsure of what it wants to see.


//Robin

Mathieu

unread,
Jan 21, 2020, 9:46:06 AM1/21/20
to ligh...@googlegroups.com
Hi,

Robin already gave a pretty good answer. About your formula, the parentheses need to balance. The formula should be: toggle(midi.note(1,12)+midi.note(2,97))

If you want the first note to activate and require the 2nd note to turn off, instead of using the toggle function (which toggles each time either midi note is pressed), you can use the counter function like this:

noLoopCounter(0,1,onbeat(midi.note(1,12)), onbeat(midi.note(2,97))) > 0

This way, you can press the midi.note(1,12) any number of times to activate and you must always press the midi.note(2,97) to turn it off.

Chris Wemyss

unread,
Jan 21, 2020, 8:06:58 PM1/21/20
to ligh...@googlegroups.com
Hi Mathieu,
Thanks for that. I'll give that formula a go over the next few days. Just for info my I have some of the set up working.
1. I have a grid setting static colours on each pad on my Launchpad
2. I have a second grid - On pressing a pad the colour changes to let .know which pad has been pressed (Midi channel 1)
3. On pressing the pad for the second time the colour returns to normal
Still working on the following on----
4. The formula you provided should allow me to send a different second midi note (on midi channel 2) to trigger playbacks on my (midi note enabled) lighting console at a value of 127 .
5. On the second pad press the Midi note information on Midi ch2 will return to 0
Thanks again 
Chris

On Tue, 21 Jan 2020 at 14:46, Mathieu <mat...@lightjams.com> wrote:
Hi,

Robin already gave a pretty good answer. About your formula, the parentheses need to balance. The formula should be: toggle(midi.note(1,12)+midi.note(2,97))

If you want the first note to activate and require the 2nd note to turn off, instead of using the toggle function (which toggle each time either midi note is on), you can use the counter function like this:

noLoopCounter(0,1,onbeat(midi.note(1,12)), onbeat(midi.note(2,97))) > 0

This way, you can press the midi.note(1,12) any number of times to activate and you must always press the midi.note(2,97) to turn it off.




On Monday, January 20, 2020 at 7:24:13 PM UTC-5, Chris W wrote:
Hi folks
I would like to trigger two midi notes from the same pad press on my Novation Launchpad. The first Midi note will set the colour of the pad when it is pressed the second midi note will trigger a playback on my lighting desk. I also want it to toggle so second key press is required to return the state to normal. I had thought the code would look like this but Lightjams dosent like the code. 

toggle((midi.note(1,12)+(midi.note(2,97))

What do I need to change?
Thanks for your help
Chris

--
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/c3Ulve7GZVM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lightjams+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lightjams/b87eb81a-8e02-4a4b-af5b-38cab18203be%40googlegroups.com.


--


Chris Wemyss

Venue Manager

Mac Arts

Bridge Street,

Galashiels

TD1 1SP

TEL: 01896 756852 MOBILE: 07818284922

EMAIL: ch...@macarts.scot
WEB: www.macarts.scot

Registered Scottish Charity SC043299
Company Reg. No. 412818

This e-mail (which includes any files transmitted with it) is intended for the above named only. It may contain privileged or confidential information. If you are not the intended recipient please notify the sender immediately either by e-mail or by telephone and confirm that all copies have been destroyed and it has been deleted from your computer system. If you are not the intended recipient, you are notified that any review, dissemination or copying of this e-mail is prohibited. This e-mail is protected by copyright.

Chris Wemyss

unread,
Jan 21, 2020, 8:10:05 PM1/21/20
to ligh...@googlegroups.com
Hi Robin,
Thanks for all of that. I've already done quite a bit of what you suggested and Mathue had answered my question about the formula. 
Chris

--
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/c3Ulve7GZVM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lightjams+...@googlegroups.com.

Robin Larsson

unread,
Jan 22, 2020, 6:26:55 AM1/22/20
to Lightjams
Hi Chris!

No worries!

Maybe I misunderstood what you are trying to do? 
It seems to me like you are trying to send Midi commands directly from a formula in a Source, out to a second unit, your Lighting console in this case? 
The part marked in red below is what makes me think that this is what you are trying to do.

Am I correct in guessing that your setup consists of something like a Launchpad, Lightjams running on a computer and a Midi enabled Lighting console? 

Sources themselves doesn't send Midi directly, they can take midi inputs and do something with it in their formulas, but their output will always just be internal to Lightjams.
Until you send power from a Source to an Attribute, it wont be turned into Output signals from the software.
 

The formula Mat gave you lets you turn on the power (or range or any other function in a source) on a Source by pressing a Midi button/pad and then turn it of by pressing a different Button/Pad on your controller. 
It wont send out a Midi message directly from the formula, unless I´ve completely misunderstood how Lightjams works?

If you want to press a pad and have that send 2 different Midi output signals at the same time, you need to send power to 2 attributes, one for the Launchpad and one for the Lighting Console. 
You can either put the attributes in the same grid and control them with the same Source, or have them in separate grids and use 2 sources that are both controlled by the same Midi input. 
You do need to make a fixture profile for the Console and patch it in the Patch on the Midi.Note 2 universe.

Seems like you want the same pad to turn on its LED and the sequence on the Console when you press it the first time, and turn off its LED and stop the sequence on the console the next time you press the pad, is that correct?  

Mathieu

unread,
Jan 22, 2020, 8:46:19 AM1/22/20
to Lightjams
You're right Robin. A source just crunches numbers and doesn't output anything like DMX, MIDI, OSC, etc. To output MIDI, you do like when wanting to output DMX, that is you patch (for example) a generic dimmer and select the proper MIDI note channel as the universe. The address is the note index in this case (from 1 to 128). Then put your attribute on a grid to be in the range of the source.

All MIDI devices (with output enabled in LJ) will receive the MIDI output of Lightjams. So make sure to not send a MIDI note to the console that is also used by your MIDI controller for MIDI feedback.

Chris Wemyss

unread,
Jan 23, 2020, 6:19:31 PM1/23/20
to ligh...@googlegroups.com, robin.m...@gmail.com
Hi Robin and Matieu,
Thanks for putting in all that time to go into such detail and apologies for my lack of understanding of a lot of the terminology. What I am working on is a very basic version of this https://www.youtube.com/watch?v=tRlJN1LALFk&t=421s  Robin as you said in your reply you have understood the sort of thing I want to do
If I have some success with the Launchpad I might add an APC20,
I have already had the system working with Launchpad pads triggering lighting desk playbacks via Lightjams.(For info-I have a USB to Midi converter between my laptop and the lighting console )  so I know the system all works. I am now trying to design something that gives a clue to Launchpad pads function from the colour (For example the Hazer control may have 3 buttons allocated on the launchpad  low. med. high. All coloured white. Once the pad is pressed it will change colour/or flash so I can easily see which pad is active  )
The launchpad receives colour info on midi CH1 and the lighting console is set to receive data on midi CH2 hence the toggle(midi.note(1,12)+midi.note(2,97)) 0ne press with 2 actions.
A second grid is sending permanent colour info the the launchpad in the form of a dimmer intensity somewhere between 0 and 127 on each pad.
I think on further inspection I think I need to add "onbeat" to the formula to return a  value of 127 which results in a midi note on comand.

Do you have a list of all the math formula commands and an explanation of their use?.
all the best
Chris

On Wed, 22 Jan 2020 at 13:46, Mathieu <mat...@lightjams.com> wrote:
You're right Robin. A source just crunches numbers and doesn't output anything like DMX, MIDI, OSC, etc. To output MIDI, you do like when wanting to output DMX, that is you patch (for example) a generic dimmer and select the proper MIDI note channel as the universe. The address is the note index in this case (from 1 to 128). Then put your attribute on a grid to be in the range of the source.

All MIDI devices (with output enabled in LJ) will receive the MIDI output of Lightjams. So make sure to not send a MIDI note to the console that is also used by your MIDI controller for MIDI feedback.

--
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/c3Ulve7GZVM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lightjams+...@googlegroups.com.

Mathieu

unread,
Jan 23, 2020, 7:35:33 PM1/23/20
to ligh...@googlegroups.com
Hi Chris,

The formula toggle(midi.note(1,12)+midi.note(2,97)) doesn't output MIDI. The part "midi.note(1,12)+midi.note(2,97)" adds two numbers together as the + is really the addition operator. So basically this means that either note 12 or 97 do the toggling. It's not what you seem to want as you want to output note 97 when you're receiving note 12. 

To output MIDI in order to activate the LED of a MIDI launchpad, you do it the same way you'd control a light. The only difference is that instead of patching your light in a DMX universe, you select a MIDI note universe. 

That means that to send the note 97 with a value equal to the state of the toggle, you:
- add a source
- select the power slider
- enter the formula with the toggle like this: toggle(midi.note(1,12)) 
- patch a generic dimmer (or a generic effect would be better since it would not be affected by the master intensity) and select the MIDI note C2 (for channel 2) universe, set the address to be 97 (for note 97) 
- back to the grid with the source, put the generic dimmer over the source.

In this example, the toggle is inverted each time note 12 from channel 1 is pressed. Modify it to fit what you need or use the noLoopCounter as shown in a previous post.

The help for the formulas is here: https://www.lightjams.com/commandline.html

Chris Wemyss

unread,
Jan 26, 2020, 3:55:14 AM1/26/20
to ligh...@googlegroups.com
Thanks again Mathieu,
I had done all of the above successfully in the past. (probably without really understanding how I did it) The addition of the "+ x,x" was my downfall. I assume what you are saying is to trigger 2 midi notes from one Launchpad pad press I do the whole process above twice and patch the two different generic effect to different channels and note numbers.
Thanks for formulas link as well.
Chris

On Fri, 24 Jan 2020 at 00:35, Mathieu <mat...@lightjams.com> wrote:
Hi Chris,

The formula toggle(midi.note(1,12)+midi.note(2,97)) doesn't output MIDI. The part "midi.note(1,12)+midi.note(2,97)" adds two number together as the + is really the addition operator. So basically this means that either note 12 or 97 do the toggling. It's not what you seem to want as you want to output note 97 when you're receiving note 12. 

To output MIDI in order to activate the LED of a MIDI launchpad, you do it the same way you'd control a light. The only difference is that instead of patching your light in a DMX universe, you select a MIDI note universe. 

That means that to send the note 97 with a value equal to the state of the toggle, you:
- add a source
- select the power slider
- enter the formula with the toggle like this: toggle(midi.note(1,12)) 
- patch a generic dimmer (or a generic effect would be better since it would not be affected by the master intensity) and select the MIDI note C2 (for channel 2) universe, set the address to be 97 (for note 97) 
- back to the grid with the source, put the generic dimmer over the source.

In this example, the toggle is inverted each time note 12 from channel 1 is pressed. Modify it to fit what you need or use the noLoopCounter as shown in a previous post.

The help for the formulas is here: https://www.lightjams.com/commandline.html

--
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/c3Ulve7GZVM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lightjams+...@googlegroups.com.

Mathieu

unread,
Jan 26, 2020, 6:48:09 AM1/26/20
to Lightjams
To send two midi notes with one source, you do it the same way as controlling two lights: put the two attributes corresponding to the midi notes on the grid and trigger them with the same source.

Chris Wemyss

unread,
Jan 26, 2020, 9:36:33 AM1/26/20
to ligh...@googlegroups.com
Fantastic Thanks

On Sun, 26 Jan 2020 at 11:48, Mathieu <mat...@lightjams.com> wrote:
To send two midi notes with one source, you do it the same way as controlling two lights: put the two attributes corresponding to the midi notes on the grid and trigger them with the same source.

--
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/c3Ulve7GZVM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lightjams+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages