Jump to content

Move precisely playhead with a MIDI message


Holaf

Recommended Posts

Hello,

 

I make LPX learn controller assignments in the keyboard shortcuts window, in order to move step by step the playhead (rewind or forward) by sending particular midi messages (i.e. without interacting with the LPX interface).

 

Now, I would like to move the playhead to a particular time position with a midi message containing this time position (relative or absolute). Of course, I'll have to specify this time value to my system which sends midi messages to LPX. I don't want to specify this value in LPX interface.

 

Is there any way to do that ?

Link to comment
Share on other sites

Thank you.

I was wondering thus if there would be another way to move the LPX playhead at a specific location with a midi message sent by a master device.

I tried MMC messages, which include a "Go to" specific message : I checked the box "Listen to MMC" in the synchronization setting window and I tried to send LPX some MMC messages but LPX did not react at all. Moreover, I read on the LPX manual : "If you want to use the external master’s transport controls, you don’t need to use MMC. In this situation, Logic Pro follows the MTC master as a slave."

 

Should I transmit MTC from my master device to LPX ? If so, how can I do that ? Or is there a simplest way to proceed ?

Link to comment
Share on other sites

I tried MMC messages, which include a "Go to" specific message : I checked the box "Listen to MMC" in the synchronization setting window and I tried to send LPX some MMC messages but LPX did not react at all.

 

Logic Pro X is responding fine to MMC commands here (including the Go to/Locate command).

 

Where are these commands originating from?

 

Click this link to your signature and add your system information:

• Logic version and sub-version (e.g. Logic 10.0.7)

• OS X version and sub-version (e.g. OS 10.9.3)

• Computer (e.g. MacBook, Mac Pro, iMac)

• Processor (e.g. 2 GHz Intel Core 2 Duo)

• Memory (e.g. 2GB)

• Audio interface manufacturer and model (e.g. Presonus AudioBox USB)

• MIDI Controller manufacturer and model (e.g. M-Audio Axiom Pro 49)

 

(most of that information can be found by choosing Logic Pro X > About Logic Pro X, and  > About This Mac)

 

J.

Link to comment
Share on other sites

Indeed, I finally succeeded in sending MMC to LP. It was due to a wrong formatting of my sysex messages.

 

The GoTo MMC command enables me now to move to any frame in the time line by specifying appropriated bytes in my MMC sysex message :

 

F0 7F 06 44 =06 01 F7

 

However, the subframe byte seems to be ignored, which means that I still miss a little precision (I cannot move the playhead between two frames). Is this because LPX ignores subframes in GoTo MMC messages ?

By the way I fin really sad that target time in the GoTo MMC command can only be expressed in SMTPE and not in beats. That would be so much easier !

Link to comment
Share on other sites

However, the subframe byte seems to be ignored, which means that I still miss a little precision (I cannot move the playhead between two frames). Is this because LPX ignores subframes in GoTo MMC messages ?

 

I get the same thing here, but apparently there are two types of subframe data that can be defined/used:

 

Two forms of Time Code subframe data are defined:

 

The first (labelled {ff}), contains subframe data exactly as described in the MIDI Cueing specification i.e. fractional frames measured in 1/100 frame units.

 

The second form (labelled {st}) substitutes time code "status" data in place of subframes. For example, when reading data from tape, it is useful to know whether these are real time code data, or simply time data updated by tachometer pulses during a high speed wind. In this case, as in other cases of "moving" time code, subframe data are practically useless, being difficult both to obtain and to transmit in a timely fashion.

 

hr mn sc fr (ff|st)

hr = Hours and type: 0 tt hhhhh

tt = time type (bit format):

00 = 24 frame

01 = 25 frame

10 = 30 drop frame

11 = 30 frame

hhhhh = hours (0-23, encoded as 00-17hex)

mn = Minutes: 0 c mmmmmm

c = colour frame bit (copied from bit in time code

stream):

0 = non colour frame

1 = colour framed code

mmmmmm = minutes (0-59, encoded as 00-3Bhex)

sc = Seconds: 0 k ssssss

k = reserved - must be set to zero

ssssss = seconds (0-59, encoded as 00-3Bhex)

fr = Frames, byte 5 ident and sign: 0 g i fffff

g = sign bit:

0 = positive

1 = negative (where signed time code is

permitted)

i = final byte identification bit:

0 = subframes

1 = status

fffff = frames (0-29, encoded as 00-1Dhex)

If final byte bit = subframes (i = 0):

ff = fractional frames: 0 bbbbbbb (0-99, encoded as

00-63hex)

If final byte bit = status (i = 1):

st = code status: 0 e v d xxxx

e = estimated code flag bit:

0 = normal time code

1 = tach or control track updated code

v = invalid code bit (ignore if e = 1):

0 = valid

1 = invalid (error or not current)

d = video field identification bit:

0 = no field information in this frame

1 = first frame in 4 or 8 field video

sequence

