The next step was to try and get the individual keys on the Microkorg to control each cube in the visualiser. In my mind I knew how this could be achieved, but actually tackling it was going to be difficult.
I began by experimenting with the MIDI related objects in Max, loading in different objects and using the help files to explain what each did. I soon discovered that the midiparse object will print everything that is happening to a MIDI controller. This included: note being pressed, velocity, dials being turned, how much the dials were being turned and more. What made it interesting for me was what it could offer my project. I noticed, if I played a chord, for example C, E, G, even if I played those notes at the exact same time, it would produce the messages for each key, including velocity. Plus, when I removed my fingers, it would send messages to show that the keys were not being played, as it would send out a 0 velocity for each key. This lead me to the idea of having separate micro patches that I could somehow teach to only send out a message, when the corresponding key was pressed, to change a corresponding 3D bar.
Above is a screenshot showing part of my prototype patch that allowed individual key control. Each object send is being sent to an unpack object which allows the MIDI signal to be recognised. I had 37 send objects and 37 recieve objects, 1 for every key on the Microkorg. The next part was very difficult. I knew, from coding in the past, that I could use an "if" statement to filter out the other MIDI key messages to leave only the MIDI key I wanted. After much trial and error, and much help from the max help files, I figured out the "if" statement. Below is an example code that allows MIDI key 48 to filter out so that only, if the MIDI key 48 is pressed, it will allow through.
if $f1 == 48. then out2 $f2. else
Basically what this means is: if the floating number coming into port 1 is received and it is equal to 48, then send out of port 2, the velocity. If the signal coming into port 1 isn't equal to 48, then do nothing.
After I wrote an "if" object for every MIDI key, I moved this patch to my project patch and sent each one out to their corresponding 3D rendered bar. I then routed them so that the velocity would control the scale of their corresponding bar. However, what I found was that because the velocity could be anything between 1 and 127, the scale was so big it would go off the screen. To limit the signal, I used a pong object to limit velocity to 15. Again however, this meant that normally the velocity was 15, making the 3D bars static and boring. Therefore, my next step of development was going to be finding a way to use the amplitude of the audio of the synthesiser, to control each 3D bar. Below is a screenshot showing part of the patch with the pong objects and the recieve signals controlling the scale of the 3D objects.
No comments:
Post a Comment