Page 1 of 1
Updating only a single value within an array using OSC?
Posted: 04 Oct 2016 13:20
by amundsen
Hello,
I want to update only a single value within an array in Lemur from Max. Is it possible? How?
Thank you in advance.
Re: Updating only a single value within an array using OSC?
Posted: 04 Oct 2016 14:28
by phase_change
If you post your code or more about what you're working on I can probably give you an example. If I understand correctly, let's say you have CoolArray{0,1,3,8} and you want to change the value 3 to 8 when SpecificOSCmessage is on. If(SpecificOSCmessage=1){CoolArray[2]==8}. You'll need to add an else or else if condition in order to change the CoolArray[2] value back to 3 or do something else.
Just to add some clarity to the example CoolArray[0] is 0, CoolArray[1] is 1, CoolArray[2] is 3, and CoolArray[4] is 8. If you want to learn more about arrays, go to W3schools and read up on indexed arrays.
Scott
Re: Updating only a single value within an array using OSC?
Posted: 04 Oct 2016 15:21
by amundsen
My question is more about the OSC message than about arrays, which I already know.
I have this :
waveform = {0.4, 0.25, 0.3... ...0.5} // 128 values
Is there an OSC message to change only one of these values ?
Re: Updating only a single value within an array using OSC?
Posted: 05 Oct 2016 16:37
by phase_change
Ahh... I see. You're probably coming from a MIDI background moving to OSC. OSC isn't like MIDI - the protocol doesn't define messages like NoteOn, NoteOff, CC, etc. You get to create the address and value. This video will probably do a better job answering your question than I will. You just need to use a script in Lemur to "do stuff" when you get the OSC message.
https://www.youtube.com/watch?v=bupVHvMEAz0