Send Time Signature (not tempo or clock) via MIDI from DAW

For anything relating to music-making on Windows computers, with lots of FAQs. Moderated by Martin Walker.

Moderator: Moderators

Send Time Signature (not tempo or clock) via MIDI from DAW

Post by Temp »

Hi Folks,

I've been building a MIDI-controlled visual metronome so a musician friend with profound hearing loss can continue playing and recording. I'm using an Arduino, which lights up a series of 8 LEDs (so for 4/4 time it lights green, red, red, red). So far so good - the device is picked up in Cubase and the timing is rock solid. I've incorporated a rotary encoder so I can change the time signature to whatever is set in Cubase (or any other DAW).

However, I'd like to do away with the rotary encoder as I haven't coded it for all possible time signatures, and it would be great if it could automatically lock into the more obscure ones. I've also started building a WiFi protoype (using rtpMIDI/Bonjour, which also works well), but again, I'd like to streamline the hardware and omit the rotary encoder so it's truly plug 'n' play.

My question is whether it's possible to transmit time signatures over MIDI (from DAW => Device). I've pored over the MIDI spec and there's scant reference to it, aside from sending a realtime SYSEX for 'Notation Information'. I'm not sure how I would implement this, or indeed, whether Cubase even sends out this stuff. I see you can add a Time Signature type track in Cubase, but that's all the pieces I have to this puzzle so far.

Thanks in advance.
User avatar
Temp
Regular
Posts: 231 Joined: Mon Apr 25, 2005 12:00 am Location: Medway, UK

Re: Send Time Signature (not tempo or clock) via MIDI from DAW

Post by The Elf »

To a great extent you're describing the Arduino-based device that I myself designed and built during lockdown!
Image
I don't know of any way to transmit time signature information over MIDI, but Cubase will allow you to transmit different note messages for bar start and clicks within the bar, which means your device wouldn't really need to know.
User avatar
The Elf
Jedi Poster
Posts: 19940 Joined: Tue Aug 14, 2001 12:00 am Location: Sheffield, UK
An Eagle for an Emperor, A Kestrel for a Knave.

Re: Send Time Signature (not tempo or clock) via MIDI from DAW

Post by Temp »

Ha! As you can see, yours is somewhat more complete than my prototype (and probably more logical).

Image

I'm not sure I follow your meaning on how to determine the time signature from bar start and clicks. For example, if Cubase is set to 6/8 and my device is set to 4/4, the LEDs loop round and light the green one (bar start) at the wrong count. My rotary encoder changes a numerator/denominator and applies it the number of MIDI ticks to work out which measure of the bar its on.

If you've got a more effective method that can detect the time signature, I'd love to give it a try :thumbup:

Cheers.
User avatar
Temp
Regular
Posts: 231 Joined: Mon Apr 25, 2005 12:00 am Location: Medway, UK

Re: Send Time Signature (not tempo or clock) via MIDI from DAW

Post by BillB »

Inspired by Elfs ' different note messages for bar start', could you not use a note-on message, sent to the device's port/channel, to reset the start of the count, rather than the encoder? There are only so many useable time signatures and templates could be set up for each one, with the 'note bar markers' in place before starting recording. That would also potentially allow for mixed time signatures if required.

Just another thought - exciting and challenging as the Arduino approach is, is there any suitable metronome VST that could do the same job, assuming that your friend has sight of the screen during performance?
BillB
Frequent Poster
Posts: 1903 Joined: Mon Apr 07, 2003 12:00 am Location: East Yorkshire

Re: Send Time Signature (not tempo or clock) via MIDI from DAW

Post by Temp »

BillB wrote: Thu Jan 27, 2022 2:18 pm...could you not use a note-on message, sent to the device's port/channel, to reset the start of the count, rather than the encoder?

This would mean adding a dedicated note-on for every bar, which would become quite laborious; I was really after a plug 'n' play solution that didn't require adding any additional notes, workarounds etc. I'm sure there must a way to achieve it without the encoder, I just haven't found it yet! I must admit the relationship between Song Position Pointer, MIDI ticks, and PPQ etc. are all starting to melt my brain! :wtf:

Cheers.
User avatar
Temp
Regular
Posts: 231 Joined: Mon Apr 25, 2005 12:00 am Location: Medway, UK

Re: Send Time Signature (not tempo or clock) via MIDI from DAW

Post by The Elf »

My lights don't loop around sequentially - at least not automatically. Each light responds to a different MIDI note or controller number, so my device doesn't need to know what time signature it is counting - it simply blinks one light on beat one and a different light on other beats.
User avatar
The Elf
Jedi Poster
Posts: 19940 Joined: Tue Aug 14, 2001 12:00 am Location: Sheffield, UK
An Eagle for an Emperor, A Kestrel for a Knave.

Re: Send Time Signature (not tempo or clock) via MIDI from DAW

Post by BillB »

I get that it is nice to find a programmatic approach, but MIDI may not provide the messages you need.