xxxx = reserved bits - must be set to 0000

Source:

 

http://www.lim.di.unimi.it/IEEE/MIDI/STAND.HTM

 

Some more info in this document by Peter Elsea:

 

http://peterelsea.com/Maxtuts_advanced//Max&MMC.pdf

 

I haven't messed with this yet but that looks like the reason we're not getting any subframe action in Logic.

 

J.

Link to comment
Share on other sites

Thank you for this useful piece of documentation. Unfortunately, after investigation I have the feeling that this double possible meaning of the subframe byte is not the cause of my problem. Here is the MMC Goto SysEx I send :

 

F0 7F 7F 06 44 06 01 00 00 00 05 2F F7

 

When sent, the LPX playhead moves precisely to 00:00:05:00

The sub-frame byte 2F (=47) has no impact on the LPX playhead location, whatever its value is.

 

Concerning the frame byte : 05 = 00000101

The "final byte identification bit" i (which is the third one according to the documentation) equals 0. That means that the final byte is about subframes and not status :

 

IF final byte bit = subframes (i = 0):

ff = fractional frames: 0 bbbbbbb (0-99, encoded as 00H-63H)

 

Thus, my final byte 2F = 00101111 = 47 should be taken into account as a quantity of subframes, not as a status byte.

 

Does anyone have an idea ? I would find so disappointing that LPX does not enable to move the playhead at a precise location.

Link to comment
Share on other sites

Well, I haven't been able to get the subframe byte going either. I guess my bitwise math is not that great.

 

However, there are other ways to achieve what you want.

 

For example, If you have Max, there's the [hostcontrol~] object that allows you to specify transport position in 1 PPQ ticks (quarter notes, basically) via Rewire. You can control this via MIDI of course.

 

J.

Link to comment
Share on other sites

Thank you for your tests, I haven't been able neither to succeed.

Unfortunately I'm not using Max. I am actually sending Midi messages in Java, using the Java.sound api. I have been looking for something similar to this [hostcontrol~] Max object but I still havent found anything.

 

Did you have other ideas to achieve that ? I was thinking maybe to use OSC, but ideally I'd prefer to keep sending simple midi messages.

Link to comment
Share on other sites

Hi,

 

What would your preferred method for triggering these messages be? By clicking with a mouse? From a MIDI controller (keys, buttons, knobs)? From an iPad?

 

I was thinking maybe to use OSC

 

The only OSC messages Logic will understand are the ones sent from the Logic TouchOSC layouts. Do you have TouchOSC for iPad/iPhone/iPodTouch?

 

J.

Link to comment
Share on other sites

I don't work with any Ipad/Iphone/Ipod and touchOSC. I am only interested in specifying manually specific midi messages and sending them to Logic Pro. To do so, I use the Java Sound api which enables you to specify a midi message byte per byte, and send it to any device (including Logic Pro).

So far, I tried Program change messages and MMC messages. None of them are able to move the LPX playhead to a precise location. I wonder now if there is other sort of MIDI messages which could be able to do so.

Link to comment
Share on other sites

I don't work with any Ipad/Iphone/Ipod and touchOSC. I am only interested in specifying manually specific midi messages and sending them to Logic Pro.

 

Cool, but how do you want to send them? What action do you want to perform for the message to go out and move Logic's playhead? Clicking somewhere? Playing a key on a MIDI keyboard? Turning a knob on a MIDI controller?

 

 

To do so, I use the Java Sound api which enables you to specify a midi message byte per byte, and send it to any device (including Logic Pro).

 

I've never used the Java Sound API so I don't know how it's supposed to send these messages (what the user needs to do to trigger them).

 

I'm asking because I could do a simple patch for you in Max using the hostcontrol object I mentioned before.

 

It would also help if you explained in which context you'd be using this.

 

None of them are able to move the LPX playhead to a precise location.

 

How precise do you need this location to be? You mentioned Bars and Beats before so I guess the hostcontrol object idea should be enough.

 

J.

Link to comment
Share on other sites

Here's another idea:

 

If you can program your Java Sound API bidule to send a specific amount of the same message in one go, you could assign that message to "Forward by Division Value" command.

 

So for example, having your project's division value set to 16, if you send it 64 iterations of say, CC28 with a 2nd data byte value of 127 (which will be assigned to "Forward By Division Value"), it will move the playhead to bar 5 if the project is in 4/4.

 

J.

Link to comment
Share on other sites

Thank you very much, for your ideas and your help proposition concerning the Max plugin. Unfortunately, I don't have Max and don't want to get into it. But if every Max object could be traduced in more standard language (C, Java, ..) that could be a very good option. I'll make some research about it.

 

Triggering massive "Forward by Division Value" was my initial strategy to move the playhead. I started to think to direct location commands when I realized that midi messages have to be separated in time by minimum delays in order to be treated in order by LPX. And I did not find correct this way to proceed. But anyway, it seems now that I don't have the choice.

 

