Patch with MIDI problems (midiout not working?!)
Hey all,
I'm just learning MAX. I have a problem with the attached patch.
I want to record 5 MIDI Notes into a seq object.
This only works once, after that I have to restart Max to hear any sound again.
How to reproduce:
1. Set midiin and midiout devices. (I use the MS Wavetable Synth for testing)
2. Set gswitch2 to route to the left port
3. Klick on record
4. Play 5 MIDI notes
5. Klick on start 512 -> MIDI Notes will play
So far so good....
Now... if I repeat steps 3 to 5, there will be no sound. The debugger shows me, that
data is being sent from seq to midiout, but no sound can be heard. Also if I set the gswitch2 to the right port, to pass through the MIDI data directly to the synth, no sound can be heard.
I have to restart MAX and set the ports again to get any sound. I've tried several midiout devices (Kontakt, Live).
Thank you for your help
Timo
The fact that that note counter could be much simplified is not so important,
but stoping seq recording, before last Note Off gets recorded should be fixed...
Not that it has to do with loss of midi output, which could be anything else
Thank you for your optimized patch.
Are you able to reproduce my problem?
might have something to do with no midiflush after your seq object.
also, if you are just recording midi note events, try using notein (and noteout) rather than midiin /midiout-- there might be program change information being recorded by seq that affects sound-engine output
Thank you! I will edit my patch accordingly.
Does it make a difference for this patch, whether midiflush comes before or after seq?
The second patch in this topic has it inserted before seq and your suggestion is to put it after seq.
purpose of midiflush is to send note off for all
hanging midi notes.
It is absolutely necessary to include it before
seq object.
If You stop seq playback before all notes get turned off,
then You have to insert it also at the seq output,
and bang it when using stop message to seq.
seq expects raw midi messages, so using anything else than
midiin, like suggested notein, would mean prepending
midi note status byte before sending pitch/velocity to seq.
And if You want to keep channel on which notes were sent,
it would get more complicated, one would have to map ch 1
to 144, ch 2 to 145 and so on,
and then packing it into message, respecting order.
note in outputs as most max objects data in right to left order,
status byte is first in the list, so to simplify it, stick with midiin.
P.S. if You suspect that something gets recorded into seq object
that breaks the midi device reception,
just capture the playback into capture object,
and look what's in there, or You could print
first 15 events into max console, or even save
recorded data as text file.
Hi sourceaudio, everything you say makes sense--I haven't used seq in a long time so apologies to readers for the misinformation-- but in the seq help file there is a midiflush after the seq object, not before, so maybe that's a factor.
I think I was confusing seq with detonate-- so Timo you may want to explore that as an alternative to seq, if you're just storing note events
here's an adaptation of the detonate snippet file:
it might be worth testing this against your other patch at least for diagnostics
It is allways difficult to suggest best solution to a problem,
if one does not know the details.
I am wondering - why this 5 notes limit ?
Maybe something else than seq would be a much simpler solution,
but one can't think so far without knowing what really is the goal of the whole
exercise.
Beside possible problems that could arrise due to misuse of seq, midi data etc, there were problems reported with midi flow and system based virtual synths,
on both platforms, both mac and win, so one has to at least eliminate
the part with capturing and playback of midi data, before looking into other things.
Thanks for all your help.
The patch is really just to get to know MAX better. The 5 notes limit is arbitrary.
Source Audio: Why would I need a midiflush object BEFORE seq. Shouldn't the one AFTER handle all note offs? The seq object doesn't need to receive the note-off events, correct? It enough, if the actual output receives it, correct? Sorry for not understanding.
I created a new patch. Could you please have a look if - in principal - it's ok? I can find no problem with the captured MIDI events. Maybe the problem is with my specific software/hardware combination.
Also.... only FOUR notes get recorded by the seq object. Is that a problem with the order of execution?
Thanks again for your help, Source Audio and Floating Point!
This seems like a nice community!
Here a version with seq, mainly based on the help file. Please comment, if it works for you. Differences are
• taking account of note-offs, recording stops AFTER getting the last note-off
• midflush handling
Sorry for the ugly colors.
Seq is also capable of storing recorded midi as a file.
You don't want hanging notes in a midi file.
That's why midiflush BEFORE seq.
Should the seq help patch be re-written then? I just copied from there.
Help file of any object is not a holy grail,
telling You all consequences of using it.
Any halfway decent DAW will record only
notes that have received both Note On as well as Note Off
messages, other would be dismissed.
That's advantage an disadvantage of Max - You have more freedom
but also more field to make mistakes.
there are arguments for having midiflush both before and after seq, so you could reasonably have midiflush on both the input (when recording) and output (when playing back) sides of the object
Thanks for all your replies!
Ben Sonic: Your patch works for me. I will go from here and see what I can build :)
Source Audio: Thanks for the clarification! I will use the flush object before and after.
Just one last question:
I see you all using the trigger object, even if it only sends a single bang. Is that just good MAX practice?
Trigger object is a very helpful one,
for example stop message to seq is also sent to
t b , to send a bang to midiflush.
Correct way would be to use trigger for both messages,
in order to force order of execution.
t b stop.
In that case, stop message would be sent out first, followed by bang.
P.S. using notes Off to count notes is not really reliable.
One could for example play 4 note chord , followed by let's say 3 note chord.
resulting in recorded 4 notes on, 4 notes off and 2 notes on in case 10 events was the limit.
So last 2 events would be 2 hanging notes.