Previous topicNext topic

MIDI clock from audio

Questions, comments, feedback, etc.
Post Reply
Tsunoo
Posts: 27
Joined: Sun Oct 04, 2015 10:11 am
Location: Paris, France

MIDI clock from audio

Post by Tsunoo »

Hello to all,

For a long time, I tried to find a software which could compute the BPM of an audio file or stream and send a MIDI clock beat to MMV. The only program I found (thanks to users on this forum) is WaveClock. But it only works on Mac. So, I designed my own software, which runs on Windows.

It is very simple for the moment but can do the following :
- open an audio file (MP3 format for now, more in the future)
- "listen" to live audio
- compute the BPM (allow a few seconds on live streams to compute)
- send a MIDI clock signal to the selected MIDI device
- show a few "eye candy" information

There are no more options for the moment (no playlists, no "real" mediaplayer,...). You can only resync the MIDI clock if it gets confused and reset the BPM counter if it gets too far away from the *real* BPM.

The audio part is based on bass.dll (www.un4seen.com).

You may download the software here.

Do not hesitate to post your feedback here.
blackdot
Posts: 528
Joined: Sun Jul 06, 2014 10:18 pm

Re: MIDI clock from audio

Post by blackdot »

wow thats pretty amazing, i'll try it as soon as i get home. does it also listen to mic input?

btw. i'm a windows user and have waveclock. at some point they took the win version off the website, but i'm sure you could send them a mail and ask if you could still get it.

to be honest their communication leaves much to be desired, but their product is rock solid.


buut, i'm looking forward to try yours. :3
Tsunoo
Posts: 27
Joined: Sun Oct 04, 2015 10:11 am
Location: Paris, France

Re: MIDI clock from audio

Post by Tsunoo »

blackdot wrote:does it also listen to mic input?
I only tested with the "Stereo mix" (aka "What U hear") turned on. But I guess any input device should work...
Sadler
Posts: 1157
Joined: Sat Aug 02, 2014 7:10 pm
Location: London, UK

Re: MIDI clock from audio

Post by Sadler »

Nice app - thanks for making it available. Reads audio from Virtual Audio Cable no problem through live button so no need for queuing tracks. The MIDI is not working so well for me. The beat square next to the BPM indicator seems to be ticking close to the music and the module auto-learns the clock but the beat clock doesn't get through very often - maybe every 16th or fewer beats.

I'm routing MIDI through loopMIDI and MIDI-OX to 64bit Magic. Other clocks get through no problem.
blackdot
Posts: 528
Joined: Sun Jul 06, 2014 10:18 pm

Re: MIDI clock from audio

Post by blackdot »

hey

i tried it. unfortunately no beat(clock) is received in magic. i'm using LoopBe as internal midi port. If i switch from beatclock to clock BPM in magic, it seems to be able to create a value.

got an error window:
Capture.JPG
Capture.JPG (12.32 KiB) Viewed 30237 times
and here's how the gui looks:
Capture2.JPG
Capture2.JPG (29.99 KiB) Viewed 30237 times
the blue stuff bottom left is way too dark. the white square(ish) thing that blinks, is only visible sometimes after a reset or stop/live.

running win7 here :).
Tsunoo
Posts: 27
Joined: Sun Oct 04, 2015 10:11 am
Location: Paris, France

Re: MIDI clock from audio

Post by Tsunoo »

the beat clock doesn't get through very often
I am using LoopBe. I did only a few tests with both files and live music and the MIDI clock was in sync. But the code is still not perfect and perhaps depends on the PC's speed... In MMV, I am mostly using Beat clock and Beat clock / 4 and I get sync. I will conduct further tests.
the blue stuff bottom left is way too dark
It looks like your levels are too low so the sound that is analyzed is too low.
the white square(ish) thing that blinks, is only visible sometimes after a reset or stop/live
The square is supposed to blink in sync with the BPM.

Please review the attached screenshot to check how it should look.
Attachments
screenshot.jpg
screenshot.jpg (76.06 KiB) Viewed 30235 times
blackdot
Posts: 528
Joined: Sun Jul 06, 2014 10:18 pm

Re: MIDI clock from audio

Post by blackdot »

ah, my mistake. i had both mic and stereomix active as recording devices. in my case it took the mic input (but i hadent plugged in anything), so that's why the eye candy was so low and dark. upon deactivating the mic in, it worked.

however if you deactivate the mic input, while ZePlayer is running this happens:
Capture.JPG
Capture.JPG (98.14 KiB) Viewed 30219 times
:)

anyway I got it working, but it seems the values received are different, than what I'm used to. and also the regular beatclock, that isnt stretched over multiple beats, doesn't seem to be working. Made a quick screen recording:

ZePlayer's values, vs. the beatclock how I know it (at 00:36)

but maybe that's by design?
Tsunoo
Posts: 27
Joined: Sun Oct 04, 2015 10:11 am
Location: Paris, France

Re: MIDI clock from audio

Post by Tsunoo »

I updated the software: corrected a few bugs and added a few options.
Tsunoo
Posts: 27
Joined: Sun Oct 04, 2015 10:11 am
Location: Paris, France

