Programmer
Programmer

Reputation: 6753

how to change the pitch of a audio file by manipulating its midi data

I have the midi file for an audio file . I want to know what components of that MIDI file should I change in order to play that audio file at a higher/lower pitch than the original pitch

Upvotes: 0

Views: 792

Answers (2)

EuAndreh
EuAndreh

Reputation: 578

In the MIDI standard, you can control the pitch by sending a pitch bend short message.

This is how it should look like in Java:

int pitchBendValue;
long eventMoment;
ShorMessage pitchMessage = new ShortMessage();
pitchMessage.setMessage(ShortMessage.PITCH_BEND, channel, 7, pitchBendValue);
receiver.send(pitchMessage, eventMoment);

Upvotes: 1

Shannon Matthews
Shannon Matthews

Reputation: 10378

Your question is difficult to understand. MIDI files don't "play" audio files. I assume you are rendering the MIDI file to create an audio file.

To change the pitch of your MIDI file, transpose all notes individually in the MIDI file to a higher or lower pitch.

David's MIDI spec might be useful as a quick reference.

Upvotes: 3

Related Questions