fbpx
Skip to main content

MIDI Forum

Midi real time mess...
 
Notifications
Clear all

Midi real time message

12 Posts
4 Users
0 Reactions
16.9 K Views
Florent
Posts: 4
Active Member
Topic starter
 

Hello,

Sorry for my bad english. I'm french.

I use midi to creazte music but mostly to control my fx rig.
I use a player to play my samples on live. This player send midi PC and CC to change my preset or parameters.
Unfortunaly it can't send midi clock.

I find a product that can change a midi CC into a F8 message (midi solutions even processor).

My questions are :

Can we write real time message into a midi file?

Do you think if i create a midi file with 24 message per quater and if i transform this message into a f8 i can emulate a midi clock?

If you think it can be possible. How can i make 24 messages per quarter because in my soft a quarter is 1.00 and 100/24=4.66666666666666

I hope you can help me.

Thanks

 
Posted : 13/01/2019 9:22 am
Bavi_H
Posts: 267
Reputable Member
 

>Can we write real time message into a midi file?

The specification for Standard MIDI Files includes a way to store a real-time message in a MIDI file -- you have to use a "sysex continuation event". However, I don't know how likely it is that MIDI file players will correctly interpret and send a real-time message stored this way.

For example, to store a MIDI clock message in a MIDI file, you have to create a "sysex continuation event" and store a single F8 byte inside of it. In theory, when the MIDI player sends this message, it just sends whatever bytes are inside the sysex continuation event, even if it's not really part of a sysex message.

In the thread Can MIDI beat clock be "printed" onto a SMF? I posted a test MIDI file that contains four measures of MIDI clocks at 95 beats per minute. You can try playing that MIDI file in your MIDI player and see if the receiving device is getting MIDI clock messages.

>How can i make 24 messages per quarter because in my soft a quarter is 1.00 and 100/24=4.66666666666666

What software are you using? I believe most MIDI sequencers will have a time resolution that is some multiple of 24 ticks per quarter note. (For example, 120, 240, 960, or so on.)

Be aware that MIDI sequencers often display time values in measure:beat:tick format, so if the resolution is 120 ticks per quarter note, the possible time values go from 1:1:000 to 1:1:119, then 1:2:000 to 1:2:119, and so on. The time values 1:1:120 to 1:1:999 would be impossible.

 
Posted : 13/01/2019 1:08 pm
Florent
Posts: 4
Active Member
Topic starter
 

Thank you for your answer

>Can we write real time message into a midi file?

In the thread Can MIDI beat clock be "printed" onto a SMF? I posted a test MIDI file that contains four measures of MIDI clocks at 95 beats per minute. You can try playing that MIDI file in your MIDI player and see if the receiving device is getting MIDI clock messages.

I use a cymatic lp16. I will try but I don't think it will be work because some people have search a solution about this problem, even the manufacteur.

What software are you using? I believe most MIDI sequencers will have a time resolution that is some multiple of 24 ticks per quarter note. (For example, 120, 240, 960, or so on.)

Be aware that MIDI sequencers often display time values in measure:beat:tick format, so if the resolution is 120 ticks per quarter note, the possible time values go from 1:1:000 to 1:1:119, then 1:2:000 to 1:2:119, and so on. The time values 1:1:120 to 1:1:999 would be impossible.

I use reaper. Thank you very much I found it!!! Now i have 24 CC message per quarter!

And what do you think about my idea to send midi CC and that the midi solutions even processor transform this CC into a F8 message?

 
Posted : 14/01/2019 12:08 am
Bavi_H
Posts: 267
Reputable Member
 

I use a cymatic lp16. I will try but I don't think it will be work because some people have search a solution about this problem, even the manufacteur.

As you can see in the other thread, the poster there was using another Cymatic device (Cymatic uTrack 24), but they never replied if the test MIDI file was able to generate MIDI clock messages or not. I'm interested to know if you get it working or not. (I'm curious to learn what MIDI players can or can't send the "clock message in a sysex continuation event".)

