Popular Posts

Friday, May 27, 2011

Pythagoras MIDI

The new instrument is undergoing some pretty big changes. I am still working with Wizdom on this (the guys are busy, so I am trying to get a lot of progress made until we meet again), and it will come out with a different name (because Pythagoras is taken). But I stumbled upon some code that completely demystified MIDI over WIFI and decided to give it a try. Within a few hours, I had something that sucked, but kind of worked.

Pythagoras won't really ever be a "MIDI controller", and still has a MIDI-Guitar mentality. The real sound engine is the audio engine, and it's finger and frequency oriented. What I mean by this is that there are no note up/down or note name/numbers. You can have multiple instances of the same note being played, and bend them all in different directions. It's fretless to the core. Here is a recent sound check (just before I got per-string legato and mono mode working in MIDI). It puts GarageBand's BigElectricLead patch in left channel versus the native sound on the right. The timing being a little off is due to WIFI latency/jitter versus my sound latency/jitter. Some of the note drops on the MIDI side are the issue I mention in detail at the bottom.

MIDI on the other hand forces you to sucessfully model an instrument as a box of buttons and sliders. It sounds possible to do correctly until you start looking at the zeroes and ones of the MIDI protocol and see its true limits. Specifically, you can model it as 16 independent boxes of buttons with their own pitch wheel. This *sounds* like enough to make microtonality and polyphony work well together, but the devil is in the details. The per channel pitch wheel defaults to only a lame whole tone bend width. You can set it higher, like an octave, but it's a very non-portable thing to do. If I am stuck at whole tone bends, then the note must retrigger if I exceed it. Because I don't have an actual pitch wheel, when I am at the top of my whole tone then an accidental note re-trigger is only one pixel away (because you bend with finger position of the note, not with a separate wheel that has a top and bottom).

The other issue is that even if I write all of my MIDI messages completely correctly spread out across 16 channels, some DAWs will gleefully mess up all my work and mash all the channels back down into one channel at playback (My GarageBand OSX!). When that happens, you have to write different MIDI (omni-mode MIDI versus single channel) out to the stream to account for overlapping instances of the same note so that notes don't stutter and cut each other short. (This isn't supposed to happen, but what your MIDI stream says to do, and what the brain does are always going to be two different things. :-( This is less true as you get more expensive gear, but people will give me a 1 star "worst instrument ever" if it doesn't work with some MIDI brain that doesn't do it right. A lot of people won't understand why MIDI does keyboard just fine, and this layout doesn't quite fit the mold.)

#90 means note on channel 0
#91 means note on channel 1
# second number in row means note number
# third number in row means volume
90 32 55
91 32 46
90 32 00

This is two fingers going down on the same note, something that's impossible on a piano, because they are mechanical keys. So one finger comes up, and if they are truly on different channels this sounds right. If GarageBand forgets that 91 means that that's a different copy of the same note, it will just turn that whole note off and I get silence when there should still be a note playing. I know the workaround and will write it in, but what you see is correct MIDI, and I have to write it wrong to make some cheaper brain happy while possibly getting a wrong result on higher end hardware. If both of these notes go down and are slightly bent in different directions, then they are *not* the same note and I can't use tricks to count how many times down and up and compensate.

Since MIDI is all about making keyboard controller (boxes of buttons and pitch wheels) manufacturers happy, they think of microtonality as tuning tables, and think that this problem is basically solved. (The microtonal google groups insist that MIDI is just fine with microtonality because of *.tun files, etc). But fretless instruments have no tuning tables. Each channel (ie: finger) is one long volume and expression changing bend. I only need an octave bend in practice, but fretless instruments by their nature can bend from the lowest to the highest frequency with no problems.

The thing about this instrument that feels so different is that even with the frets on, its fretless nature is always apparent. You can refret between 12, 24, 53, or 665 notes per octave and blur the lines between what is and is not a fretted instrument, especially when you set the snap speed (speed to drift to the closest fret) very low.

So, MIDI is in Pythagoras. I am actually *excited* about it because I can double the internal voice, which does expressiveness pretty well, with MIDI voices that do other things in a world class way. The main trick will be keeping complexity away.

I do NOT want to attract a lot of very high maintenance users that won't ever be able to agree on any simple controller configuration as an acceptable one. I am going to shoot for something that is expressive and simple. I know that MIDI kind of opens the gates of hell for a million new controls to play with.

Friday, May 13, 2011

Tablature For My Instruments

I don't make these instruments just to put yet another iPad instrument into the store. I am taking the high risk approach and trying to build up a community. Communities need a common language. So here's some tablature.

The new instru
ment is at least as playable as guitar. It is special in that it uses automatic octave switching. But that makes fingerings different. If you have Pythagoras octave rounding turned on, these are the basic rudiments. The fingering is indicated by {L,R} for which hand, with fingers {1,2,3,4} being first finger to pinky. finger 0 would be thumb, but I am not using it here.

There are no frets, so the notation is relative to whatever center you like. That's why negative numbers show up in a few places. This notation doesn't handle microtonality yet, but I I think that will work out well when I get it figured out. There are also a variable number of strings, so this notation just shows the number that are in use. With octave rounding, there isn't a lot of reason to go beyo
nd 4, with 3 being enough for describing common things.

Play these with smooth rhythm. And where the double bars are, repeat as often as you are in audible range, then go on to the next bar.

I haven't figured out how to notate legato techniques made possible by the polyphony slider. When you stack up multiple notes in mono mode, pulling your finger up will play a note as if you hit it. It's better than a string because you can do these legato techniques up or down, and not just up the string as a real string instrument.

Here is another example that starts to make the point of why I need to think about a custom notation. When you notate by 12ET frets, it becomes ambiguous if you really meant to specify nearby locations that don't really land exactly on the fret. In 53ET, the fourths that the strings are tuned to are Just fourths. The seconds that you play are Just seconds. (Well, both are approximations, but very much closer than 12ET is). So, if we define 9 of these steps to be a Just whole tone, then 6 whole tones is 9*6 = 54. We overshoot the octave by 1 fret. When playing Pythagoras, you can see the whole tones very clearly in the layout. So we index first digit by whole tone, and second digit by the small fret in the whole tone. The beauty of this is that it looks kind of like the base 10 number. It's close to it. If you mentally "double the numbers" and think of 05 as "1/2" and 1 as "2", and 15 as "
3, then this 53ET notation is exact, yet it is easily rounded to the 24ET and 12ET locations. So, you can use one notation that's unambiguous (rounding is unambiguous, guessing with hints on what you really meant by starting at 12ET and saying stuff like "a little more than slightly sharp", etc.... that's ambiguous). Anyways, this is my 53ET notation, and I find it more useful than writing out guitar tablature with marks to qualify exactly how sharp/flat, etc. I need to write some code to generate prettier tablature.

But at the moment, I am crazy wrapped up in MIDI. Part of the MIDI task was to get the internals right so that I can record a transcript of the original gestures, to emit some of this 53ET tablature. But I really get it from the response that having a good MIDI implementation is required to get anybody to pay attention long enough to what Pythagoras can do that MIDI instruments don't do well. More on the MIDI stuff later... It's getting there!