I don't know Cubase, but can you not make a 1-bar loop (say for 3/4: note on, rest, rest) and drag it out across the extent of the song, save as template, repeat for other time signatures. About an hour's work I would think. Or as Elf originally suggested 'Cubase will allow you to transmit different note messages for bar start and clicks within the bar'.
BillB
Frequent Poster
Posts: 1903 Joined: Mon Apr 07, 2003 12:00 am Location: East Yorkshire

Re: Send Time Signature (not tempo or clock) via MIDI from DAW

Post by Eddy Deegan »

Temp wrote: Thu Jan 27, 2022 2:51 pm
BillB wrote: Thu Jan 27, 2022 2:18 pm...could you not use a note-on message, sent to the device's port/channel, to reset the start of the count, rather than the encoder?

This would mean adding a dedicated note-on for every bar, which would become quite laborious; I was really after a plug 'n' play solution that didn't require adding any additional notes, workarounds etc.

MIDI Clock is just a stream of regularly timed messages to convey tempo and nothing else.

MTC is used to send SMPTE-like information, with the time in hours, minutes, seconds and frames rather than actual beats so I don't think that helps.

I don't think SPP can auto-detect time signatures either as my understanding is that it's a one-off message transmitted from the DAW when you start playback that conveys the number of MIDI beats since the start of the song and it's up to the receiving device to decide what that means and take it from there.

I think Elf's suggestion of note-ons is a good one but I understand the desire to minimise overhead. My suggestion (edit: which I think is what Elf was saying anyway!) would be to configure the metronome in the DAW so that it's got a silent audio click but emits the beat as note-ons over MIDI. If you specify a different MIDI note for the first beat of each bar then your device will be able to use that as a trigger to reset back to the first light.

It's a small overhead but once done, you don't have to do anything else and you can easily make a template blank project with those settings in. This also means that changes to the time signature mid-song will work correctly as the DAW will take care of emitting the correct note-on for each beat of the bar regardless of the current time signature.
User avatar
Eddy Deegan
Moderator
Posts: 8737 Joined: Wed Sep 01, 2004 12:00 am Location: Brighton & Hove, UK
Some of my works | The SOS Forum Album projects  

Re: Send Time Signature (not tempo or clock) via MIDI from DAW

Post by The Elf »

Eddy Deegan wrote: Thu Jan 27, 2022 3:23 pmI think Elf's suggestion of note-ons is a good one but I understand the desire to minimise overhead. My suggestion (edit: which I think is what Elf was saying anyway!) would be to configure the metronome in the DAW so that it's got a silent audio click but emits the beat as note-ons over MIDI. If you specify a different MIDI note for the first beat of each bar then your device will be able to use that as a trigger to reset back to the first light.

Yes, that's exactly what I was saying, but it seems I should have been more explicit. The Cubase metronome can be set to issue note messages on each beat, with the first beat being a different note. You could use the receipt of a 'bar' note to reset the light sequence.

TBH I could add this pretty easily to my box too, but with only six lights it would be a bit restrictive, hence my relying on only two.
User avatar
The Elf
Jedi Poster
Posts: 19940 Joined: Tue Aug 14, 2001 12:00 am Location: Sheffield, UK
An Eagle for an Emperor, A Kestrel for a Knave.

Re: Send Time Signature (not tempo or clock) via MIDI from DAW

Post by Temp »

Thanks for your replies folks - much appreciated. I think I've just had a Eureka! moment: I've added both a Time Signature track in Cubase and pencilled in a sysex MIDI event at the same point where the TS changes are. After dissecting the 'Notation Information' section on the page below again, I've managed to construct the correct sysex string to send off to my Arduino.

https://web.archive.org/web/20120212181 ... ch/mtc.htm

Set to 4/4: F0 7F 7F 03 02 03 04 02 18 08 F7
Set to 3/4: F0 7F 7F 03 02 03 03 02 18 08 F7
Set to 6/8: F0 7F 7F 03 02 04 06 03 18 08 F7

Although it isn't quite as out-of-the box as I'd like, it does mean the TS can be calculated programmatically on my device and I can finally dump the rotary encoder.
User avatar
Temp
Regular
Posts: 231 Joined: Mon Apr 25, 2005 12:00 am Location: Medway, UK

Re: Send Time Signature (not tempo or clock) via MIDI from DAW

Post by The Elf »

7/8?
User avatar
The Elf
Jedi Poster
Posts: 19940 Joined: Tue Aug 14, 2001 12:00 am Location: Sheffield, UK
An Eagle for an Emperor, A Kestrel for a Knave.

Re: Send Time Signature (not tempo or clock) via MIDI from DAW

Post by BillB »

Thanks @Temp, that's a slightly complicated but useful reference (which I have now printed to PDF for posterity).

Looks like any time signature can be accommodated.
Proggers rejoice :bouncy:
BillB
Frequent Poster
Posts: 1903 Joined: Mon Apr 07, 2003 12:00 am Location: East Yorkshire
Post Reply