Hi Nic. From this thread you demonstrated how to send the lowest note to another channel. I assume that doing the same thing, but for the highest channel, is simply a matter of flipping the IF statements the other way? I understood most, but not all, of what you wrote for the "lowest note" exercise - would you consider cloning that code, but with the appropriate chevrons flipped, so that I map the highest note to another channel (in addition to the one that is playing otherwise - I want to double the top note, not just map it elsewhere).
Hope you're well - we haven't talked in a while. I had to take several months away from this stuff but now I'm wading in again. Tom
You want me to decipher my own esoteric code, eh???
So, that script already doubles the bass note to a separate channel, so that part of your request is already taken care of.
To change that code to work with the highest note we have to adjust a few loops to work downwards instead of up. I have had a go at where I *think* this should happen but I'm under pressure with something, so you will need to test it out, I'm afraid:
# tap autohigh v1 by audeonic IF LOAD # K0 = high channel (0-F) # K1 = latency/min. note length # K2 = source events 0=pass/1=delay/2=block ASS K0 = 3 1 0
MAT I0 = K0 + 1 SET LB0 I0 +D
# L80 currently sounding # high note (80 == none) ASS L80 = 80 SET LB1 S--
# L0-7F table of all source notes # sounding (initialise to 0) ASS I0 = 0 IF I0 < 80 +L ASS LI0 = 0 MAT I0 = I0 + 1 END END
# handle source notes 9X XX 00 = 8X IF MT < A0 # set L entry, assume note off ASS LM1 = 0 IF MT == 90 ASS LM1 = M2 END
# wrap note into sysex and inject+delay MAT I0 = MT + K0 SND F0 7D I0 M1 M2 F7 +I +DK1 END
# handle injected notes IF M0 == F0 7D # copy type into I0 for compare MAT I0 = M2 - K0
# is it a note on? IF I0 == 90 # find the highest sounding note currently # store it into I3 ASS I2 = 7F 80 IF I2 < 80 +L IF LI2 > 0 ASS I3 = I2 ASS I2 = 80 END MAT I2 = I2 - 1 END
# the highest note is in I3 # if it is higher than L80 then # replace L80 with it IF I3 > L80 IF L80 < 80 MAT I1 = 80 + K0 SND I1 L80 00 END
# sound new high+mark SND M2 I3 M4 ASS L80 = I3 SET LB1 L80 +N END END
# is it a note off? IF I0 == 80 # is this our current high? IF M3 == L80 # turn off current high+mark MAT I1 = 80 + K0 SND I1 L80 00 ASS L80 = 80 SET LB1 S—
# do we have any lower sounding notes? MAT I2 = M3 - 1 IF I2 < 80 +L IF LI2 > 0 # found lower sounding note, turn on # new high note MAT I1 = 90 + K0 SND I1 I2 LI2
# mark new high note ASS L80 = I2 SET LB1 L80 +N ASS I2 = 80 # terminate loop early END MAT I2 = I2 - 1 END END
# block the sysex XX = XX +B END
# source event logic IF K2 > 0 IF ML == 3 IF K2 == 1 SND M0 M1 M2 +DK1 END XX = XX +B END END
It's not quite working, and I'm still attempting to diagnose why.
One point, though, is that using code to double myself in general isn't necessary, because I can just map my input to two synths/channels in the first place. So, really, what's needed is just a way to only sound the highest note - I can deal with what channel it goes through on the GUI. Does that make this less complex?
I raise this because it looks like the IF LOAD is setting a an initial MIDI channel (Channel 4 in the above) which I saw and quickly changed to 3 (hex 2) in that section because I need to transmit the high note to Channel 3. (The full chords go to channel 7 if that matters...)
More to come after I get better at determining what's happening (or not) here... I'm having a harder time than you did at deciphering your esoteric code. :-)