First time here? Check out the FAQ!

Is there a way to do "If true assign a value, if false do nothing" to a hotvalue in soundtoglobalcontroller

0 votes

I'm trying to assign some values to hotvalues with button pushes coming in via osc.

I have 8x8 buttons on my controller and I want to create a hotvalue for each button (!button23 fx.) Each button sends an osc-message '/button,fff' first and second argument are coordinates, third arg is 1 or 0 1 if button is pushed down, 0 when it is let go again.

What I'm trying to do is having my hotvalues react to the buttons, and being an exact copy of it. So when button 3,2 is pushed !button32 is 1, and when button3,2 is released, !button32 is 0. But I want it to be able to react to several buttonpushes at the same time. So my thought was to check buttonposition with logic, and if true assign the value of the third argument to the hotvalue, and if not true, simply do nothing. I'm using 'true:false:' but I can't get false to do nothing. If i write 'nil' in false, I get quite unexpected results.

I think it's because I don't completely comprehend in which order all this logic is being done.

So I'm doing this

(1 to: 8) do: 
[ :i | (1 to: 8) do: 
[ :j |
gridin start: 0 s 
name: ('button' & i & j) asHotValue 
value:  ((!osc_button__1 eq: i) * (!osc_button__2 eq: j) true: !osc_button__3 false: nil)

I've attached an example sound for illustration with the same code.



asked Apr 24, 2020 in Capytalk & Smalltalk by anders-skibsted (Adept) (1,320 points)

1 Answer

0 votes
Best answer

In place of SoundToGlobalController, I would use a TriggeredSoundToGlobalController with the Trigger set to:

(!osc_button__1 eq: i) /\ (!osc_button__2 eq: j)

and the Value set to:


You may or may not want to leave AllowLiveOverride checked.

answered Apr 25, 2020 by ssc (Savant) (121,430 points)
selected Apr 25, 2020 by anders-skibsted