|
Post by mcdtracy on Jan 9, 2019 4:55:05 GMT
The One Finger Orchestra in A Minor
# single notes get converted to Drop 2 Style (open voicing) chords suitable for an orchestral sound.
# StreamByter - Audeonic Apps # SB - CHORDS FOR C MAJOR SCALE NOTES
# Determine the Note of the incoming MIDI event (C = 0, C3 = 1,... B = B)
IF MT < A0 MAT G0 = M1 % C # MAT L0 = L0 + 24 # SND M0 G0 M2 END
# If C render a Major voicing IF G0 == 0 # DROP2MAJOR IF MT < A0 IF MT > 8F MAT L0 = M1 + 7 SND M0 L0 M2 MAT L0 = M1 + 10 SND M0 L0 M2 END IF MT < 90 MAT L0 = M1 + 7 SND M0 L0 M2 MAT L0 = M1 + 10 SND M0 L0 M2 END END END
# If D redner a minor chord voicing IF G0 == 2 # ERR DROP2MINOR IF MT < A0 IF MT > 8F MAT L0 = M1 + 7 SND M0 L0 M2 MAT L0 = M1 + F SND M0 L0 M2 END IF MT < 90 MAT L0 = M1 + 7 SND M0 L0 M2 MAT L0 = M1 + F SND M0 L0 M2 END END END
# If E render an E Major as is the case with A Harmonic Minor scales IF G0 == 4 # ERR DROP2MAJOR IF MT < A0 IF MT > 8F MAT L0 = M1 + 7 SND M0 L0 M2 MAT L0 = M1 + 10 SND M0 L0 M2 END IF MT < 90 MAT L0 = M1 + 7 SND M0 L0 M2 MAT L0 = M1 + 10 SND M0 L0 M2 END END END # If F render a Major chord voicing IF G0 == 5 # DROP2MAJOR IF MT < A0 IF MT > 8F MAT L0 = M1 + 7 SND M0 L0 M2 MAT L0 = M1 + 10 SND M0 L0 M2 END IF MT < 90 MAT L0 = M1 + 7 SND M0 L0 M2 MAT L0 = M1 + 10 SND M0 L0 M2 END END END
# If G render a G 7th which helps to allow C Major cadences for variety. Avoid G's unles your headed for a C Major section and while there avoid E's. IF G0 == 7 # DROP2MAJOR IF MT < A0 IF MT > 8F MAT L0 = M1 + A SND M0 L0 M2 MAT L0 = M1 + 10 SND M0 L0 M2 END IF MT < 90 MAT L0 = M1 + 7 SND M0 L0 M2 MAT L0 = M1 + 10 SND M0 L0 M2 END END END
# If A play A minor IF G0 == 9 IF MT < A0 IF MT > 8F MAT L0 = M1 + 7 SND M0 L0 M2 MAT L0 = M1 + F SND M0 L0 M2 END IF MT < 90 MAT L0 = M1 + 7 SND M0 L0 M2 MAT L0 = M1 + F SND M0 L0 M2 END END END
# If B use minor IF G0 == B # ERR DROP2MINOR IF MT < A0 IF MT > 8F MAT L0 = M1 + 9 SND M0 L0 M2 MAT L0 = M1 + F SND M0 L0 M2 END IF MT < 90 MAT L0 = M1 + 9 SND M0 L0 M2 MAT L0 = M1 + F SND M0 L0 M2 END END END
# What to do with C#, D#, F#, G#, A# - are diminished passing chords. # C# IF G0 == 1 IF MT < A0 IF MT > 8F MAT L0 = M1 + 8 SND M0 L0 M2 MAT L0 = M1 + F SND M0 L0 M2 END IF MT < 90 MAT L0 = M1 + 8 SND M0 L0 M2 MAT L0 = M1 + F SND M0 L0 M2 END END END
# D# IF G0 == 3 IF MT < A0 IF MT > 8F MAT L0 = M1 + 8 SND M0 L0 M2 MAT L0 = M1 + F SND M0 L0 M2 END IF MT < 90 MAT L0 = M1 + 8 SND M0 L0 M2 MAT L0 = M1 + F SND M0 L0 M2 END END END
# F# IF G0 == 6 IF MT < A0 IF MT > 8F MAT L0 = M1 + 8 SND M0 L0 M2 MAT L0 = M1 + F SND M0 L0 M2 END IF MT < 90 MAT L0 = M1 + 8 SND M0 L0 M2 MAT L0 = M1 + F SND M0 L0 M2 END END END
# G# IF G0 == 8 IF MT < A0 IF MT > 8F MAT L0 = M1 + 8 SND M0 L0 M2 MAT L0 = M1 + F SND M0 L0 M2 END IF MT < 90 MAT L0 = M1 + 8 SND M0 L0 M2 MAT L0 = M1 + F SND M0 L0 M2 END END END IF G0 == A IF MT < A0 IF MT > 8F MAT L0 = M1 + 8 SND M0 L0 M2 MAT L0 = M1 + F SND M0 L0 M2 END IF MT < 90 MAT L0 = M1 + 8 SND M0 L0 M2 MAT L0 = M1 + F SND M0 L0 M2 END END END
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Jan 9, 2019 10:21:03 GMT
Hi mcdtracy , Very nice! In the never ending quest for streamlined (ahem) code, I have some suggestions for you. We could store all your 2nd and 3rd note offsets in a lookup table and then use that when we see a note on/off and it would remove all those repeating IFs and also if you wanted to change your added note numbers, you just need to do it at the top. We can also simplify the logic too since we can handle note ons and offs in exactly the same way. Here is what I mean: IF LOAD # note C C# D Eb E F F# G Ab A Bb B ASS K00 = 07 08 07 08 07 07 08 0A 08 07 08 09 ASS K0C = 10 0F 0F 0F 10 10 0F 10 0F 0F 0F 0F END
# handle note on/off IF M0 < A0 # get note index MAT I0 = M1 % C
# add first note MAT I1 = M1 + KI0 SND M0 I1 M2
# add second note MAT I0 = I0 + C MAT I1 = M1 + KI0 SND M0 I1 M2 ENDHope I transcribed your offsets correctly. Also I have not tested this to see if it compiles and works; just typed it in. I will leave it to you to see if it works (or not). This method would also allow you to add a 4th note too if you wanted with just a few extra lines. Regards, Nic.
|
|
|
Post by mcdtracy on Jan 9, 2019 12:08:09 GMT
Thanks for showing me some elegant code.
I can use KB-1 without those nasty hanging notes that I wasn’t turning off!
I’ll keep expanding these ideas with more harmony ideas.
Is there a way to use a variable or index for the +D delay values? I’m trying to strum the notes from bottom to top to sound like a harp or guitar playing bar chords,
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Jan 9, 2019 12:19:02 GMT
Hi mcdtracy , Sure, the delay flag can be a variable, but remember that you need to set the variable in hex. For example: ASS L0 = C8 # 200 decimal SND M0 I1 M2 +DL0 # sends with 200ms delayRegards, Nic.
|
|
ki
MidiFire Beta
Posts: 25
|
Post by ki on Jan 9, 2019 13:58:41 GMT
Oh, nic we did parallel work I posted a refactured script using arrays on the Audiobus forum. Meanwhile i added rootOffset to shift the whole scale, variant selection of 4 offset variants per via modwheel, an optional forth note and valid-range check for the output notes. When i added the strumming feature (which also could be toggled via modwheel...) i better also post the result here so we don‘t get out of sync with feature...
|
|
ki
MidiFire Beta
Posts: 25
|
Post by ki on Jan 9, 2019 17:29:26 GMT
...some hours later...
With the straight forward approach one has to apply struming also to the note offs, otherwise one gets hanging notes if the note-on is delayed after the immediate note-off of a short note. But delaying the note-offs sounds wierd when playing faster input note changes... I try to find another solution
|
|
|
Post by mcdtracy on Jan 10, 2019 1:22:09 GMT
Ki,
It seems like the Delay that's applied to the Note On must also get applied to the Note Off and all should be good. Unless I'm missing something in my newbie excitement to have something work.
McD
|
|
|
Post by mcdtracy on Jan 10, 2019 1:23:46 GMT
Ki,
It seems like the Delay that's applied to the Note On must also get applied to the Note Off and all should be good. Unless I'm missing something in my newbie excitement to have something work.
In my newbies basic approach I coded something like this for the C events.
IF G0 == 0 # DROP2MAJOR IF MT < A0 IF MT > 8F MAT L0 = M1 + 7 SND M0 L0 M2 +D50 MAT L0 = M1 + C SND M0 L0 M2 +D100 MAT L0 = M1 + 10 SND M0 L0 M2 +D150 MAT L0 = M1 + 13 SND M0 L0 M2 +D200 MAT L0 = M1 + 18 SND M0 L0 M2 +D250 END IF MT < 90 MAT L0 = M1 + 7 SND M0 L0 M2 +D50 MAT L0 = M1 + C SND M0 L0 M2 +D100 MAT L0 = M1 + 10 SND M0 L0 M2 +D150 MAT L0 = M1 + 13 SND M0 L0 M2 +D200 MAT L0 = M1 + 18 SND M0 L0 M2 +D250 END END END
McD
|
|
ki
MidiFire Beta
Posts: 25
|
Post by ki on Jan 10, 2019 6:38:59 GMT
Thanks for remarks - applying the delay also to the note-offs sounds wierd when playing faster note changes since the notes belonging to the old chord are still sounding even though their base note is already gone.
For example on a real guitar their ‚sustained/unstrummed pitch‘ changes to the new chord when the left hand changes the chord and if the right hand then strums there is no overlapp with the old notes.
Thats why i am trying around with an alternative approach where the delayed chord note is only started when their base note is still pressed. This would allow to end all notes without delay but needs more management on the programming side.
|
|
|
Post by mcdtracy on Jan 10, 2019 9:03:36 GMT
Ki,
That solution seems to make sense thinking like a guitar player. Right after I posted my reply I thought... I have no idea what that would sound like.
I would love to see your solution to use the Chordal mapping with an offset to change the Root/Tonal Center. I'm guessing you'd just add a value between 0-11 for every note calculation in the script and maybe set the offset using the Mod Wheel of an incoming CC. Did you try it yet?
McD
|
|
ki
MidiFire Beta
Posts: 25
|
Post by ki on Jan 12, 2019 14:14:05 GMT
It took several day since i implemented tons of features (that you came up with) and wishes i had (like specifying the strum delay in note divisions) - but now the script is extensivly tested, documented and ready for distribution.
Since it is so long i will upload it to another thread, i will also post on the AB forum and upload sample AUM and AB3 session showing of your harmonics ideas.
|
|