Deprecated, please use Chris Wilson’s WebMIDIAPI Shim
You can find a proof of concept overhere. You will need to have flashplayer 10 installed because i use the dynamic sound generation possibilities of player 10 for producing sounds when midi note-on data is received.
If you don’t want the hassle of installing flashplayer 10 you can find a flashplayer 9 version overhere. You won’t be able to enjoy the beautiful warm sinus tone generated by flash but you can see flash responding to your midi keyboard. The Release version of Flash Player 10 is now available from the Flash Player Download Center. However, the flashplayer 9 version is still online.
connecting flash to a midi device
When the page has fully loaded, flash asks the Java-applet to investigate your midi setup and displays the result in the yellow part on the top right corner. If a midi in port is detected and available, it will automatically be connected to the flash interface. If not, you can click on one of the other detected devices: you need to look for a midi in port. If Java was not able to detect the kind of midi device (midi in, midi out, synth, sequencer), it will be displayed as ‘device’. A red bullet indicates a successful connection.
So now if you press a key or move a slider on your midi keyboard you should see this represented in the little pink square on the lower right corner. If you play 3 or more notes simultaneously, the purple square on the upper left corner will try to find out what cord you are playing (see below).
p style=”text-align: justify;”>
the keyboard and velocity sensitivity
At the center bottom, the matching piano keys will light up on the software keyboard while playing your hardware keyboard. You can also play on this keyboard by clicking the keys with your mouse, but the software keyboard isn’t (yet) velocity sensitive, as opposed to your hardware keyboard. That is: if you have a velocity sensitive keyboard connected.
Because velocity sensitivity of hardware keyboards is supported, i divide the volume of the sound channel by 10. Otherwise the sound might be distorted when you play 2 notes at maximal velocity. By dividing it by 10 this could still happen if you play more than 10 notes at maximum velocity but i assume that you have 10 fingers and won’t use you forearm to play clusters 😉
I have to find another solution though once sustain pedal support is implemented.
In the lower left corner you can set the amount of bend that is used by your pitch bend wheel. You can either pick an interval with the drop down box (from a minor 2nd up to an octave), or choose any value in between using the slider.
the ‘color organ’
I have also implemented a very rudimentary form of a color organ which you’ll find in the black square above the keyboard. You can assign midi controllers or notes to the RGB channels represented by the 3 little accordingly colored squares.
It works like a regular midi-learn/midi-forget toggle that you can find in many offline midi programs: click on the software controller, move the hardware controller, press ‘ok’ and you’re done.
If you connect a note, the velocity is used to change the value of the channel and all notes with the same name in other octaves will be connected as well. This can be interesting: i have experimented a little with assigning specific tonic, subdominant and dominant notes to the channels, like for instance in key of C the note C to the green channel, the note B to the red channel and the note A to the blue channel.
Now when you play you’ll see that colors are more or less matched to harmonic functions: dominant chords will always be a little reddish. The color of a Dmin7 will be, dependent on how hard you play the C and the A, beautifully aquamarine. Cmaj7 is yellow, but if you play the seventh very loud, it will turn more orange.
I have to think up more refined and intelligent ways of connecting tones to harmonies, but i wanted to put this simple color organ in my proof of concept to show as an interesting possibility of a flash midi connection.
the chord finder
This is in fact the reason why started this project: i wanted to create a decent online chord finder. The chords are related to scales and are presented as modi of all scales they fit in. Not all scales are implemented yet, so there are also missing chords.
Only major, minor, minor harmonic and -melodic scales are implemented. Also, only the most common keys are used: C, F, Bb, Eb, Ab, Db, Gb, B, E, A, D, and G. This implies that if you play Db-F-Ab the chord finder will say Db major, but if you lower the third to Fb the chordfinder will enharmonise it to C#-E-G# and thus tell you it is C# minor. This is perfectly sound because C# minor (E major) is far more common then the minor parallel key of Fb (!).
Also this part needs some good reworking because i am not completely happy with the order in which the modi are displayed.
more to come
I am still working on this.