midiformat problems

Oct 11, 2006 at 11:31am

midiformat problems

Hi,

Whenever i put a pair of note-number velocity values into midiformat it churns out a note on message, even if the velocity is zero. I.e. i churns out 144 64 0 say, rather than 128 64 0. Why? (even the help on midiformat does that – so it can’t be me). I was under the impression that the midi code for note-off was 128-143 (one per channel) and for note-on it was 144-159.

also if i pack up the messages midiformat dishes out and prepend “midievent” to them, when i pass the message onto vst~ i get no response. but if i pass the message through a messagebox to reformat it, it works. Why is that? What’s wrong with the format?

thanks!
tom

#28079
Oct 11, 2006 at 12:11pm

> Whenever i put a pair of note-number velocity values into
> midiformat it churns out a note on message, even if the velocity is
> zero. I.e. i churns out 144 64 0 say, rather than 128 64 0. Why?
> (even the help on midiformat does that – so it can’t be me). I was
> under the impression that the midi code for note-off was 128-143
> (one per channel) and for note-on it was 144-159.

noteoffs are usually treated as simple noteons with a velocity of 0.
i don’t know a midi device that has problems with that.
so, i guess, you should be fine.

> also if i pack up the messages midiformat dishes out and prepend
> “midievent” to them, when i pass the message onto vst~ i get no
> response. but if i pass the message through a messagebox to
> reformat it, it works. Why is that? What’s wrong with the format?

i think you have to be more specific, if you want help on that one.
what do you mean by “reformat”?
at least i don’t understand what you mean.

volker.

#85789
Oct 11, 2006 at 12:38pm

What i mean by ‘reformat’ is that if a message saying “midievent 144 64 72″ goes straight to vst~ from midiformat as in diagram A, vst~ does nothing.
Yet if i take that message, prepend ‘set’ to it, put it in a messagebox and then bang it out, vst~ reacts. see diagram B, So surely something wrong with the ‘format’ of the message. what else could the messagebox be doing?

diag A
messages from project
|
midiformat
|
pack 0 0 0
|
prepend midievent
|
vst~
|
dac~

diag B
messages from project
|_________
midiformat
|_________
pack 0 0 0
|_______________
prepend midievent
|___ _________
bang prepend set
________
messagebox
_|_
vst~
_|_
dac~

(sorry that diagram’s a bit bad….)

#85790
Oct 11, 2006 at 1:51pm

> What i mean by ‘reformat’ is that if a message saying “midievent
> 144 64 72″ goes straight to vst~ from midiformat as in diagram A,
> vst~ does nothing.
that’s not really what’s happening in diagram A
> Yet if i take that message, prepend ‘set’ to it, put it in a
> messagebox and then bang it out, vst~ reacts. see diagram B,


> (sorry that diagram’s a bit bad….)

why don’t you simply send a patch?

i wonder in what way vst~ reacts to your messagebox approach. do you
mean it actually plays a note?
i am afraid, both of your ascii-versions don’t make a lot of sense.
midiformat outputs raw midibytes as integers not as a list (check the
help file).

but you can easily build the correct message yourself.
send your pitch/velocity data into [prepend midievent 144] and then
to [vst~].

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#N vst~ loaduniqueid 1031426176;
#P newobj 40 162 79 196617 vst~;
#P newex 40 136 113 196617 prepend midievent 144;
#P newex 40 110 30 196617 pack;
#P user kslider 40 46 54 0 36 48 31 12 0 128 128 128 128 128 128 255
255 255 0 0 0 0 0 0;
#P connect 2 0 3 0;
#P connect 1 0 2 0;
#P connect 0 0 1 0;
#P fasten 0 1 1 1 372 105 65 105;
#P window clipboard copycount 4;

volker.

#85791
Oct 11, 2006 at 2:13pm

as far as posting a patch – when i open the .pat files they look nothing like the things you guys post on this forum! And i can’t load your patch, max opens it as a text file… ??? am rather new to this forum, sorry.

anyway, vst~ plays notes when using my messagebox approach, although the timing is a bit off, and it just strikes me that this is the *wrong* way to be doing it. I have tried packing the note number and velocity together and prepending “midievent 144″ (or 128), as i think your patch does, but vst~ then doesn’t react. it makes no noise.

have attached both versions as a patch to this post.

