Updating only a single value within an array using OSC?

Discuss Lemur and share techniques.
Post Reply
amundsen
Regular
Posts:62
Joined:04 May 2013 19:11
Updating only a single value within an array using OSC?

Post by amundsen » 04 Oct 2016 13:20

Hello,

I want to update only a single value within an array in Lemur from Max. Is it possible? How?

Thank you in advance.

phase_change
Regular
Posts:114
Joined:31 May 2015 18:45
Location:Austin, TX

Re: Updating only a single value within an array using OSC?

Post by phase_change » 04 Oct 2016 14:28

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
Have you tried turning it off and on again?

amundsen
Regular
Posts:62
Joined:04 May 2013 19:11

Re: Updating only a single value within an array using OSC?

Post by amundsen » 04 Oct 2016 15:21

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 ?

phase_change
Regular
Posts:114
Joined:31 May 2015 18:45
Location:Austin, TX

Re: Updating only a single value within an array using OSC?

Post by phase_change » 05 Oct 2016 16:37

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
Have you tried turning it off and on again?

Post Reply