I use reaper. Thank you very much I found it!!! Now i have 24 CC message per quarter!

Great! I saw your post originally said you found a measure:beat:tick display and were trying it out. I guess you got it working and you edited your message.

By the way, I found a Reaper manual PDF file. In the manual, I found the settings page where you can change the MIDI ticks per quarter note resolution (see PDF page 442), and it says the default is 960 ticks per quarter note. So I guess you are putting a message every 40 ticks.

And what do you think about my idea to send midi CC and that the midi solutions even processor transform this CC into a F8 message?

It sounds like a good idea, if you are certain you can generate a MIDI file with 24 events per quarter note. However, be aware that I mainly edit and play with MIDI files on my computer. I do not use MIDI devices in a live performance situation. I have played around with the free MIDI Solutions Programming Tools to explore what is possible with their devices, but I have never used their hardware products myself.

 
Posted : 14/01/2019 11:58 pm
Florent
Posts: 4
Active Member
Topic starter
 

As you can see in the other thread, the poster there was using another Cymatic device (Cymatic uTrack 24), but they never replied if the test MIDI file was able to generate MIDI clock messages or not. I'm interested to know if you get it working or not. (I'm curious to learn what MIDI players can or can't send the "clock message in a sysex continuation event".)
.

Hello Bavi-H,

Your file work with my lp16! it don't work with all my fx but the player can send it. when i make a capture off the sending messages with bome send sx, I have F7 F8 F7 F8 F7 F8. Perhaps it's why it doesn't work with some of my units. Anyway it work with my principal unit.
Can you explain to me how can I make this type of file?
And how i can use this file because when I import this file into reaper it doesn't work. So i can't add my message pc and cc to the midi file...

Thank you very much fo your advices!!!

 
Posted : 16/01/2019 12:14 pm
Bavi_H
Posts: 267
Reputable Member
 

I may be busy at work this week, but to start with, here are some initial notes about how I made the file. It's kind of a complex process, so I might need to follow up later with a more detailed description, or see if I can find an easier method. (If anyone else can think other ways to make this kind of MIDI file with embedded clock messages, feel free to post your ideas.)

[UPDATE 2021-03-23: I created a Clock MIDI file generator that is easier than the manual method described below.]

If you have a MIDI sequencer with an event list that can insert the "sysex continuation event" type, you can create this kind of file. However, the difficult part is making the large number of events exactly spaced at 24 per quarter note. It would be tedious to manually type in the position numbers for every event. It might be possible to copy and paste the events, but I didn't try that yet. (I thought if I wasn't careful how I pasted, the position of the events might not stay properly aligned.) The method I came up with involved converting the MIDI data into a text format called MIDICSV, and using a spreadsheet to help me quickly create a sequence of incrementing numbers.

Here are the programs I used:

Sekaiju, a free Windows MIDI sequencer that lets you insert "sysex continuation events" into the MIDI file data, and can export and import MIDICSV files.

A text editor that can handle lines that end with LF (linefeed), so you can edit the MIDICSV file as text. I used Notepad++.

Spreadsheet software to help you create a lot of text lines with regularly incrementing numbers. I used LibreOffice Calc, but since the spreadsheet formulas I used are very basic, I think they would work in any other spreadsheet software like Excel or Google Sheets.

Here is basic description of the steps I used:

In Sekaiju, create a MIDI file with an event of type "SysEx(Arbitrary)" at time position "1:1:000" with the value "F8".
Save the file as a MIDICSV file and close Sekaiju.

Open the MIDICSV file in Notepad++ and find the line of text that contains the words "System_exclusive_packet":
1, 0, System_exclusive_packet, 1, 248

The 0 in this line is the position of the event in ticks. Because Sekaiju defaults to 120 ticks per quarter note and we want to create 24 events per quarter note, we want to create these events every 5 ticks.

In a blank spreadsheet, make column A contain a column of numbers that starts at 0 and increments by 5.

