Stereo101 / python-MidiToVirtualPianoMacro

Takes a midi file and converts it into a macro which will play the midi using virtualpiano.net. Uses pyHook and ctypes for macro execution.
96 stars 82 forks source link

Transposing #38

Closed Titanic12342 closed 2 years ago

Titanic12342 commented 2 years ago

I don't know if there is where I'm suppose to put something like this I've never used github, is there any way to transpose the sheets at all without having to manually do it?

Stereo101 commented 2 years ago

Checkout the dev branch. I think I had transposition as a built in feature. Its more of a command line interface than the master branch, so there is a learning curve there. The readme should help you out.

Titanic12342 commented 2 years ago

The readme only had those 6 YouTube links as far as trying to find transposing, not entirely to sure what a devbranch is if you don't care to point me to it, I'm not to good with coding either so that probably won't help me

Stereo101 commented 2 years ago

https://github.com/Stereo101/python-MidiToVirtualPianoMacro/tree/dev

This is the dev branch. It is significantly more complicated to use than the other branch. You need a working python3 install, the dependencies, and some knowhow. Sorry if its not helpful.

Titanic12342 commented 2 years ago

"transpose = SETTINGS.get("transpose",0)"

Wouldn't changing that 0 to 2 make it transpose or is coding a lot harder than that?

Stereo101 commented 2 years ago

Change the transpose setting in config/base.json, which is where that setting is loading from. I think you can change the transpose at run time at well (forgot the syntax).

It also looks like I bundled the program into an exe so you may nit need to worry about python or its dependencies.

Stereo101 commented 2 years ago

Let me know if you get it working. Im invested now.

Titanic12342 commented 2 years ago

Well originally it was to get a Garry's Mod piano addon to work since it ran off the same system, turns out it's the octave I need to change not transposing so I might be slightly stupid lol, I've been plugging in random intervals to see if it changes but I've had no luck transposing it, octaves might be easier though Idk where to look for the octave

Stereo101 commented 2 years ago

Octaves are 12 notes. Try transposing +12 or -12.

Titanic12342 commented 2 years ago

Welp, probably should've known that tried the transposing thing again, I have no clue what I did differently but now trying to transpose it to either 12 or -12 gives the error of

Error reading line:: '0.2520833333333333 64:57' list indices must be integers or slices, not float

Titanic12342 commented 2 years ago

Gone into settings, it's saying 12 instead of 0, tried it with different numbers, got the same result, going to try a different song maybe the file got corrupted

Titanic12342 commented 2 years ago

Attempt three, tried placing in a new song, apparently I have no clue how to add it to the dev one, tried just copying it over from the other one and got the error of

///////////////////////////// Playing song.txt ... Error reading line:: 'playback_speed=1.0' not enough values to unpack (expected 2, got 1)

Bach works playing, but transposing does nothing to it

Titanic12342 commented 2 years ago

image

Alright so not sure if images post, went to the original one to try and transpose it from there to see if that works, no luck, it just automatically closes in PyMIDI while the playSong script typing anything just says "Press Ctrl+C or close window to exit"

Stereo101 commented 2 years ago

I found that the dev branch had an out of date pyMIDI_repl.exe compared to the pyMIDI_repl.py its compiled from. I remember fixing a few of these issues you are having awhile back, but didn't remake the exe with those changes. I just pushed an updated version, which may work. Redownload the dev version and try it out again.

To add midis to the dev version, place your midi files inside the "midi" directory. Start the program and type "process all" to convert the midi's for playing. Typing "search" (or just pressing enter with no input) will list all the converted midi files that can be played. If you wanted to play a song with a certain transpose, typing "set transpose 12", or some other integer.

If this still doesn't work, let me know which midi file is failing to process/play and I can give it a go.

Titanic12342 commented 2 years ago

Thanks man it works now with transposing, went straight through to process the songs, tried it without transposing, played it down an octave, backed it out then in again, transpose works now