How to handle MIDI guitar signals most effectively

famusvictim

2013-04-10 20:07:25

Hi,

NOOB here, and would appreciate any and all help I can get to make sure - from the start - that I handle MIDI guitar signals effectively.

Given that any pick-up based MIDI guitar system has inherent latency issues, I want to make sure that I handle it's MIDI output efficiently in MT by knowing the order as well as any factors you can think of that may play a role.

Does anybody know the order of the various signals that a single note sends (note #, note on, volume CC, pitch bend, note off)? I am assuming it's in that order, but am not sure. Any general thoughts on MIDI guitar and MT are also very much appreciated!

PLEASE REFER TO THE THIRD POST FOR MY UPDATED QUESTION BELOW - THANKS!!!

THANKS SO MUCH IN ADVANCE FOR HELPING ME GET MY FEET WET! - I'm a fast learner once the basics are in place so this is very helpful to someone who hasn't coded since Q-Basic (which I was pretty good at - lol).

famusvictim

2013-04-10 20:09:40

BTW - I apologize for any ignorance from not figuring this out myself, but I have some serious hardware work to do on my guitar before I can get the MIDI pickup installed, so I haven't played with it. thanks. I am a very fast learner but am calling on the MT community for my first lesson.

famusvictim

2013-04-10 21:01:56

SIMPLE CODING QUESTION: If you give the example code for this hypothetical relating to MIDI guitar, it would really start to open up the world of MT to me by explaining a rule, so a response would be extremely appreciated!!!! It will also clear up how pitch bend is handled by MIDI. Many, many thanks in advance!!!:

HYPOTHETICAL - PLEASE HELP ME CODE THIS SIMPLE TRANSLATION WITH A RULE: In this hypothetical MIDI guitar situation, I want to have the Pitch Bend on CH.6 for a specific note on Ch. 6 (E4) to be translated into a CC (let's say CC85 on Ch.9), but I also want to write a rule that uses the Vol CC(7) to determine the direction of the CC85 when the volume diminishes to a certain threshold value. Thus, in this example, I want note#64 (E4) on Ch 6 to make the Pitch Bend translate into CC85 on ch.9 with a directly positive directionality where a positive pitch bend on Ch.6 becomes a positive CC85 change on Ch.9, but if I hold the note long enough until the Vol (CC7) diminishes to a certain threshold (let's say a value of 50 and below), I would like to then invert the directionality of Tranlator's CC85 output, such that a positive change in Pitch Bend on Ch.6 will from that point on (after Ch.6's Note E4's Vol CC 7 stays below a value of 50) create a switch to an inverted and thus negative change in CC85 Ch.9.

Much love to he who illuminates my first rule based translation!
Thanks y'all...

I hope someone with a lot of experience illustrates this, because I can't find anything in the forums about defining a rule such as this... I just know it must be possible

DvlsAdvct

2013-04-13 04:50:58

Hi famusvictim

No worries on any "ignorance" or whatever. We all come at this together and learn as we go.

So I want to make sure I understand your question before I start drafting an answer. I'm going to reword it a little and see if that makes sense.

So the order of operations here is:

Step One: Strike note Ch 6 E4
Volume is above 50
Activate Pitch Bend
Pitch bend sends a positive signal starting from 64 (the middle)
Volume falls below 50
Pitch bend begins sending negative signal (starting from wherever pitch stopped going up)
Note ends, pitch bend resets for next strike.

That make sense? I just want to make it through the order of operations, because I think there's a pretty basic way to organize this, we'll just have to figure out the timing.

famusvictim

2013-04-13 05:42:25

DvlsAdvct wrote: Step One: Strike note Ch 6 E4
Volume is above 50
Activate Pitch Bend
Pitch bend sends a positive signal starting from 64 (the middle)
Close, but because I'm going to use a midi guitar with a tremolo bridge, so though it will start at 64, it can go either down or up, but should correspond in a directly proportional manner to increasing/decreasing CC output value... i.e. pitch bend input of 69 = CC output of 69, 76=76, 2=2, etc... (I chose the word "positive" slightly inaccurately)
DvlsAdvct wrote: Volume falls below 50
Pitch bend begins sending negative signal (starting from wherever pitch stopped going up)
Yes. So from this volume point on, I would want the CC output to be inversely proportional manner to increasing/decreasing CC value... i.e. 69=58, 76=51, 2=125, etc... Just want to clear up that it's more a matter of directly vs inversely proportional than positive vs negative.
DvlsAdvct wrote: Note ends, pitch bend resets for next strike.
EXACTLY!


BTW - for anyone wondering "why?": This may seem utterly pointless on it's own, but there are two ways to extend this simple idea for cool effects.
1) Have this exact same process, for just one string, but have this "Volume-triggered flipping" feature happen at a ton of points along the volume's decay (either chaotically, or orderly), while you pull and push the whammy bar in a rather uniform manner, or whatever creates the right "feel", once you can get the feel for it by playing.
2) do the same thing with multiple notes on different strings (from different channels) to create multiple CC outputs for creating XY / XYZ controllers etc... that have unique properties of "flipping" the parameter of your choice in an effect (for example), at strange times. You can strive for chaos, or order, but regardless, you'll get one killer-unique XY controller, and it will baffle the audience.
My only question with #2 is whether it's possible to do the multiple string with different decay flip points? I would have thought yes, so long as you are using individual translators for each note which is coming from a separate channel, and I am pretty sure that the pitch bend comes through individually for each string/incoming channel. hmmm?

