2017 was our 20th year online!

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 free)
It's Fun to Play the Piano ... Please Pass It On!

Shop our online store for music lovers
SEARCH
Piano Forums & Piano World
(ad) SWEETWATER Cyber Week Deals
(ad)
Best of Piano Buyer
 Best of Piano Buyer
(ad)
Faust Harrison Pianos
Faust Harrison 100+ Steinway pianos
(ad)
Wessell Nickel & Gross
PianoForAll
Who's Online Now
38 members (David B, eddiepiano, astrotoy, deadlymajesty, DPC, Flygbladet, FrankCox, Alex C, 8 invisible), 521 guests, and 436 robots.
Key: Admin, Global Mod, Mod
(ad)
Estonia Pianos
Estonia Pianos
Previous Thread
Next Thread
Print Thread
Hop To
Page 3 of 4 1 2 3 4
Joined: Feb 2021
Posts: 1,015
H
1000 Post Club Member
Offline
1000 Post Club Member
H
Joined: Feb 2021
Posts: 1,015
Originally Posted by Rhodes74
Running loopmidi and now midiox solved the problem.

-Rhodes74

Lovely! I hope that is a useful result for @vagfilm as well.

Cheers and happy nifty tooling,

HZ

Joined: Jun 2020
Posts: 489
V
vagfilm Offline OP
Full Member
OP Offline
Full Member
V
Joined: Jun 2020
Posts: 489
Originally Posted by Rhodes74
For testing i had an Irig37pro is connected via USB, it shows up in the player and in autosavemidi as the only option.
Running loopmidi and now midiox solved the problem.
So it is working now... Good to hear... There is a workaround if necessary. Glad HZPiano was able to help.

Originally Posted by Rhodes74
And of course a feature request: How about a click-open for the storage folder?

I could add that (in fact if you click on the option for setting up the folder, it will open windows explorer. Currently, it will open in the program folder instead of the recordings folder - something to change to version 1.02), but it will clutter the UI and could lead to users messing up the recording folder location because they can by mistake point the recordings to 2 different folders... Don't you prefer to simply create a shortcut on the desktop to the recordings folder? wink

Joined: Feb 2021
Posts: 1,015
H
1000 Post Club Member
Offline
1000 Post Club Member
H
Joined: Feb 2021
Posts: 1,015
Hello,

Originally Posted by vagfilm
Originally Posted by HZPiano
PS Still curious about the playback question I asked earlier. Cheers!

I answered that in post #3160579 above

Sorry I missed that, thanks!

I didn't mean for you to integrate a synthesizer into your tool, but a simple (I know, simple is relative here!) way to browse/manage the recorded files (perhaps with some attributes such as the 'stars'/flags that @gombessa suggests). Then, a Play button that sends each MIDI message from a recorded file, timed from its timestamp, to a virtual port that the user's favorite standalone VST (or DAW) listens to; or sent back to the piano if the user wants to use the piano's internal sound generator instead of a VST.

That way, the user gets feedback on her/his playing that is indistinguishable from the original playing (provided the same VST/internal sounds and related settings are used as while recording).

Just tossing ideas, again, thumbs up for the work!

Cheers and happy developing,

HZ

Joined: Jun 2020
Posts: 489
V
vagfilm Offline OP
Full Member
OP Offline
Full Member
V
Joined: Jun 2020
Posts: 489
Originally Posted by acdp
An option is that you suspend app with a time.sleep() function.

Thanks for the suggestion. To be honest, this CPU thing only came up a couple of weeks ago, because I was unaware of it until then. I thought about adding a sleep in the thread loop as you suggest, but was afraid that it would cause a problem in the timestamping of the MIDI messages. MIDI messages are timestamped by the receiver not by the sender.

In addition, the MIDI python library that I use cannot handle multiports (or it may, but I was unable to make it work as intended), so I had to cascade up to 3 threads of single MIDI ports, because some users may need up to 3 midi inputs (keyboard(s), external pedal, CC controller). So, I would need to add a sleep to each thread, that would have different timings depending on the number of active threads. I will start testing it, but currently don't have the free time to do that.

