Sending a bending tone to a MIDI sequencer in Java

I understand the basics of getting a MIDI sequencer and it works, and I would like to increase / decrease the pitch of the sequence during playback, but the pitch bend is a message that is sent to the synthesizer, not the sequencer.

I tried installing the sequencer receiver as a synthesizer transmitter, and when I sent short messages with a bend, the sequencer remained the same step, but then the synthesizer played the second track at a new pitch, creating some pretty terrible-sounding music.

Is there a good way to bend the tone during playback, for example, to change the tempo?

Another option (which seems like a big kluge) is to have several versions of MIDI files in different keys, ready to be loaded on call.

+4
source share
2 answers

You can try sending messages directly to the synthesizer receiver by calling its send method, but the synthesizer may not allow its receivers to influence each other.

Ultimately, messages sent to the synthesizer are stored in the sequencer track, so for messages with a bend in the tone, edit the sequence to add these messages.

0
source

The MIDI protocol does not define standards for tonality, with the exception of pitch bending, which is usually intended to be used as a temporary effect, rather than to adjust the layout setting. It looks like you are implementing a Java sequencer, in which case I would prefer to offer a global tuning preference. Then you simply visualize the sound with the default setting (440 Hz), and then apply the pitchbend to the bounce. There are several libraries that can use pitchbend for you, including the excellent DIRAC .

0
source

All Articles