Thanks for your help btw!
tom

#85792
Oct 11, 2006 at 3:09pm

On 11 Oct 2006, at 16:13, Tom Giles wrote:

> as far as posting a patch – when i open the .pat files they look
> nothing like the things you guys post on this forum! And i can’t
> load your patch, max opens it as a text file… ??? am rather new
> to this forum, sorry.

you select the text and copy. then go to max and do “new from
clipboard” from the file menu.
voila.
if the “new from clipboard” is not there, you have an older max
version. if so, save as text file, prepend ‘max v2′ and append ‘#P
pop’ (without the quotes) if they are not already there and open in max.
i think that should do it.

> anyway, vst~ plays notes when using my messagebox approach,
> although the timing is a bit off, and it just strikes me that this
> is the *wrong* way to be doing it. I have tried packing the note
> number and velocity together and prepending “midievent 144″ (or
> 128), as i think your patch does, but vst~ then doesn’t react. it
> makes no noise.

both your versions work for me (and are different from what you
posted earlier as ascii – midiformat is actually an object in max)

sometimes vst~ is a little picky about midievent messages, when it
thinks that the loaded plugin can’t handle them. this can happen,
when you accidentally send midievents to a plug that doesn’t want them.
reinstanciating the object (typing it again) fixes this usally.
and there are (or used to be) some issues with vst~ with an argument
plugin name to load (or just typing none). as i remember, leaving the
argument blank is the way to go, but i’m not sure.

but still your programming is not optimal…
you don’t have to care about sending a note-off message (128). noteon
with velocity of 0 is fine, it’s just what [makenote] e.g. sends.
see attached patch.
v

#85793
Oct 11, 2006 at 3:42pm

thanks for that. tried earlier on in the day with midiformat but replaced it with the prepend 144 etc whilst discussing this. either way didn’t work for me, and, as you say, both are equivalent.
It is very odd that it works for you though. I have tried it on two machines (same version of max though, 4.5.5) with identical results. vst~ doesn’t have the patch name typed in, and it is a synth i have been trying this with so it should be expecting midi data. Reinstancing hasn’t worked.
It could be the synth itself i guess, but since i’ve specially designed this patch to work with that particular synth i’m going to have to work around it….
Anyway, why on earth would vst~ respond when sent through the messagebox and not otherwise? i’ve had similar problems with what appears to me to be the “format” of the messages in max, and quite often have to send them through sprintf boxes to get them to be read correctly. weird.

#85794
Oct 11, 2006 at 8:24pm

ok, i’ve found the solution to this problem – the other part of my patch was sending note-offs far too quickly and too often. inserting a speedlim just before the vst~ demonstrated that. so this is all solved.
For the record then prepending midievent 144 to a notenumber velocity pair does work! and there’s no need to prepend 128 for note-offs.
thanks for your help though!

#85795
Oct 11, 2006 at 10:57pm

As to ‘why?’ 144 60 0 for a note off: read the MIDI standard. Pay particular attention to the section labeled “running status.”

If a VST is not grokking note-on-with-velocity-zero as synonymous with note-off, then the VST is broken. Period. I see in this case it turned out that your patch was broken. Auch schlecht.-

The only compelling reason for having MIDI messages 0×80-0x8f is so that you can program your synth/sampler/whatever to respond differently to different note-off velocities (for instance, change the Release parameter of an ADSR envelope or something). Very few MIDI devices seem to take advantage of this capability (or maybe it’s the device users).

– P.

#85796
Oct 13, 2006 at 7:29pm

Tom Giles wrote:
> (sorry that diagram’s a bit bad….)

Yes its much easier to just copy the non working part and paste it into
the mail body. (At least if you have Max 4.5.5 or newer. Alone this
feature would justify an upgrade…)

Then everybody can immediatly try it and help out with your problem…
A typo for example might not be in your picture, but will be in the
problematic patch…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com

#85797
Oct 13, 2006 at 9:31pm

Peter Castine wrote:
> Very few MIDI devices seem to take advantage of this capability

Yes, I know only the Prophet T8 and the Oberheim Matrix 12 had release
velocity… Also the Yamaha VP-1 which never made it into quantity
production.
Also the Alesis QS and ION series, Kawai K5, Ensoniq…

Maybe thats it…


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com

#85798

You must be logged in to reply to this topic.