Is there somewhere a list of all MMC commands that LPX responds to ? I did not find that but I was thinking that perhaps some other MMC commands could help me.

Link to comment
Share on other sites

Thank you very much, for your ideas and your help proposition concerning the Max object. Unfortunately, I don't have Max and don't want to get into it. But if every Max object could be traduced in more standard language (C, Java, ..) that could be a very good option. I'll make some research about it.

 

Triggering massive "Forward by Division Value" was my initial strategy to move the playhead. I started to think to direct location commands when I realized that midi messages have to be separated in time by minimum delays in order to be treated in order by LPX. Moreover I did not find correct this "Forward by Division Value" way to proceed. But anyway, it seems now that I don't have the choice.

 

By the way, is there somewhere a list of all MMC commands that LPX responds to ? I did not find that but I was thinking that perhaps some other MMC commands could help me.

Link to comment
Share on other sites

Thank you very much, for your ideas and your help proposition concerning the Max object. Unfortunately, I don't have Max and don't want to get into it.

 

You're welcome. What I was proposing was to give you a patch you could open in the runtime version of Max, which is free. But maybe the other idea (sending multiple iterations of the same MIDI message to control the "Forward by Division Value" command) is enough for you, and I realize you can actually do it yourself in PD (PureData), which is completely free.

 

But if every Max object could be traduced in more standard language (C, Java, ..) that could be a very good option. I'll make some research about it.

 

I don't think I can help you there.

 

Triggering massive "Forward by Division Value" was my initial strategy to move the playhead. I started to think to direct location commands when I realized that midi messages have to be separated in time by minimum delays in order to be treated in order by LPX. Moreover I did not find correct this "Forward by Division Value" way to proceed.

 

Well, it works perfectly when implemented in Max or PD.

 

By the way, is there somewhere a list of all MMC commands that LPX responds to ? I did not find that but I was thinking that perhaps some other MMC commands could help me.

 

I don't think so, being MIDI they should all work (at least in theory). Of the ones I've tried, the only one that has not worked at all was the Pause one.Maybe the Shuttle one could be interesting, but knowing there are other ways that do work (and are based on Bars and Beats), I wouldn't bother.

 

J.

Link to comment
Share on other sites

Triggering massive "Forward by Division Value" was my initial strategy to move the playhead. I started to think to direct location commands when I realized that midi messages have to be separated in time by minimum delays in order to be treated in order by LPX

 

I tried this method and it's OK if you send a couple of hundred iterations, but when you get to the thousands, the playhead does not move immediately. However, you could use a combination of that command plus the other ones that do bigger jumps ("Forward" and "Fast Forward").

 

But of all the things I've tried, Max's [hostcontrol~] object and its seek message is the method I like the most.

 

J.

Link to comment
Share on other sites

What I was proposing was to give you a patch you could open in the runtime version of Max, which is free.

 

I did not know that the runtime version was free. So yes, that would be very kind from you. By the way, if you can provide me that, I'll be able to check with MIDI Monitor what exactly are the MIDI messages that are sent by the [hostcontrol] object and that enable LPX to move its playhead to a precise location. Looking at the bytes of these messages will certainly help us to understand that problem, and enable us to re-produce these messages without the [hostcontrol] object.

 

By the way, I did not find any Pure Data equivalent to Max's [hostcontrol]. My plan was to look into the source code of this object to see how the bytes are set. (I dont think Cycling 74 will provide the source of their Max objects)

 

Finally, if we still don't find, I'll probably choose the combination MMC GoTo + "Forward by the smallest division value" n times, where the n forwards will counterbalance the subframes.

 

Thank you very much again for all your help.

Link to comment
Share on other sites

So yes, that would be very kind from you.

 

Cool, but you still haven't answered my questions:

 

but how do you want to send them? What action do you want to perform for the message to go out and move Logic's playhead? Clicking somewhere? Playing a key on a MIDI keyboard? Turning a knob on a MIDI controller?

 

By the way, if you can provide me that, I'll be able to check with MIDI Monitor what exactly are the MIDI messages that are sent by the [hostcontrol] object and that enable LPX to move its playhead to a precise location.

 

No, that won't be possible, because the [hostcontrol~] object sends data via Rewire, and you can't monitor rewire buses with MIDI Monitor.

 

I did not find any Pure Data equivalent to Max's [hostcontrol].

 

There isn't anything equivalent in PD. What works is the Forward commands idea. You could even control different commands with the same patch if you like. For example, one part of the patch could trigger the "Forward" or "Fast Forward" commands for big jumps, while another part of the patch triggers the "Forward by Division Value" (or even "Forward one Frame" comand if you don't minf leaving the Bars and Beats domain).

 

Here's an example of a PD patch that can send a definable amount of the same Control Change message, triggered by clicking or by sending it a MIDI note:

 

745380779_ScreenShot2014-07-31at18_56_37.png.01c5e3a843be2afd86175d6db36dd025.png

 

J.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...