Default midi values on startup

49 views
Skip to first unread message

doppler...@gmail.com

unread,
Aug 25, 2020, 10:58:33 PM8/25/20
to Lightjams
Hello, 

I have midi controller with 16 knobs which control master intensity, master speed and 14 other parameters. 

When Lightjams is started, it has not yet received midi values from the controller, and therefore the all parameters including master intensity and speed are at zero until the midi controller dials have first been rotated. 

This results in me turning all 16 dials at the start of each lightjams session to set initial values. I want to avoid doing this because sometimes I am not the person in control and others will not know to turn all dials for everything to function correctly or a dial may be accidentally missed. 

What I want to do is have default starting values for all midi controlled parameters, so lightjams starts at a preset value other than zero, and does not rely on the midi controller dials to be rotated at the beginning. Once a midi dial has been rotated the preset value is ignored for the rest of the show.


Any suggestions on how this may be achieved? 

Anthony S

unread,
Aug 26, 2020, 4:36:23 AM8/26/20
to Lightjams
I managed to get a preset value (in this case '50') for my master intensity which is being controlled by a midi dial, using this code below.  


if(grecall(1) == 1, midi.control(1,8), if (delta(midi.control(1,8))!=0, gmem(1,1),if(grecall(1) != 1, 50 , 0)))


What I really want use is the previous value of the midi controller before saving and closing, become the preset value when Lightjams is opened again.

One thing I cant yet do is keep an integer value saved as a part of the save file, if I can do this the value can be recalled once the save file is re-loaded leaving the preset midi values at the place where they were last left. It appears values stored in gmem are discarded once the lightjams session is saved and closed, and return to unstable initial values of '0' sometimes and othertimes it is not considered either '0' or '1'  

Any thoughts on this last task would be helpful. 

Regards,
Anthony

Ryan Humphreys

unread,
Aug 26, 2020, 4:46:19 AM8/26/20
to ligh...@googlegroups.com
Hi Anthony,


Just an idea if you can't save a int to memory . What about setting a particular fixtures x coordinate to the int in gmem. And then reading this x coordinate upon startup. I believe fixture positions save. Permanent memory storage would be a nice feature to have although. 



Hope that helps


Ryan

--
You received this message because you are subscribed to the Google Groups "Lightjams" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lightjams+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lightjams/2887f33d-a9da-45d0-8480-16d9486aa1dbo%40googlegroups.com.

isaac

unread,
Aug 26, 2020, 11:53:35 AM8/26/20
to Lightjams
You could use Sliders (Ctrl-K) which retain values after a save and restart, and OSC values can also be persistent if you enable the option in Config/OSC.

Anthony S

unread,
Aug 26, 2020, 10:58:09 PM8/26/20
to ligh...@googlegroups.com

Yes definitely sliders save and probably x positions save, this works fine normally, but it does not appear to work when using midi for control.

 

When using midi for control, neither of these options work. My best guess is Lightjams on startup switches all midi values as a ‘0’, but it still doesn’t do much to explain how a value in gmem which is updated only when a midi.note is pressed and updated to a value which cannot be zero, still recalls a value of zero when the software is reloaded.

 

I guess the gmem() values is not actually retained at all from the previous save session, it is recreated in the new session from its source and appears as if it was saved. With Lightjams setting (or reading) all midi values to zero on startup,  it causes anything derived from it to be zero or unknown (if a button has yet to be pressed) which is defaulted to zero also.

 

A bit stumped on this one.

--
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/PRSttSfZiV0/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/179c4188-dbae-4137-a78a-4cb6b39c3157n%40googlegroups.com.

Mathieu

unread,
Aug 27, 2020, 7:42:52 AM8/27/20
to Lightjams
Hi!

You are right that everything except OSC (optional) are reset to 0 when loading a project. The initial goal was to have a known default state when loading a project so that you don't get stuck with bad values somewhere.

I agree that it would make sense to optionally save MIDI CC values into the project file, like OSC. I guess you weren't relying on saving MIDI notes, right?

Anthony S

unread,
Aug 27, 2020, 7:59:26 PM8/27/20
to ligh...@googlegroups.com

That makes sense it could get quite tricky to debug a bad values. Having a reset all midi to zero is needed but for this project stopping the requirment to turn every dial on startup to get value, and startup on previous values is beneficial.  

 

This project saved midi.control values only, however saving midi.note values may come in useful at some stage.  

 

From: ligh...@googlegroups.com <ligh...@googlegroups.com> On Behalf Of Mathieu
Sent: Thursday, 27 August 2020 11:43 PM
To: Lightjams <ligh...@googlegroups.com>
Subject: Re: [Lightjams] Re: Default midi values on startup

 

Hi!

 

You are right that everything except OSC (optional) are reset to 0 when loading a project. The initial goal was to have a known default state when loading a project so that you don't get stuck with bad values somewhere.

 

I agree that it would make sense to optionally save MIDI CC values into the project file, like OSC. I guess you weren't relying on saving MIDI notes, right?

 

--

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

doppler...@gmail.com

unread,
Aug 27, 2020, 8:07:29 PM8/27/20
to Lightjams

Alright OSC saves the day. You can store values in the project save file using OSC

 

What I didn’t understand is you can listen to osc values you are also sending out.

 With the nice tick box saying “save current OSC values to the project file” checked, and set the osc input port to equal the osc output port, and set the adapters to be the same.

 Made sure the OSC output address is different from the osc address mapped for the input otherwise doesn’t work

 Did not have the feedback box checked.

Mathieu

unread,
Aug 29, 2020, 10:32:13 AM8/29/20
to Lightjams
Hi,

New beta version 583 with the new option to save MIDI CC values to the project file. Enjoy!

Anthony S

unread,
Aug 29, 2020, 3:36:57 PM8/29/20
to ligh...@googlegroups.com

Thanks that is really helpful to make that happen, definitely reduce complexity of the project and a fair bit of time also.  

Reply all
Reply to author
Forward
0 new messages