---both extensions create strange effects that use the unique decay curve of a guitar string, and both require tweaking and practice: learning the feel of what you've created, tweaking it and starting again, etc... also you can easily switch off the audible volume of the guitar itself, so the audience will clearly see that you're using the guitar as a controller, or you can set it up to XYZ the hell out of the very same multiple string harmony pitch bend your sending into a synth, and they won't know what the hell is going on!

DvlsAdvct

2013-04-13 20:01:48

Alright that makes more sense.

So you only want the physical tremelo command to react to the initial position and then move up or down based on the volume? So, to further elucidate:

Strike Note
Volume is above 50
Activate Pitch Bend
Pitch Bend sends a message based on current positive of the tremelo bridge
It instantly starts moving up (ends at say 84)
Volume drops below 50
Pitch Bend signal inverts to 43
Pitch bend begins moving down

And if that is correct, how do you want to measure the rate the pitch bend decays? Is MT going to be receiving MIDI clock to keep it within tempo, or will you just send it at a static rate?

famusvictim

2013-04-14 02:15:00

First off, I just realized that there are two completely different ways to handle this computationally with a clear winner for easy execution, because there are two basic types of MIDI guitars:
1) Real guitars with Midi pickups. (in which case you have the problem of only being able to activate the tremelo pitch bend after the note is first cleanly struck, and the note-on is sent, plus this problem is amplified immensely when you consider the other strings each having their own pitch bend info)
2) An artificial MIDI guitar controller like the current YouRockGuitar, where the pitch bend is always independently sent from it's own onboard tremelo bridge, equally through each string/channel.

A YRG is better for this, because the same note signal would be sent that corresponds to the fret you are pushing down, even if you had the tremelo bridge pushed down to all the way to 0 when you strike the note, or pushed/pulled to any point between 0 and 127!) Plus the Pitch Bend data is likely ALWAYS independently sent on all six MIDI channels with the same data generated from the artificial whammy bar controller on the YRG, so it effects all the strings' data equally. This is MUCH better for what I'm looking for. I was planning on installing a second-hand Roland MIDI pickup system on one of my guitars (but that's risky bc/ it's an old hand-me-down and corroded), but I just realized that creating a cool midi controller for ALL my software is much easier with the YRG (and I have one of these cheap things from a christmas gift)... As a guitar emulator it sucks, but as a general controller, there are sure a lot of ways to imagine using it.

