Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am writing a MIDI sequencer in C++ using asoundlib. Sometimes I would like my application to stop all voices, calling an All-Notes-Off event. I do it by calling a note-off to every note at every channel, since this is the only way I know, but for some reasons I am not really happy to send 16*128=2048 events in one moment. Is there any other approach to that? It would be perfect if I could send an event to the control queue, is there any? If not, then what is the way it should be done?

Any help is welcome, since the Internet lacks a good, detailed ALSA documentation.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

According to the crash course on the midi specification you simply send an event 'Z' with an all notes off which is explained as 00 B0 7B 00

00 to indicate no time delay
B0 to send a midi control signal
7B to send an all notes off
00 does nothing (padding)

You can see a list of midi control bytes here: MIDI Controller Numbers

Happy hunting!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.