Hi Guys
I use SweetMidi to play my collection of midi files on my Disklavier piano but the problem is that some songs are too soft and some are too loud. I can change the note velocity globally in Sweet Midi settings but that makes for terrible user experience needing to mess with that after picking each song to play.
My solution so far is to modify each midi file using python + mido library and normalize them so they have the same median note velocity. For each midi file, I try to target a median velocity of 100 (ranges from 0-127). 100 median combined with SweetMidi's note velocity adjustment (usually 65%) results in a volume that I enjoy. If I want the piano to play louder, then I can increase SweetMidi's adjustment to 70-80% and all songs are uniformly louder.
I used ChatGPT to write the python scripts. The script basically checks if the median velocity is below 100 (most are) and then adjusts the note velocities by:
1) Remap from a range of say 30-100 to 0-127 using a scaling factor
2) Adjust each node velocity by the same number to get a target median of 100
I'm pretty happy with the result and wondering if others have solved this volume normalization problem in a different or better way?
Thanks!
Benny