I have been trying to find a command line midi player that would pause, do tempo changes and skip forward backward
Anyone have an idea of such CLI tool
Before I have to write one, I better make sure it doesnt exist.
I dont want to go through all the effort for nothing.
Thanks
CLI midi player with play pause & tempo change
Moderators: MattKingUSA, khz
-
- Established Member
- Posts: 2348
- Joined: Mon Jul 01, 2013 8:13 am
- Has thanked: 9 times
- Been thanked: 468 times
Re: CLI midi player with play pause & tempo change
Can't help you with a ready CLI tool doing what you ask for, but funnily I just work on a midi player(looper)/recorder.
It's written in C/C++ under the BSD Zero Clause License, means you could take the source and do with it what ever you want. So at least if you didn't found what you look for, you don't need to start from scratch.
The Midi file handling, playing, recording, and the jack interface is clean separated into it's own classes, and so is the GUI. Replacing the GUI Class with a CLI class wouldn't be to hard, as the jack class talk to the GUI by signals only.
It support BPM control and have MidiBeatClock support, also support midi file loading from command-line already.
Beside replacing the GUI, you'll need to implement pause (currently it starts the file from beginning when you stop play) and skip forward backward. That wouldn't be to hard to do.
here you find the source:
https://github.com/brummer10/Mamba
It's written in C/C++ under the BSD Zero Clause License, means you could take the source and do with it what ever you want. So at least if you didn't found what you look for, you don't need to start from scratch.
The Midi file handling, playing, recording, and the jack interface is clean separated into it's own classes, and so is the GUI. Replacing the GUI Class with a CLI class wouldn't be to hard, as the jack class talk to the GUI by signals only.
It support BPM control and have MidiBeatClock support, also support midi file loading from command-line already.
Beside replacing the GUI, you'll need to implement pause (currently it starts the file from beginning when you stop play) and skip forward backward. That wouldn't be to hard to do.
here you find the source:
https://github.com/brummer10/Mamba
On the road again.
-
- Established Member
- Posts: 538
- Joined: Wed Oct 22, 2008 9:05 pm
- Has thanked: 35 times
- Been thanked: 94 times
- Contact:
Re: CLI midi player with play pause & tempo change
fluidsynth itself can play a midi from the command line but has no control options
jpmidi has no internal soundfont engine but you get the controls, start, stop, seek (jump). But it does not react to jack transport tempo changes. Possibly because midi files have their own tempo changes builtin so you have a constant "battle" who sets the tempo: .mid file or the player.
Adding jack tempo to jpmidi is still the better than writing your own player.
jpmidi has no internal soundfont engine but you get the controls, start, stop, seek (jump). But it does not react to jack transport tempo changes. Possibly because midi files have their own tempo changes builtin so you have a constant "battle" who sets the tempo: .mid file or the player.
Adding jack tempo to jpmidi is still the better than writing your own player.
-
- Established Member
- Posts: 157
- Joined: Sat Mar 25, 2017 2:13 am
- Has thanked: 4 times
- Been thanked: 3 times
Re: CLI midi player with play pause & tempo change
Thanks to both tramp and nilshi for the information.
I did not come accross either of the suggestions in my search and the information is very helpful.
I will take a look at the solutions / suggestions presented.
I did not come accross either of the suggestions in my search and the information is very helpful.
I will take a look at the solutions / suggestions presented.
-
- Established Member
- Posts: 157
- Joined: Sat Mar 25, 2017 2:13 am
- Has thanked: 4 times
- Been thanked: 3 times
Re: CLI midi player with play pause & tempo change
I tried jpmidi.
To use it
1) I will have to write an "expect" like routine to control it from my program as-is. Clunky but Doable.
2) Unfortunately for this application I must also be able to send the midi directly to a midi hardware device so the jack midi needs to be downgraded to stand-alone "direct-to-device" (non-jack) midi. Also not a showstopper.
It almost was an out-of-the box solution if it was not for (2) .
I will therefore have to change the source.
I did not look yet in the source if the functionalities pause etc are jack specific, otherwise if not it should be an easy change.
If I have to make the jackless version, then I might as well remove the "expect" interface, which will simplify calling it from any program.
It is a great candidate thanks.
To use it
1) I will have to write an "expect" like routine to control it from my program as-is. Clunky but Doable.
2) Unfortunately for this application I must also be able to send the midi directly to a midi hardware device so the jack midi needs to be downgraded to stand-alone "direct-to-device" (non-jack) midi. Also not a showstopper.
It almost was an out-of-the box solution if it was not for (2) .
I will therefore have to change the source.
I did not look yet in the source if the functionalities pause etc are jack specific, otherwise if not it should be an easy change.
If I have to make the jackless version, then I might as well remove the "expect" interface, which will simplify calling it from any program.
It is a great candidate thanks.
-
- Established Member
- Posts: 39
- Joined: Sat Aug 29, 2015 3:53 pm
- Has thanked: 9 times
- Been thanked: 6 times
Re: CLI midi player with play pause & tempo change
latest versions of bipscript have all this functionality, sounds like it may just be a few lines of script: www.bipscript.orgI have been trying to find a command line midi player that would pause, do tempo changes and skip forward backward