Welcome to the Piano World Piano Forums Over 3 million posts about pianos, digital pianos, and all types of keyboard instruments. Over 100,000 members from around the world.
Join the World's Largest Community of Piano Lovers
It's Fun to Play the Piano ... Please Pass It On!
Cybrid, that is the one... And that may be feasible to do even on the arduino code (to send an automated start/stop recording to operate the app... Or send the messages in bulk with a delay that is non important for recording purposes... Otherwise the app is at full speed CPU even in idle).
But putting the app in a dongle it is next to impossible without a full OS (at least impossible to me).
I think even the most basic and compact Arduino is capable of intercepting the raw serial communication that happens on a single pin and record it. Actual MIDI file can be created later from that raw data by a software on the computer.
Is the program sitting in-between the MIDI hardware (or USB) and whatever software is meant to use the MIDI signals? In that case you might want to add the ability to let the user set a velocity curve, so that the MIDI signals sent along to the software is altered in agreement with that velocity curve. That would be majorly useful.
I don't think that what you wrote is possible or desirable: the incoming MIDI signals are read simultaneously by the VST and by my application, and they don't talk to each other. It is easy to add a feature to have velocity curves that change the midi values as they enter. But if I do that, when you output that recorded MIDI file back to the VST, the VST will again apply a new velocity curve to the already changed velocity curve (so a value 100 that was changed to 110, is now 110 that is played as 121). So, it is not a good idea. The program should record midi as it is output by the digital piano and not as it is seen by the VST.
A workaround (depending if the VST has that possibility) is to make the VST output midi to a virtual port (LoopMIDI or akin) and record that on AutoSaveMIDI. I don't know if any standalone can output MIDI values...
I am only waiting for bug reports of this version before posting the Mac version
excellent. looking forward to trying this. i have only actually used this feature a few times with PTQ to find something i played, but i was surprised by how much i like knowing that i have this feature there to draw on if necessary
will be interested to see how my aging computer handles the processing of this and garritan. i might look at setting up a virtual midi port as hz suggests if necessary
Sorry for the late replies... I have to find a few minutes between work and family (well, this applies to everybody...)
Originally Posted by HZPiano
And thumbs up to beta testers @EB5AGV and @David Lai.
Indeed... The program core was basically finished when they tested it, but they were paramount in perfecting the UI and critical for setting up the installation and the configurations file. They found errors and potential user pitfalls that I never dreamed off. And they suggested a few features like the audio padding, the suffixes of the files, and maybe others that I am forgeting...
Originally Posted by HZPiano
does AutoSaveMIDI also have a playback function for the recorded MIDI files? And/or how would AutoSaveMIDI pair up best with a playback tool, if one (like me) only uses standalone piano VSTis?
Playback of MIDI files? That is a daunting task that I will not even attempt... You will need to pair it with a MIDI player. Now comes the problem: I still have not found the perfect MIDI player for windows (and I am open to good suggestions). For simple things, you just open the files on Windows Media Player and it plays using some MIDI synthesizer. Good to fast listening and browsing of files. Downsides: WMP cannot output to a MIDI port to feed a VST and you don't have any kind of mixer if you have that... The best free MIDI player I am aware is a Karaoke player:VanBasko. You can set MIDI output, it has a good channel mixer, velocity control, fast seek through the file, and even a piano window with blinking keys. Downside: it is geared to karaoke and it has probably the ugliest user interface in the history of computers. My MIDI player: synthesia !!! The best thing for MIDI since sliced bread. Great folder management, perfect and thorough setting of MIDI inputs and outputs, very good player and mixer, timeline seeker, easy setting of loops, AUTOMATIC DISPLAY OF SCORE (ok, not sibelius, but it is automatic!!!), and you can hide the notes waterfall.
Getting back to the issue of velocity curves brought up by QuasiUnaFantasia, I remind you that one useful feature of AutoSaveMIDI is seeting up a file suffix. If you are playing a particular VST with a particular velocity curve, you can define a suffix such as "-VSTname_VelCurve1" and all files will be easily identifiable. If you need to render that particular MIDI to audio, you simply need to put it through the appropriate VST and velocity curve... You can define and memorize 10 different suffixes and I can easily increase that to a larger number if a number of users find it convenient (but it will clutter the user interface).
Yes, i can record midi "as advertised" but only in stealth mode with no active player. Tried to use it with Plogue Sforzando player the app is killed with the start button. Checked with Pianoteq, same result. Starting order and used keyboard do not matter.
That is unexpected (the program was heavily tested using Pianoteq demo) and I need more information about the crash to debug the error. If the crash occurs when you hit the START button, the most probable cause for the crash is an error in the definition of the folder where to put the recordings. The program should test its viability and give a warning that it cannot access that particular folder, but it may occur nonetheless. Try setting beforehand an empty folder in which to place the recordings, and do be sure it works, put it in the root. Create a folder inside "C" called "midi recordings". Then launch AutoSaveMIDI and in the user interface browse and select that folder. Just to be sure click on another button (for example, increase the split interval by one second...). Then click on START and see if it works.
I just thought of a business idea Create a small MIDI DIN dongle that will be inserted into the MIDI OUT of your piano and will have a micro SD card to save your MIDI performances. It can be powered from the MIDI IN port which has s 5V power
I suspect it would be hard to set/persist the date/time on such a device, so it'd be difficult to sort/order the recordings other than by name?
Lack of date/time on DPs is another pet peeve of mine. It would be so helpful for saving MIDI/WAV/MP3 files.
Vagfilm, amazing work here! Looking forward to a Mac version. Is there any easy way to tag something so that you can leave it recording forever, but if you have a particularly nice take you can hit a key combo or button and "flag" or "star" it to find later?
I installed loopmidi and added a port. I can chose this port in player and autosavemidi but no data comes through. The savepath is valid and i can record with autosavemidi alone but is a blindflight without audio.
Hi Rhodes74: in most cases YOU DON'T need a virtual port like loopmidi (these are only needed when the midi signals come from a source internal to the computer).
Walk me through your setup... What piano are you using? When playing do you use the digital piano sound or an external VST? Do you normally connect the piano to the computer through usb? What are the options for MIDI INPUT that show up on AutoSaveMIDI when you connect it to the computer?
I am unfamiliar with Sforzando. What input were you using to Sforzando before you installed AutoSaveMIDI? You don't need to output midi from sforzando to AutoSaveMIDI... You feed midi from the keyboard to AutoSaveMIDI.
@Rhodes74 and @vagfilm, The single-clientness of Windows' MIDI ports (which are used automatically when a piano and/or other MIDI input device are hooked up through USB and those devices don't have proprietary drivers) is something I recently became aware of.
For instance I wanted to run two instances of sforzando in parallel, or another VST and sforzando, or a VST and midiOX at the same time, and so on. When setting a second 'something' to listen to a Windows port that is already listened to by another 'something', error messages occur and/or things just don't work as expected.
A virtual port like those that loopMIDI creates is multi-client so doesn't have these limitations/problems.
@Rhodes74, You got no data coming through because one more step is needed: to link the incoming MIDI (through that automatic Windows port) to the loopMIDI port. This can be done by using the free midiOX tool (which is quite useful in many ways, by the way). In that tool, there is an option to 'draw' a line from the incoming port to the loopMIDI port, after telling midiOX in a setup menu which ports you want available in midiOX.
Whether that solves the AutoSaveMIDI crash remains to be seen of course, but this is what I can offer based on my initial hunch.
HZPiano, in my very short experience i did not encounter any problem with 2 programs accessing the same midi port (physical or virtual). You and Rodhes74 report that problem and you are both using sforzando, so I suspect that to be the culprit.
The beta testers were running AutoSaveMIDI with VSL, garritan, VILabs, and Kontakt standalones, or even recording at the same time to reaper or cubase.
Again, I suggest to troubleshoot it step by step, instead of installing midiOX and midiloop, which can create a new level of problems for the unfamiliar user. Do you need loopMidi to run sforzando with midi signals from a piano?
It seems to work just fine. I wonder, though, why it uses so much CPU when it's just sitting idle. It uses 13% continuously. Only a video game uses more. That seems odd.
This behaviour means that application is continuously and actively waiting for MIDI events in a loop. The CPU usage is the same regardless of whether the application is actively waiting or if it is actually processing the incoming MIDI events. Since MIDI events are produced at an extremely low frequency, the app is mostly wasting CPU cycles and producing heat. The CPU usage percentage depends on the number of cores of your CPU. This application is single-threaded and therefore will be bound to one single core of the CPU. So, you get ~12.5% of CPU usage because your CPU has 8 cores. You would get ~25% usage if you had a 4-core CPU.
Originally Posted by vagfilm
I believe it's because of the non CPU-optimized python MIDI libraries that I use, or the way python uses thread processes (or, most probably, because I am a crappy amateur programmer). I am sure that in C++ it would perform better, but this was a created just for the fun, and it turned out really ok, and in record time and I will not move it to another language (and the CPU usage does not affect my VST performance, although it causes a bit more fan activity in the laptop).
Thank you for the app! This is independent of the programming language you are using. You need to suspend the app, otherwise if you keep the active waiting the app will always use 100% of CPU. An option is that you suspend app with a time.sleep() function. The MIDI transfer rate is 31.25 Kbit/s, roughly 4 Kbyte/s. So, instead of processing one MIDI event at the time I would do the following:
for event in midi_events <- multiple events can be received while suspended
process each event
You will need to find out for how long you can suspend (sleep) the app without starting to lose data. As said above, you will receive at most 4KB worth of MIDI events per second. You need to check what is the maximum size of the buffer of the MIDI library you are using. I have used MIDI libraries (non in Python) that can easily buffer several KBs of MIDI data. Check the documentation or code of the library you are using. But you will most certainly be able to suspend the app at least for 100-200 ms each time. This will reduce the CPU usage to near zero. Keep on the good work!
Sforzando is a player for soundfont and .sf2 samples, AFAIK quite similar to the garritan player. Same behaviour for pianoteq. For testing i had an Irig37pro is connected via USB, it shows up in the player and in autosavemidi as the only option. There is no ASIO driver because audio is routed to a soundcraft mixer.
Whatever it is, in my configuration the MIDI routing needs help. Running loopmidi and now midiox solved the problem.
Many thanks to vagfilm for providing and HZPiano for help running this nifty tool!
(And of course a feature request: How about a click-open for the storage folder?)
@MacMacMac, If your MIDI comes in through the DIN-MIDI on your PreSonus interface, I reckon things indeed work neater than the automatic Windows ports. PreSonus may use proprietary drivers for that instead of leaving it to Windows.
@vagfilm, It might be that the current Windows 10 has a better MIDI implementation. My single-client limitations were found on Windows 7 Pro, and were solved using the virtual port routing. Not sforzando-related.
Cheers and happy developing,
PS Still curious about the playback question I asked earlier. Cheers!