I am trying to write a major scale using the mido python library and then apply various control changes to it so I can see what difference it makes to the sound (for example the pedal).
This is my code
mid = mido.MidiFile() track = mido.MidiTrack() mid.tracks.append(track) track.append(mido.MetaMessage('set_tempo', tempo=500000, time=3840)) track.append(mido.Message('program_change', channel=0, program=1, time=0)) track.append(mido.Message('control_change', channel=0, control=4, time=0)) track.append(mido.Message('note_on', channel=0, note=60, velocity=100, time=0)) track.append(mido.Message('note_off', channel=0, note=60, velocity=100, time=960))
and so on... ( i add the remaining notes)
For some reason the control change seems to have no effect. I have tried placing it prior to the program change and playing around with timing but doesn't seem to have any effect.
Can anyone please explain how to apply control changes when writing your own midi files from scratch?