So - that said - Let's imagine this whole scenario with the much, much easier situation of using a YRG MIDI guitar, where the exact fret note is sent correctly no matter where the pitch bend (tremelo bridge) is positioned at the time of the note on message, and the pitch bend MIDI message should be the exact same on every string/channel (making my previous post about hypothetical uses very realistic)... OK???
DvlsAdvct wrote: So you only want the physical tremelo command to react to the initial position and then move up or down based on the volume? So, to further elucidate:
Except with the YRG, this initial position shouldn't matter, the note on signal will be precise to the fret, and we can have the tremolo bar be located at any point
DvlsAdvct wrote: Strike Note
Volume is above 50
Activate Pitch Bend
Yes, but with the YRG, the Tremolo Pitch Bend can be located anywhere at the point of the note on, I would think, and thus should be addressed in code before note on? We can have it after note on, if you think that's better - it's totally up to you.
DvlsAdvct wrote: Pitch Bend sends a message based on current positive of the tremelo bridge
Like I said, I'm pretty sure that the Pitch Bend can be anywhere before or after the note-on message with the YRG... all that needs to happen while the Volume is above 50 is a directly proportional one-to-one translation from the Pitch Bend to the CC, and then it is still one-to-one, but inverted, via MT.
DvlsAdvct wrote: It instantly starts moving up (ends at say 84)
Volume drops below 50
Pitch Bend signal inverts to 43
Pitch bend begins moving down

And if that is correct, how do you want to measure the rate the pitch bend decays? Is MT going to be receiving MIDI clock to keep it within tempo, or will you just send it at a static rate?
I was under the impression that because Pitch Bend is a variable from 0-127, just like the intended CC output, that this is simply a matter of using the volume decay point of 50 to trigger the translator to flip from a positive linear one-to-one relationship to a negative (inverted) linear relationship. With the YRG, can't the Tremolo Pitch Bend be wherever the player wants, moving at whatever rate he wants, and MT just determines when a series of changes like PB1-CC1... PB2-CC2...PB3-CC3... inverts to PB4-CC123...PB5-CC122...PB6-CC121...etc......? With the YRG, isn't the rate always one-to-one (PB-CC), even if the YRG's controller output skips PB integer values with faster physical bridge bends, because MT will just receive the values the YRG spits out and deal with them directly or inversely, depending on the volume decay point specified (or multiple decay points if we wish)?

DvlsAdvct

2013-04-14 06:05:15

OH! I completely overcomplicated this in my head, because that's sometimes what I do. I was under the impression that you wanted a pitch bend signal to be SENT after a certain point.

Ignore that.

Anyway, yes you can easily do this. What you need to do is set a global variable to track the volume (or velocity) and then use that to invert the pitch bend message. The first translator is going to act as a passthrough for the MIDI signal, but is just going to track the velocity so we can then use that to augment the pitch bend signal. So, if we are tracking the last byte of data it would look something like this.

Code: Select all

Translator 1: MIDI Note E4
Incoming Message: 95 40 pp
Rules: if pp>64 then ga=0
if pp<64 then ga=1
Outgoing Message: 95 40 pp

Translator 2: Pitch Bend
Incoming Message: 98 55 pp
Rules: if ga==1 then pp=127-pp
Outgoing Message: 98 55 pp
I THINK that should do what you're asking. Apologies for the confusion. Let me know if that doesn't a) work or b) make sense.

Thanks
J

famusvictim

2013-04-15 13:59:03

DvlsAdvct wrote:OH! I completely overcomplicated this in my head, because that's sometimes what I do. I was under the impression that you wanted a pitch bend signal to be SENT after a certain point.
.....
I THINK that should do what you're asking. Apologies for the confusion. Let me know if that doesn't a) work or b) make sense.

