Send MIDI notes based on a timestamp table
Ingest a tab-separated text file formatted thus:
Position Name
00:00:02.025 2
00:00:03.500 3
00:00:04.200 8And send notes over MIDI at the precise positions found in time.
A VJ can play pre-determined precisely timed video effects inside Resolume Avenue or Resolume Arena over an audio track while still retaining creative control and improvisation ability of using the software.
You can use the Vegas Pro video editing software to insert markers wherever (in a video or audio) and then copy the table of times and marker names to a text file. This script will then play midi notes depending on the marker names (as defined in the script).
Rigt click in your timeline (where it shows e.g. 00:00:04.10) and select "Time" (rather than "Time & Frames") since we want timestamps to be shown in miliseconds.
In Vegas Pro click on Tools in the file menu (or View then Window), then Edit Details (shortcut Alt + 6) and then in the new window that pops up, under the Show dropdown select Markers. Either click the save icon to save, or click on the top-left square in the table to select the whole spreadsheet, CTRL + C on your keyboard to copy the table into your clipboard (then paste into markers.txt in this folder).
You'll need to install Python (and uv recommended for a better experience)
You'll need to have an available virtual MIDI port open. On Windows you can download loopMIDI to create a port hassle-free. On Mac it seems possible to do without downloading anything, please see a tutorial online.
I recommend you use uv to install the Python dependencies and run the script, though feel free to use Python however you'd like.
Make sure the MIDI_PORT_NAME in midi.py coincides with the available MIDI port name you have (loopMIDI lets you choose the name of the port).
uv run main.pyUpdate the markers.txt with your own timestamps and note numbers.
Code is formatted with black. Run uvx black . to format after edits. You can also run uvx ruff format to format or uvx ruff check to see lint errors.
The quality of code in this repository isn't excellent, but it gets the job done and should be easy to modify. Feel free to offer a PR with improvements.