MIDI to Notation Converter 1.0
© Johannes Thiel 2024 | Contact: info@johannesthiel.com

Install the program
1) Install the latest version of Processing
	1.1) Download from: https://processing.org/download
2)Unzip the MIDI to Notation Converter Folder
3)Place the unzipped folder in a location of your choice
4)Run the MIDI to Notation Converter

Set Up of your files
1) Put your MIDI files in the 'MIDI' folder
	1.1) Ensure that all MIDI filenames end with the length of the MIDI pattern (e.g., Drums_16bar.mid, Pad_4bar.mid)
2)Put your graphics in the 'Graphics' folder
	2.1) Name them sequentially: 001.png, 002.png, 003.png, etc.
	2.2) You can use any image size, I used 2500x1000px, this depends on the graphics you want to use
	2.3) Use PNG files with transparent backgrounds for best results

Set Up of your Code
1)Define your MIDI files
	1.1) Set the BPM and the number of bars in your MIDI files:

int bpm = 170;
int inputBars = 16; //only important if it can't be read out of your MIDI file

2) Specify the MIDI file to use
	2.1) Set the name of the MIDI file without the .mid extension:

String midiFileName = "LIGHT_BREAK_OB57_8Bar";

3) Set paths for files and folders
	3.1) These paths will be automatically set based on the midiFileName:

String midiFilePath;
String customGraphicsFolderPath;
String exportFolderPath;
String settingsFilePath;

4) Adjust the canvas dimensions
	4.1) Modify the width and height of the canvas in millimeters:

float canvasWidthMM = 512;
float canvasHeightMM = 64;

5) Adjust the canvas DPI
	5.1) The DPI affects the size of the saved PNGs and the window size:

int dpi = 300; // Set to 300 for final export
// int dpi = 200; // Use 200 for preview purposes

6)(Experimental) Change the Processing renderer
	6.1) Depending on your CPU, you may want to change the renderer to change how the PNGs are handled by processing or to optimize performance:

String renderer = "default"; 
// Options: "default", "JAVA2D", "P2D", "P3D"
// Change to "P2D" if you want to use P2D

Get Started!
1) Each MIDI note with the same pitch will be assigned the same graphic symbol, and they will be distributed based on their timing. 
2) Velocities are also visualized by size (the influence can be adjusted). 
3) Use Y-Spacing if your notes are very close together (e.g., when programming drums). 
Adjust the height of your sequence using the Y-Offset button.
4) There are three modes: Circle (simple shapes), Unicode (selected Unicode symbols), and Graphics (your custom graphics from the folder).
5) Press 'Save' to export the current canvas as a PNG file. It will be saved in the export folder. A blue notification will indicate if the export was successful. Find the file in your export folder.
6) Toggle the Grid, the UI (re-toggle by clicking anywhere on the canvas), and the name of your MIDI file (located in the upper right corner). These elements will appear in the saved PNG.
7) Processing automatically saves your values whenever you close the window and reopens it with your latest settings the next time you start. Use the 'Reset Values' button to return to default settings.
8) Use the variance control to scroll through your different graphics and change how they are assigned. Adjust the Rotation and Randomize (Spacing/Rotation) settings to change the appearance of your sequence. Press Randomize to alter the seed and get different results.
9) Experiment with different modes and settings to explore various outcomes and have fun!

Troubleshooting
1) If nothing is visible, try adjusting the Y-Offset.
2) Use Grid and Circle Mode for debugging to view your MIDI file in its rawest form. Check if it looks the same way as it looks in your DAW. If not, your MIDI File might be corrupted. 
3) Check the console for errors if your files cannot be read.
4) If the window size is too large for your screen, reduce the DPI. You can later use a higher DPI (e.g., 300) for saving your PNG file.

Have fun with the programm, I'm happy to see what you create with it. 
You can tag me on Instagram (@johannesthl).
