Midi signal generation

 import mido


# Open a virtual MIDI port

outport = mido.open_output('Virtual Port 1')


# Send a Note On message

note_on_msg = mido.Message('note_on', note=60, velocity=64)

outport.send(note_on_msg)


# Wait for a bit

mido.sleep(1)


# Send a Note Off message

note_off_msg = mido.Message('note_off', note=60, velocity=0)

outport.send(note_off_msg)


# Close the MIDI port

outport.close()


mido allows me to connect the generated signal through different channels and in real time, in theory I should be able to send te notes with a particular duration but I'm not sure if I can integrate it with the MIDI generating file.



Comments

Popular Posts