Business Template Forums Macros Macro: Asking for a pitch state on a specific track

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #5069

    Hello,

    I am trying to create a macro where I can use my Lanuchpad toggle a tracks Pitch state on and off, and at the same time send visual feedback to the control surface. Here is my initial draft. Logelloop does however not like the use of TrackPitchState in the If statement. Could I please get some help with how to proceed with this? Thanks!

    If { TrackPitchState == 0 }
    TrackPitchState trk1 1

    MidiNoteSend 11 1 1 “Launchpad mk2”
    Else
    TrackPitchState trk1 0

    MidiNoteSend 11 0 1 “Launchpad mk2”
    EndIf

    //
    Daniel

    #5070
    Philippe
    Keymaster

    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

    • This reply was modified 1 week, 4 days ago by Philippe.
    #5072
    nay-seven
    Participant

    Thanks, I’m also interested by this kind of macro,

    when i make “verify” your macro i have this error:

    Ligne: 4, Commande erronée: MidiNoteSend
    Bad parameter :The number of parameters (5 instead of 4) is incorrect for MidiNoteSend

    An idea ?

    #5073
    Philippe
    Keymaster

    Did you put the device name inside “…”?

    If yes, that should work.

    Maybe, you can send a green copy by email.
    Thansks, Philippe

    #5074
    Philippe
    Keymaster

    Did you put the device name inside “…”?

    If yes, that should work.

    Maybe, you can send a green copy by email.
    Thansks, Philippe

    #5075
    nay-seven
    Participant

    yes,
    after some testing, i discover it was a copy/paste issue
    when i paste your code, the ” characters was copied in black, when i rewrite them , they turn (with their content) to green
    and no more errors in verification process
    Maybe a pc/mac issue ? , I’m on mac Mojave.

    Now about the macro itself, if i start it , the pad light up, but no variation when pitch change ( or maybe i misunderstood something)
    tested with x touch mini and launchpad

    there ‘s a tricky interaction with Launchpad colors, they change depending only with specific velocity values

    #5076
    Philippe
    Keymaster

    Ha, to obtain a feedback from the pitch value, you need to associate a Midi controller to this pitch and the feedback is already working for the pitch value.
    Do you need something more particular?

    there ‘s a tricky interaction with Launchpad colors, they change depending only with specific velocity values

    I Will probably need more explanations about that. Maybe a video?

    I will look at the copy/.paste issue.

    Philippe

    #5077
    nay-seven
    Participant

    ho, it’s ok,
    i first think the author of this post want to have not only on/off feedback but also color variation depending of the pitch 😉
    about color, i ‘ll send you the info i know

    #5078
    Philippe
    Keymaster

    To get the pitch value, you need this :

    {floor(scale(valueOfReactionNamed(“TrackPitch_trk1”), 0, 1, 0, 127))}

    But you will need some math to obtain the color variation depending on the pitch value… -)

    #5079
    nay-seven
    Participant

    ok, so i try to post the macro here, but was considered as spam..;-)

    so here a link if someone interested
    i use second row of a launchpad mini (mk1) to control the reverse
    third row the pitch on/off

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.