I am biomedical researcher in academia... My programming experience is on data processing (python, matlab) heavy on data crunching and files management, but where UI and realtime processing does not exist (you program, test, hit "run" and collect the output file in a couple of hours). And even that is done nowadays by my PhD students... This was my first venture into the realm of QT5 and UI multithreading. I had a lot of fun that helped maintain my sanity while the lab was half-shut and the students haad their thesis on hold. Depressing times that had profound consequences...

Joined: Sep 2018
Posts: 63
R
Full Member
Offline
Full Member
R
Joined: Sep 2018
Posts: 63
Originally Posted by vagfilm
I could add that (in fact if you click on the option for setting up the folder, it will open windows explorer.

Yes, i found that already and it points to the storage folder, just not opening it in explorer. But i see, i can right-click in the file list to open an independent window. Close to good enough!

Originally Posted by HZPiano
PS Still curious about the playback question I asked earlier. Cheers!

Also close: You can use soundfont midi player connected to sforzando and load the midi files in a playlist.
Fast access and timestamp in the filenames.

-Rhodes74

Joined: Jun 2020
Posts: 489
V
vagfilm Offline OP
Full Member
OP Offline
Full Member
V
Joined: Jun 2020
Posts: 489
Originally Posted by HZPiano
I didn't mean for you to integrate a synthesizer into your tool, but a simple (I know, simple is relative here!) way to browse/manage the recorded files (perhaps with some attributes such as the 'stars'/flags that @gombessa suggests). Then, a Play button that sends each MIDI message from a recorded file, timed from its timestamp, to a virtual port that the user's favorite standalone VST (or DAW) listens to; or sent back to the piano if the user wants to use the piano's internal sound generator instead of a VST.

That way, the user gets feedback on her/his playing that is indistinguishable from the original playing (provided the same VST/internal sounds and related settings are used as while recording).

As I told before, that is not simple, and there are better tools out there that do exactly that. It would be very easy to playback a MIDI file from within AutoSaveMIDI through the VST standalone that is active. But it will only play from the beggining and you cannot do random access with a slider to a different timepoint in the recording. MIDI messages are incremental (so, relative, not absolute) and measured in ticks, not in time. I don't know which message will be played at time 33.0, unless I sum up all messages until I reach 33.0. Thus, before playback I would need to create a table that would have, for each MIDI message, it's calculated absolute timestamp based on the playback speed that was selected. And whenever the user changed the playback speed, the table would need to be updated. I am sure that there are MIDI libraries (in c++) that already have all this implemented, but I am not aware of a simple way to do that in Python.

Bottomline: what you suggested already exists. You can use the free VanBasko midi player, or the paid Synthesia, select in either MidiLoop as the output, make them the default handlers of .mid files, and everytime you click on a midi file, it will launch the player that outputs through the VST. No need to reinvent the wheel.

Last edited by vagfilm; 09/30/21 05:23 AM.
Joined: Jun 2020
Posts: 489
V
vagfilm Offline OP
Full Member
OP Offline
Full Member
V
Joined: Jun 2020
Posts: 489
Well... Rhodes74 just mentioned "soundfont midi player" which I browsed and it seems to be even better than VanBasko (and free as well). Have to install that, although I prefer the convenience of the paid Synthesia.

Joined: Jun 2020
Posts: 489
V
vagfilm Offline OP
Full Member
OP Offline
Full Member
V
Joined: Jun 2020
Posts: 489
Originally Posted by acdp
An option is that you suspend app with a time.sleep() function.

Wow... There is nothing like trying. I put a 1ms sleep() in the main loop that controls the cascade and the CPU usage is now less than 1%... Don't seem to have any dropped notes (I test with an intensive midi file played back at 300 bpm), but will have to run more thorough testing.

Thanks for pushing me to try it. I did not believe it would solve the issue... It was crappy programming afterall smile

Joined: Feb 2021
Posts: 1,015
H
1000 Post Club Member
Offline
1000 Post Club Member
H
Joined: Feb 2021
Posts: 1,015
Hello,

Originally Posted by vagfilm
No need to reinvent the wheel.

All for that! Thank you for your further explanation.

Originally Posted by vagfilm
Well... Rhodes74 just mentioned "soundfont midi player" which I browsed and it seems to be even better than VanBasko (and free as well).

That sounds like a lovely option. Thanks @Rhodes74 and @vagfilm!

Cheers and happy MIDI reflections,

HZ

Joined: Jul 2021
Posts: 28
A
Full Member
Offline
Full Member
A
Joined: Jul 2021
Posts: 28
Originally Posted by vagfilm
Originally Posted by acdp
An option is that you suspend app with a time.sleep() function.

Wow... There is nothing like trying. I put a 1ms sleep() in the main loop that controls the cascade and the CPU usage is now less than 1%... Don't seem to have any dropped notes (I test with an intensive midi file played back at 300 bpm), but will have to run more thorough testing.

Thanks for pushing me to try it. I did not believe it would solve the issue... It was crappy programming afterall smile

Excellent! The MIDI data rate is very low even at the maximum MIDI 1.0 rate. At maximum rate it allows for ~1000 MIDI events/second. So, this limit will not be reached when recording a "normal" human performance, which is the primary use case of your app. Generating such amount of events requires computer generated messages or chaining multiple MIDI devices together. (These limitations, as well as the timing limitations of with MIDI 1, are now greatly improved in the new MIDI 2).

Anyway, your application was most of the time doing nothing but looping around, hence the very high CPU utilization. The same would happen with a similar loop in C++ or Java. Adding a short sleep to the loop allows the operating system to "pre-empt" (suspend) the application drastically reducing CPU utilization. You need to check if the sleep/suspend works correctly with the different threads (it should). As a simpler alternative in a future version of the app, you might be consider scanning the multiple ports sequentially in the in same loop and in a single thread. This would simplify the code and avoid potential issues due to multithreading. Happy coding!

Joined: Jul 2021
Posts: 28
A
Full Member
Offline
Full Member
A
Joined: Jul 2021
Posts: 28
Originally Posted by HZPiano
Hello,

Originally Posted by vagfilm
No need to reinvent the wheel.

All for that! Thank you for your further explanation.

Originally Posted by vagfilm
Well... Rhodes74 just mentioned "soundfont midi player" which I browsed and it seems to be even better than VanBasko (and free as well).

That sounds like a lovely option. Thanks @Rhodes74 and @vagfilm!

Cheers and happy MIDI reflections,


HZ

You might want to a look as well at VirtualMIDISynth . This is not a MIDI player but a MIDI synthesizer that allows installing sample-based sound fonts to render the MIDI files. The FluidR3_GM (available on the the link above) is quite good for general MIDI instruments. You can also add a couple of sound fonts with improved samples for classical music.

Joined: Sep 2009
Posts: 14,439
Yikes! 10000 Post Club Member
Offline
Yikes! 10000 Post Club Member
Joined: Sep 2009
Posts: 14,439
I wonder how VST hosts handle this? Surely they don't poll the MIDI ports!

There must be a way to "hang a read" on a port (some really old terminology there) ...
... and then either block while waiting for MIDI data (perfect for a threaded app) ...
... or instead just register a callback to handle MIDI data when it arrives.

Joined: Jun 2020
Posts: 489
V
vagfilm Offline OP
Full Member
OP Offline
Full Member
V
Joined: Jun 2020
Posts: 489
I am almost sure it is based on c++ callback functions.

Joined: Sep 2019
Posts: 834
500 Post Club Member
Offline
500 Post Club Member
Joined: Sep 2019
Posts: 834
Originally Posted by vagfilm
Originally Posted by acdp
An option is that you suspend app with a time.sleep() function.

Wow... There is nothing like trying. I put a 1ms sleep() in the main loop that controls the cascade and the CPU usage is now less than 1%... Don't seem to have any dropped notes (I test with an intensive midi file played back at 300 bpm), but will have to run more thorough testing.

Thanks for pushing me to try it. I did not believe it would solve the issue... It was crappy programming afterall smile

Please, let us know if you release a new version with that modification implemented. It will help on lesser computers

Thanks!

Jose


Yamaha U3H
Kawai VPC1
...plus some other DPs, synths, controllers and VSTs

[Linked Image]
Joined: Jun 2020
Posts: 489
V
vagfilm Offline OP
Full Member
OP Offline
Full Member
V
Joined: Jun 2020
Posts: 489
I will test over the weekend and update afterwards, and post here.

Joined: Sep 2019
Posts: 834
500 Post Club Member
Offline
500 Post Club Member
Joined: Sep 2019
Posts: 834
Originally Posted by vagfilm
I will test over the weekend and update afterwards, and post here.

Thanks Vasco! thumb


Yamaha U3H
Kawai VPC1
...plus some other DPs, synths, controllers and VSTs

[Linked Image]
Joined: Sep 2009
Posts: 14,439
Yikes! 10000 Post Club Member
Offline
Yikes! 10000 Post Club Member
Joined: Sep 2009
Posts: 14,439
Thanks. Nice work.
Originally Posted by vagfilm
I will test over the weekend and update afterwards, and post here.

Joined: Jun 2020
Posts: 489
V
vagfilm Offline OP
Full Member
OP Offline
Full Member
V
Joined: Jun 2020
Posts: 489
At this moment the app has been downloaded by 20 something users. Apart from the problem reported and solved with a workaround by Rhodes74 (and I am not sure if it also happened with HZPiano...), and the CPU consumption that I may be able to solve, for all the others that have been posting in this thread, the app is running well? No increased latency on VSTs? No dropped notes? Pedalling correctly detected? The ones using onboard piano engines, no problems in midi output to record? No bugs on installation?

All feedback on installation, setting up, and actual performance is appreciated.

BTW, no antiviral complaints during download or installation?

Joined: Feb 2021
Posts: 1,015
H
1000 Post Club Member
Offline
1000 Post Club Member
H
Joined: Feb 2021
Posts: 1,015
Hello,

@vagfilm, I didn't (yet) download your tool. I just read this thread with great interest and was glad to be able to help -- from nothing more than a hunch I got when reading Rhodes74's start-and-crash problem.

Cheers and keep up the good work!

HZ

Joined: Jun 2020
Posts: 489
V
vagfilm Offline OP
Full Member
OP Offline
Full Member
V
Joined: Jun 2020
Posts: 489
Thanks...

Page 3 of 4 1 2 3 4

Moderated by  Piano World 

Link Copied to Clipboard
What's Hot!!
Pianos - Organs - & Keyboards, Oh My!
My first professionally recorded piece
---------------------
Visit Maine, Meet Mr. Piano World
---------------------
Posting Pictures on the Forums
-------------------
Forums RULES & HELP
-------------------
ADVERTISE on Piano World
(ad)
Pianoteq
Steinway Spiro Layering
(ad)
PianoDisc

PianoDisc
(ad)
Piano Life Saver - Dampp Chaser
Dampp Chaser Piano Life Saver
(ad)
Mason & Hamlin Pianos
New Topics - Multiple Forums
Es920 production stopped??
by playplayplay - 12/07/21 12:07 AM
Mehlin & Sons Piano Identification
by LeviWhitted - 12/06/21 08:37 PM
jack position button not present in old grand
by f4tune81 - 12/06/21 08:11 PM
Thinking about recital #65
by stevedoz - 12/06/21 04:28 PM
Download Sheet Music
Virtual Sheet Music - Classical Sheet Music Downloads
Forum Statistics
Forums42
Topics210,420
Posts3,151,113
Members103,539
Most Online15,252
Mar 21st, 2010
Please Support Our Advertisers

Faust Harrison 100+ Steinways

Dampp Chaser Piano Life Saver

 Best of Piano Buyer

PianoTeq Bechstein
Visit our online store for gifts for music lovers

Virtual Sheet Music - Classical Sheet Music Downloads



 
Help keep the forums up and running with a donation, any amount is appreciated!
Or by becoming a Subscribing member! Thank-you.
Donate   Subscribe
 
Our Piano Related Classified Ads
| Dealers | Tuners | Lessons | Movers | Restorations | Pianos For Sale | Sell Your Piano |

Advertise on Piano World
| Subscribe | Piano World | PianoSupplies.com | Advertise on Piano World |
| |Contact | Privacy | Legal | About Us | Site Map | Free Newsletter | MapleStreetMusicShop.com - Our store in Cornish Maine


© copyright 1997 - 2021 Piano World ® all rights reserved
No part of this site may be reproduced without prior written permission
Powered by UBB.threads™ PHP Forum Software 7.7.5