Thanks
J
No - You're not. After spending a day messing with the YRG, I have realized that you were close to right the first time. First off, the volume idea is basically not doable. One of the reasons the Roland guitar probably has such latency is that it does something special; namely, it creates the illusion of perfect synthetic volume decay that is the same as the decay of the live audio coming from the strings (one of the reasons you can mix live and synth with a Roland unit)... It does this with a very careful realtime algorithm to take the string volume and translate it into sys-ex for decay for it's own synths... this is probably simplified to a volume CC message when the Roland units send out to other synths via the DIN. I figured this all out from realizing exactly what the YRG DOESN'T do... there is no decay, they volume CC is already being used for the main Volume knob on the physical unit (a stupid error in my opinion)... the thing just holds a note at the velocity it was struck.... holds, and holds and holds. Sorry about all this, but some good ideas and learning a lot about MIDI came out of it.

I have a lot of Ideas about MIDI guitars, and how they could be used as complete Ableton controllers and realtime guitars at the same time - I will tell all later.

Right now, I have one simple question for the time being, based on the fact that the YRG - unlike the pitch bend on my axiom that uses an LSB of 0 and MSB from 0-127 - uses both MSB and LSB messages to send pitch data - more smooth in theory, but also kinda chaotic, because I can't figure it out until I know if this code is correct. please tell me if this translates the pitch bend data from the YRG into 2 separate CC messages derived from LSB and MSB respectively.

Code: Select all

Pitch Bend on Channel 1 to translate into CC20 and CC21, both on channel 1, derived from LSB and MSB bits respectively - no rules needed:

Translator 1 : pitch bend LSB to CC20
Incoming Message: E0 pp ss
Outgoing Message: B0 14 pp

Translator 2 : pitch bend MSB to CC21
Incoming Message: E0 pp ss
Outgoing Message: B0 15 ss
In theory this would still make the whammy bar a cool XY controller just on its own.

DvlsAdvct

2013-04-15 14:27:13

Wow... that's... um... precious? Well, if the guitar sends sysex then MT can receive and translate sysex. If you have a manual for the guitar we should be able to hack together SOMETHING, I think. Might take a bit of trial and error. If we can't get to those messages, though, then yeah, might need to turn it into an X/Y controller (yay?).

And no worries on this. I don't use MIDI guitars, so if nothing else it gives me an insight into them. :) Keep the ideas coming.

I am not sure how you've translated that would work to translating 14-bit from one message to two messages, but at that it shouldn't give you a real x/y cause, well, the whammy bar is technically sending one message. That being said, it could sound really cool. I'd give it a shot and see how it reacts. Let us know! :)

famusvictim

2013-04-18 01:24:37

DvlsAdvct wrote:Wow... that's... um... precious? Well, if the guitar sends sysex then MT can receive and translate sysex. If you have a manual for the guitar we should be able to hack together SOMETHING, I think. Might take a bit of trial and error.
OK - so here's the deal - backdoor control - and NOTE - nothing I say here is guaranteed until I try and is all based on conjecture from seeing how this thing operates in realtime. The YRGuitar controller only receives SysEx through the USB cable and only from it's control software that's not meant for realtime use, but rather to set up the guitar. The DIN receives nothing and is one-way.

BTW - with the SYSEX from the YRG, I've totally realized that the reason they don't want anyone seeing their SYSEX is that the entire system in terms of MIDI - despite all this media hype and all the parents' attention - is basically so completely simple that you could build it DIY if you wanted, and knew about electrical engineering a little (more than me, but I am not planning on building one - I'm planning on modding the f*** out of this one with MT.)

Check the forums later and I'll explain what I've found in a post. Only with MT could you turn it into a decent MIDI controller with both cool things (like control of Live and software), to useful things, like giving the notes from the YRG actual volume decay envelopes so they don't just ring at one volume - even realistic sounding ones - as well as many other variables they simply haven't put into their product that's been touted as the "fastest latency 'guitar' in history" (that last part always cracks me up.)

I'm going to mod the hell out of it over the next few months or so in spare time, and release it in MT form upon the world (of this forum), and then post it in every forum out there for circuit benders, modders, gear heads, and MIDI controller freaks. MT is also the only "easy" way to do it. I'll post a question every now and then… It's funny - they're about to come out with a Pro version with wood, but the same basic insides.

A lot of potential in this toy tho

DvlsAdvct

2013-04-18 01:37:04

Well, come by with any questions. :) That's what we're here for.