MidiEvent to VST object help!
I’m designing a sequencer in Max/MSP that allows the user to create a specific sound with a Wii Controller (Using Native Instruments Massive VST), record the sound, and then place the recorded sound within a sequencer.
While I’m only at the early stages of the project, I’ve encountered a problem with sending midi data to Massive. The user selects the note (for example 48) while using the acceleration of the Wii-Remote to determine the note velocity, and this is sent to the VST object using the following:
Midievent 144 $1 $2 ($1 being note number, $2 being velocity).
In order to stop the sound (Velocity changing from for example 100, instantly to 0), the user quite easily lets go of the "Note On" button, however I’ve added the choice to smooth out the velocity from the initial value to 0, using the line object, sending a stream of data similar to as follows:
Midievent 144 48 100
Midievent 144 48 99
Midievent 144 48 98
Midievent 144 48 97
However, this causes Massive to re-play the note for every message sent into the VST object.
Am I approaching this incorrectly? Is there a different Midievent I should be sending to achieve this effect? Or should I link this "Smooth decrease" to something else, such as the amplitude?
All responses are appreciated!
Edit: Just to clarify, the effect I aim to achieve is to slowly lower the intensity of the sound to zero over a short space of time, as opposed to instantaneously setting the velocity to 0.
You can get this effect with midi control change messages, for example cc11 (expression) or cc7 (volume).
Hi Broc, thanks for the reply.
Using this website as a reference for Midi (http://www.midi.org/techspecs/midimessages.php), I attempted the following with no luck:
($1 being the value changing from maximum 127 to 0)
Midievent 176 11 $1
Midievent 11 $1
Midievent 176 7 $1
Midievent 7 $1
11 being Expression, 7 being master volume. Upon trying both of these, there was no change in output (until I intentionally used the note off function.)
Am I correct in thinking that Midievent 176 11 is Midi Event on channel 1, CC11, Value? If so, why wouldn’t it have worked?
I’ve just attempted to use Christopher Dobrian’s patch (http://www.cycling74.com/forums/topic.php?id=34653) to test the CC messages in Massive, and it appears CC messages are completely unresponsive….
Am I doing something wrong, or could it just be that Massive isn’t interpreting the control messages correctly?
Ok, so after doing a bit of messing around with "Midi Learn" I’m guessing that Massive doesn’t have any native CC capabilities?
I pressed Midi Learn on the Massive Volume, and tried Midievent 176 7 $1, and it immediately attached CC7 to main volume.
So, back to my original problem, if there is no control over any native "Expression", shall I just create a workaround to achieve the ‘effect’ of expression release?
If you are on PC I strongly suggest you take a look at midiOX/midiYOKE. They may be daunting at first, but they’re real handy for unconfusing yourself if you get lost in midi routings.
I’m on OSX using Osculator. As far as I’m aware Osculator does pretty much exactly what I want it to do – I’ve tried MidiYoke before.
My problem isn’t with the midi routing, it is quite literally the fact that Massive doesn’t appear to have any inbuilt Midi CC controls, meaning I can’t manually reduce velocity using midi commands, everything needs to be done within Massive. Every parameter in Massive already has a mapping (1 – 149), and with no native CC messages to control anything such as "Expression" (which isn’t a parameter within Massive) there seems to be no need for CC messages (despite the fact you can tie CC messages to specific parameters).
I hope people understand what I’m talking about!
Thanks for the reply,
In this case you may need applying the smooth effect to the amplitude. But it’s quite easy. Just make sure that the note-off message (velocity 0) is not sent directly to Massive but instead triggers the line for reducing the amplitude, and if at 0 send note-off to Massive (and reset the amplitude). The smooth effect could be applied outside of Massive to the audio output of vst~.
"smoothing our the velocity using line" sounds like a misconception, thats not how velocity works.
otoh, if you really want to use single note on events in a situation like that you might want to check [midiflush].
oh wow, there is a whole bunch of misconceptions hidden here. :)
"it is quite literally the fact that Massive doesn’t appear to have any inbuilt Midi CC controls, meaning I can’t manually reduce velocity using midi commands, everything needs to be done within Massive. Every parameter in Massive already has a mapping (1 – 149), and with no native CC messages to control anything such as "Expression" (which isn’t a parameter within Massive) there seems to be no need for CC messages (despite the fact you can tie CC messages to specific parameters)."
1. "velocity" can never be controlled with a controller, it is a midi event itself.
2. "expression" can never be controlled with a CC, it is a CC itself.
2. massive HAS midi controller input – but the vst~ object does not support midi controller input.
3. the vst object supports to control any paramter to a plug-in DIRECTLY instead – which is much better.
so when required, CC 5 input to the plug-ins 12th parameter can easily be programmed by using something
like [midiin] – [route 5] – [/127.] – [prepend 12].
little correction here:
-velocity is not a midi event itself, but a parameter of the note-on/off message (2nd data byte)
Hi guys, thanks for the helpful replies!
I now understand why the multiple velocity messages were triggering multiple note-ons.
I’m going to attempt to tie the smooth-out to either the Release parameter of Massive’s Envelopes, or tie it to the amplitude of the oscillators.
I’m building my own midi-messages as I’m using a Wii Remote as input, so I don’t think I’ll need to use:
[ctlin] – [route 5] – [/127.] – [prepend 12]
We’ll see, and I’ll update with what worked best.
Thanks for the help, this community never fails to help!
Just a quick update to let you know that I managed to achieve a smooth sounding decay by tying the "Decay" button (to use alternatively to the simple note on/off) to the 3 oscillators’ amplifiers within Massive. Using the Real Time Composition (RTC) library’s "smooth-line" and a decay of 500ms, the Decay button uses the current value of the amps, and decreases them to zero over the space of 500ms, before resetting their values back to those I have stored in a coll. After the 500ms, a Note Off is sent to the VST. This also helps as it aids in recording the note duration for future playback.
I love Max/MSP and this community, thanks for all the help!
If anyone would like an example of what I did, feel free to ask and I’ll post it!
Hey I know this was from a long time ago, but I would love to see what you did! I am trying to create smooth controlling (via gestures and movements) via Kinect and Kontact. I am just getting started with Max, so thank you for your help.
hello back in 2013,
what is still true is that if you want something to be "smooth", dont use midi.
this is a general advice which is independent from the question wether control change works with the vst~ object or not, or with which version of it and with which plug-in.
the "normal" way of controlling parameters in a VST plug-in is to use the VST parameters, and not MIDI.
it is a little bit of work to find/get the right parameter for something, but it is less work than to find the right MIDI CC (in case controlling that would work) ,
plus it is fixed where CCs can be dynamic (can you say "midi learn"),
plus it gives you a precision of up to 24 bits (the only limit is inside the plug-in, depending on its design.)
I would love to see what your finished result is. I am trying to do something similar but by using data from the motions of a slackline. This is my first time using Max so I would appreciate all the info I can find on reducing data to VST parameters through Max. Thank you so much!
News to me. I’ve been sending MIDI CC messages to my vst~ objects for years. In particular, pretty much every plugin I use responds to CC 64 for sustain as well as to CC 7 (volume) without any extra configuration.
…but the vst~ object does not support midi controller input.