Duggle Posted May 2, 2013 Report Share Posted May 2, 2013 I cannot work out from the written description, or find an example of what I would like to do: To trigger a RunSection from a button, with ^section selected by the position of an encoder with ^value set by another encoder. The usecase is to choose an audition phrase (^section) and then vary the velocity of note ons with another control. Perhaps ^value is not right for this because it gets set once prior to RunSection entry? Can I somehow dynamically change the note on velocity while the phrase is playing? Thanks Quote Link to comment Share on other sites More sharing options...
TK. Posted May 2, 2013 Report Share Posted May 2, 2013 The usecase is to choose an audition phrase (^section) and then vary the velocity of note ons with another control. Instead of ^value, you could retrieve a value also from a (id) or (hw_id), e.g. (id)ENC:1 Can I somehow dynamically change the note on velocity while the phrase is playing? In the example above: yes, with the first encoder. Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
Duggle Posted May 2, 2013 Author Report Share Posted May 2, 2013 (edited) Ok, thanks, but how do I assign the ^section variable from an encoder? I see plenty examples of static RunSection assignments from pushbuttons but no examples of assigning this value from an encoder? [edit] I suppose I can do my own ^section equivalent by reading the 1st encoder to determine what code get executed (i.e case switch) and the 2nd to determine the velocity. I need to take care of what happens if the 1st encoder is changed during execution etc. Edited May 2, 2013 by Duggle Quote Link to comment Share on other sites More sharing options...
Duggle Posted May 2, 2013 Author Report Share Posted May 2, 2013 (edited) I'm trying this: EVENT_ENC id= 67 hw_id= 67 fwd_to_lcd=1 type=Meta meta=RunSection:20 if_equal=0 range=0:3 enc_speed_mode=Slow:7 label="^c3_10" EVENT_ENC id= 671 hw_id= 67 fwd_to_lcd=1 type=Meta meta=RunSection:21 if_equal=1 range=0:3 enc_speed_mode=Slow:7 label="^c3_11" EVENT_ENC id= 672 hw_id= 67 fwd_to_lcd=1 type=Meta meta=RunSection:22 if_equal=2 range=0:3 enc_speed_mode=Slow:7 label="^c3_12" EVENT_ENC id= 673 hw_id= 67 fwd_to_lcd=1 type=Meta meta=RunSection:23 if_equal=3 range=0:3 enc_speed_mode=Slow:7 label="^c3_13" The different labels are printed so it seems the encoder coupling is working, but the RunSection(s) are not being executed at all. [edit] The above produces the following debug output: [11392.515] MBNG_ENC_NotifyChange(67, -1) [11392.515] [EVENT] id=ENC:67 hw_id=ENC:67 bank=0 fwd_id=DISABLED:0 type=Meta value=2 label=^c3_10 [11392.515] [EVENT] id=ENC:671 hw_id=ENC:67 bank=0 fwd_id=DISABLED:0 type=Meta value=2 label=^c3_11 [11392.517] [EVENT] id=ENC:672 hw_id=ENC:67 bank=0 fwd_id=DISABLED:0 type=Meta value=2 label=^c3_12 [11392.517] [EVENT] id=ENC:673 hw_id=ENC:67 bank=0 fwd_id=DISABLED:0 type=Meta value=2 label=^c3_13 Edited May 3, 2013 by Duggle Quote Link to comment Share on other sites More sharing options...
TK. Posted May 3, 2013 Report Share Posted May 3, 2013 if_equal won't work this way, because each EVENT_ENC stores it's own value! It isn't possible to copy the value into ^section from a meta event, but the question is: why do you really need this? Why not using RunSection:20, and then in your .NGR file: if ^section == 20 then if ENC:67 == 0 then ... elsif ENC:67 == 1 then ... elsif ENC:67 == 2 then ... else ... endif endif Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
Duggle Posted May 3, 2013 Author Report Share Posted May 3, 2013 Thank for the suggestion TK, I was about to try something like this. I'll post back with what I find. if_equal won't work this way, because each EVENT_ENC stores it's own value! The label from the EVENT_ENC that matches the value is being printed, for each position of the encoder. Doesn't that mean that if_equal condition is being met? If so then why is the meta not executed? Quote Link to comment Share on other sites More sharing options...
Duggle Posted May 4, 2013 Author Report Share Posted May 4, 2013 I'm having very unexpected behaviour! if ^section == 4 if ENC:67 == 0 LCD "@(24:1:1)VAL0" delay_ms 1000 elsif ENC:67 == 1 LCD "@(24:1:1)VAL1" delay_ms 1000 elsif ENC:67 == 2 LCD "@(24:1:1)VAL2" delay_ms 1000 else LCD "@(24:1:1)VAL3" delay_ms 1000 endif if BUTTON:3 != 0 exec_meta RunSection:4 else LCD "@(24:1:1)----" endif exit endif The control elements here: #Audition phrase push on push off EVENT_BUTTON id=3 fwd_id=LED:38 type=Meta meta=RunSection:4 button_mode=Toggle EVENT_ENC id= 67 hw_id= 67 range=0:3 enc_speed_mode=Slow:7 value=0 fwd_to_lcd=1 label="^c3_10" LABEL c3_10 "@(23:1:1)enc %3d" Now when ENC:67 is at value say 1, then Button 3 is pressed, the LCD display 24 shows "VAL1"..."VAL2"..."VAL3".."VAL1".."VAL2"..etc (with 1 sec pause between changes) When Button 3 is released the display counts up to VAL3 again then finally rests on "----" When ENC:67 is at value 2, and Button 3 is in active state, the LCD display 24 shows "VAL2"..."VAL3"..."VAL2"..etc (with 1 sec pause between changes) The label display for the encoder is steady and correct. It seems the value of ENC:67 read by the script is unstable like incrementing with rollover, between the selected and maximum value? Quote Link to comment Share on other sites More sharing options...
TK. Posted May 5, 2013 Report Share Posted May 5, 2013 I was able to reproduce this: the delays in the if branches caused a parser malfunction once the execution was continued. You will find a bugfix in the repository. Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
Duggle Posted May 5, 2013 Author Report Share Posted May 5, 2013 Thanks, TK! Working great, this will keep me busy for a while! Quote Link to comment Share on other sites More sharing options...
Duggle Posted May 6, 2013 Author Report Share Posted May 6, 2013 So far, so good. I've set up an "Audition Panel" which gives control #1 Phrase, #2 Note, #3 Velocity1, #4 Velocity2, #5 Tempo. A toggle mode pushbutton activates the phrase while down. This executes an "Entry" section where the beginnings of non repeating phrases happens (held notes and chords). It then jumps to another section where cyclic (looped) phrases happen. It is possible to freely turn the encoders to change any variable while it plays. I plan to use conditionals to control what the parameters do according to the Phrase selection to consolidate to only 4 encoders. Velocity1 and Velocity2 gives control over the velocities of up to 2 groups of notes in a phrase. The worst thing that can happen is the odd stuck note as there is no way to guarantee every note on has an off. This really isn't an issue because the exit of all phrases when the button is toggled off is AllNotesOff CC. Not in any way necessary, but would be "nice to have" features for the NGR: Be able to ADD the value off a control to a constant. This has the following uses: Modify (shift) the velocities of a phrase (that has a variety of base velocities in it) Transpose the note values of a phrase (that has a variety of notes values in it) Also if there was a simple statement to block (and unblock) the reading of new values. Would be used while a note is "down" that would prevent stuck notes before they happen. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.