Re: MIDI clock from audio

Post by Tsunoo »

it seems the values received are different, than what I'm used to. and also the regular beatclock, that isnt stretched over multiple beats, doesn't seem to be working
I actually have a lot of problems to send the MIDI clock signal 24 times on every beat: I cannot create a precise timer to do this. So I cheated: I send 24 pulses at once, on every beat... On a 120 BPM tempo, I send 24 pulses, then wait 0.5 sec, then send again 24 pulses, then wait 0.5 sec... I guess this is the reason why you don't get the MIDI clock beat right. My goal was to get a sync on every beat, which seems to work on my side.

Thank you for your feedback, it really helps me correcting bugs and improve the program :)
Sadler
Posts: 1157
Joined: Sat Aug 02, 2014 7:10 pm
Location: London, UK

Re: MIDI clock from audio

Post by Sadler »

Further info: It sends the clock if I set the midi feature to Beat Clock / 2 (3 and 4)
carldickson
Posts: 2
Joined: Wed Nov 15, 2017 12:18 am

Re: MIDI clock from audio

Post by carldickson »

Hi,

This is really cool, ive been using wave clock but this keeps the beat much tighter an doesn't drift.

Big thumbs up!!!

Im actually using it for a LED lighting display to keep it in time to the DJ.

Thanks
weatherje
Posts: 1
Joined: Wed Dec 13, 2017 1:02 pm

Re: MIDI clock from audio

Post by weatherje »

Hello,

Great that you are developing an alternative to Waveclock!

1) I just tried it with Wine under macOS and have the problem that a change in the BPM rate (when the next song starts) is recognized only after around 30 seconds. This is a bit too late for a live setup. Any ideas how to fix that? I'll try under Windows later.

2) Would you send me the source code via PM? That would be nice. Maybe I would try to develop a Mac version, since the libs are available for Mac too. Which program language did you use?

Cheers from Germany
Grimlinger
Posts: 1
Joined: Thu May 31, 2018 7:47 am

Re: MIDI clock from audio

Post by Grimlinger »

What a wonderful project ! I've had a waveclock windows beta with a (still valid) license but their licence server has suddenly stopped working for me and emails bounce back while i used to have some contact with them , so really looking for an alternative , fingers crossed here !

The app itself seems to run smooth on my win10 x64 , i can get it into loopmidi , data is transmitted.
Tried it with some various styles of psytrance , it was very accurate even.

I want to use this software with magic & resolume , so far only tried in resolume 6.
Here i do see the data through loopmidi come in , buuuut it isn't working as a midi clock :/
I see the bpm of resolume shoot from 20 to 500 , while Zeplayer is at perfect 145,97

I so hope this works out
steffey
Posts: 24
Joined: Fri Feb 09, 2018 4:04 am

Re: MIDI clock from audio

Post by steffey »

I just picked up AudioBoxBaby the other day. Freeware.
https://www.bigfug.com/software/audiobox/

It is the only one I've used so, It works better than nothing, that is all I know. :)
Seems a bit loose sometimes. It does not have a 'stop on silence' attribute, so the bpm keeps going during silence.
AudioBoxBaby-Preview.png
AudioBoxBaby-Preview.png (12.13 KiB) Viewed 29461 times
It's Midi is controlling the Donald clip's shot, >loosely<. I may not have had the volume levels up high enough on that run though....



I'd missed the ZEPlayer I'll go play!
carldickson
Posts: 2
Joined: Wed Nov 15, 2017 12:18 am

Re: MIDI clock from audio

Post by carldickson »

Hi Tsunoo,

I was wondering if you were going to do any further dev on this app? If not would you consider releasing the code so we can do some further work on it?

Thanks
louistypething
Posts: 1
Joined: Mon Feb 18, 2019 3:35 pm

Re: MIDI clock from audio

Post by louistypething »

Since I haven't been able to find a cross platform open source version of this incredibly useful tool I decided to try and build my own.

https://github.com/louischaman/PyBeatSync

It uses python 2.7 and a state of the art audio and music analysis library madmom.

If anyone would be interested in helping me develop it to make it more robust and faster I'd appreciate any input.

I feel like a tool such as this could be very useful to a lot of people wanting to sync visuals, DAWs or physical synths with a mediaplayer or DJ.
jonnyboy501
Posts: 1
Joined: Tue Jun 06, 2023 6:08 pm
Location: Switzerland

Re: MIDI clock from audio

Post by jonnyboy501 »

Hi Tsunoo
First off, I'm pretty late to the party, but anyway.
Thanks a LOT for this piece of software!! I've been dreaming about something like that for what feels forever.
However, I've sadly run into an issue when connecting it to SoundSwitch (a S2L Software)
The Software detects each pulse from the detector as plenty of pulses and "rotates" my Light show multiple times each pulse (it moves forward more than 4 beats per beat).
Do you have any idea why that might be, or what I'm doing wrong?

Note:
I'm looping the Audio to the detector and its Midi signal to the s2l virtually inside my computer as a test setup.

Thanks
Post Reply