In cell B1, create a formula that will return a line of text and use the number from column A as part of the text:
="1, "&A1&", System_exclusive_packet, 1, 248"

Copy cell B1, select the cells in column B down to the last row needed and paste the copied formula back in.

Copy all the column B cells that have the text values.

Back in Notepad++, paste the text you just copied back into the MIDICSV file replacing the one original "System_exclusive_packet" line with all the lines you copied from the spreadsheet.

The line that contains the text "End_track" needs to have its tick position adjusted to be the same or greater than the tick position of the last "System_exclusive_packet" line you pasted in.

Save the MIDICSV file and close Notepad++

Restart Sekaiju and open the MIDICSV file.
Change the tempo event at the beginning to set it for the tempo you want.
If you want to change the tempo in the middle, add other tempo events at other positions.
Now you can save the file as a Standard MIDI file.

 
Posted : 16/01/2019 11:04 pm
Florent
Posts: 4
Active Member
Topic starter
 

Ok thank you very much!

I will work your method it's very interesting!

Perhaps i've bought a midi solution processor next months so i will tell you if my idea work fine. It would be more easier to do.

 
Posted : 17/01/2019 4:16 am
jose
 jose
Posts: 1
New Member
 

Hi Florent

I recently bought the LP16 and I have exactly the same problem.

Now I'm trying to edit the midi clock file sent by Bavi_H in Reaper in order to change bpm and duration but I don't really know how to get this real time messages edited. Could you explain the steps you followed?

Thank you!

And thank you too Bavi_H, your explanation helped me to get things more clear

 
Posted : 29/10/2019 3:43 am
Jonas
Posts: 207
Reputable Member
 

Excuse me i am totally lost, with what is the midiclock and it's use, i get note messages and cc messages but what is midi clock messages. Is it the actual time format represented within a midifile we are talking about?

Midi music and their messages just intervals, between notes and controller messages?

I wrote a sequenser that sends notes and control changes, it has a clock, but the cc and note messages just use intervals "from the javascript clock" i have not stored them yet. But i was thinking just save the message stream with its clock values, so that will not comply with any midiformat.

But what is the use of the midiclock? I create the metronome as a recorded track 0, playing a chosen note?
And that is just intervals calculated using BPM and the notevalue?

Isn't that all a midiclock is?
https://midisequenser.000webhostapp.com/

i do not seek to conform my sequenser to midistandard, but i will *try* make an import function or use a already made import library. So i guess i have to learn what the actual midiclock is to make that happen. I just was thinking a message stream with intervals.

 
Posted : 29/10/2019 2:56 pm
Bavi_H
Posts: 267
Reputable Member
 

WHAT IS MIDI CLOCK?

Imagine you have two MIDI devices, one that you want to play prerecorded melody notes and another that can play an internal drum pattern. You want both devices to start and stop playing together, and if the tempo of the melody changes, you want the tempo of the drum pattern to change correctly at the same time.

To do this, you connect a MIDI cable between the MIDI OUT port on your melody device and the MIDI IN port on your drum device. You set your melody device to send MIDI Clock, Start, and Stop messages on its MIDI OUT port. You set your drum device to obey the MIDI Clock, Start, and Stop messages it receives on its MIDI IN port.

In particular, the MIDI Clock message is a one-byte message (hex F8) that, when used, is sent 24 times per quarter note. A MIDI device listening for MIDI Clock messages will adjust its own tempo based on the time between MIDI Clock messages that it sees coming in.

MIDI SEQUENCERS AND MIDI CLOCK

If you are developing a MIDI sequencer, you don't want to record incoming MIDI Clock messages into a MIDI file. But you might eventually consider having advanced options in your sequencer to:

Listen for incoming MIDI Start, Stop, and Clock messages and have your sequencer automatically start, stop, and change tempo, so that it can be remote controlled by another MIDI device.

Generate and send outgoing MIDI Start, Stop, and Clock messages, so that your sequencer can control the playback and tempo of another MIDI device.

