Home › Forums › Macros › Macro: Asking for a pitch state on a specific track › Reply To: Macro: Asking for a pitch state on a specific track
Hi Daniel,
This one is a bit tricky ! -)
In Logelloop native macro examples, you will find “Track Settings Copy And Paste”.
In this macro you will see how we get the user interface state when there is no variable to share the UI state.
To get the state of the Pitch of track 1, you put :
valueOfReactionNamed(“TrackPitchState_trk1”)
This value can be directly put as a value in the midiNoteSend line after being scaled.
So, the scale expression below will convert a value of 0 or 1 to 0 or 127
scale(valueOfReactionNamed(“TrackPitchState_trk1”), 0, 1, 0, 127)
As Midi values must be integers, you need to convert the float value in integer using the floor expression :
floor(scale(valueOfReactionNamed(“TrackPitchState_trk1”), 0, 1, 0, 127))
As we do not want to cause too much communication with the Midi device, we have inserted a “Sleep 100” in the evaluation loop
The final macro will look like this :
//************************************************* Macro Begin *************************************************
DoRepeat
Sleep 100
MidiNoteSend 16 {floor(scale(valueOfReactionNamed(“TrackPitchState_trk1”), 0, 1, 0, 127))} 11 “X-TOUCH MINI”
While true
//************************************************* Macro End *************************************************
I will try to insert a native Midi feedback for all tracks states in a future Logelloop release.
Best regards,
Philippe