MidiEvent to VST object help!

Apr 17, 2012 at 3:56pm

MidiEvent to VST object help!

Hi all,

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
etc…

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!

Thanks,
Ben K

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.

#63036
Apr 17, 2012 at 6:22pm

You can get this effect with midi control change messages, for example cc11 (expression) or cc7 (volume).

#227480
Apr 18, 2012 at 9:13am

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?

Thanks!
Ben K

#227481
Apr 18, 2012 at 9:24am

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?

Ben K

#227482
Apr 18, 2012 at 9:55am

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?

Ben K

#227483
Apr 18, 2012 at 4:57pm

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.

#227484
Apr 18, 2012 at 5:38pm

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,
Ben K

#227485
Apr 18, 2012 at 7:10pm

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~.

#227486
Apr 19, 2012 at 4:21am

“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].

#227487
Apr 19, 2012 at 4:30am

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].

-110

#227488
Apr 19, 2012 at 8:26am

little correction here:

-velocity is not a midi event itself, but a parameter of the note-on/off message (2nd data byte)

#227489
Apr 19, 2012 at 8:39am

Another little correction here:

[midiin] – [route 5] – [/127.] – [prepend 12]

should be

[ctlin] – [route 5] – [/127.] – [prepend 12]

@BAK2K3

Maybe you could solve the problem just by controlling the ‘Release’ parameter of Massive’s envelopes?

#227490
Apr 19, 2012 at 12:33pm

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!

Ben K

#227491
Apr 19, 2012 at 6:59pm

Hi everyone!

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!

Thanks!
Ben K

#227492
Aug 18, 2013 at 5:17pm

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.

Thanks,
Dan

#259217
Aug 19, 2013 at 12:20am

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.)

-110

#259233

You must be logged in to reply to this topic.