If you want to support the really esoteric ability to store arbitrary bytes in a MIDI file (including a MIDI Clock message or anything else) so that they can be sent to the MIDI output port when the file is played, be sure to support the F7 MIDI file message mentioned later, and let users put anything they want to inside of it.

MIDI CABLE MESSAGES AND MIDI FILE MESSAGES

Be aware there are some differences between MIDI messages on a MIDI cable and the messages you encounter in a MIDI file.

For example, on a MIDI cable, the System Real-Time messages can occur between the bytes of other messages. In a MIDI file, they can't.

In fact, on a MIDI cable, the System Common and System Real-Time messages with status bytes of hex F1 to F6 and F8 to FF aren't very useful to store in a MIDI file. When you are expecting a status byte in a MIDI file, some of these bytes are redefined to have a new meaning.

On a MIDI cable, the status byte FF means Reset. But when you are expecting a status byte in a MIDI file, FF is used to mark the beginning of a Meta Event.

On a MIDI cable, the status byte of F7 is used to mark the end of a System Exclusive message. In a MIDI file, the "status byte" of F7 is used to mark the beginning of a message that either contains a partial System Exclusive message that started in a previous message, or contains any other bytes you want to be sent on the MIDI OUT port when the file is played.

WHY WOULD YOU WANT TO STORE A MIDI CLOCK MESSAGE IN A MIDI FILE?

It's usually not useful to store MIDI Clock messages in a MIDI file. However, according to the Standard MIDI File specification, there is a way to store a MIDI Clock message in a MIDI file if you really want to. You have to use the F7 MIDI file message mentioned previously.

Some people who have a Cymatic device want it to play something and also send MIDI Clock messages to some other MIDI device so that the other MIDI device will use the same tempos. Evidently, the Cymatic device doesn't provide an option to generate and send the MIDI Clock messages on its own, but it will send them if they are stored in a MIDI file. I don't know if this works well enough to actually be useful, but it is at least technically possible.

SPECIFICATIONS

If you want to read the official specifications just for your reference, go to the following page on this website: Specs -> The MIDI 1.0 Specification -> The Complete MIDI 1.0 Detailed Specification. As described on that page, the main specifications up to 1996 are in the PDF download link "Download the Complete MIDI 1.0 Detailed Specification Document (1996)".

Inside that PDF file, the section about the "MIDI 1.0 Detailed Specification" is the main section about MIDI messages that you encounter on MIDI cables. PDF page 62 is where the Clock message is described. Surrounding that, in PDF pages 59 to 64 you can also read about the Start, Stop, Continue, Song Select, and Song Position Pointer messages, with examples of how they relate to Clock messages.

Inside that PDF file, the section "Standard MIDI Files" describes the messages you can encounter in MIDI files. PDF pages 135 and 136 describe the F7 MIDI file message.

 
Posted : 29/10/2019 10:04 pm
Jonas
Posts: 207
Reputable Member
 

Ok, i think i get the use it is basicly about syncing, another sequenser like a drummachine that has its own recorded notes on it.
Although i am a bit hesitant to why you would want that, would it not just be better to have a track in the computer sequenser "or hardware sequenser" holding it and just send the messages.

But i get it many people lay their drumpatterns on their machines sequenser, and its a bit of hazzle to get it over to other device sequenser to they remote it instead?

I now remember doing something similar starting stopping Cooledit using the drummachine, although it may not been midi time code but smpte..I am a bit out of date with midigear.

But i think i just would record the drummachines sequenced track to a track in the main sequenser, "but now i see the problem, howto guarantee they are in synch".
But could you now just export the drummachine pattern like a sysex midifile? And then let the other device sequenser read it in.

 
Posted : 30/10/2019 12:18 am
Bavi_H
Posts: 267
Reputable Member
 

UPDATE 2021-03-23: I created a Clock MIDI file generator.

 
Posted : 23/03/2021 6:48 am
Share: