Jump to content

Scripter Automation Lane Timing Bug?


1offby

Recommended Posts

Also posted at: https://discussions.apple.com/message/28703249#28703249

OS X 10.10.4

Logic 10.1.1

Late 2013 Mac Pro and Late 2011 Macbook Pro

Issue: MIDI Scripter plugins on tracks set to the "External Instrument" plugin send MIDI data at the wrong time unless Preferences>Audio>General>Sample Accurate Automation "Volume, Pan, Sends & Plug-In Parameters" is selected.

Question: Should MIDI Scripter events output using the External Instrument plugin require "Sample Accurate" Automation to have the same timing accuracy as other MIDI output?

Steps:

1)Download and unzip the Logic X Project here: https://goo.gl/r1GG2g

The Project has:

MIDI CC data written for CC 1

Region Automation for a Smart Control assigned to a basic MIDI Script sending CC 21

Two note events

Preceding each note event there are events written for CC 1 and the Smart Control

2) Using an external MIDI event detector such as MIDI Monitor notice the order of MIDI events, track the output of MIDI events from Logic (I used IAC Bus 1, Channel 1)

3) When Preferences>Audio>General>Sample Accurate Automation "Volume, Pan, Sends & Plug-In Parameters" is selected, events are output in the proper order

4) When Preferences>Audio>General>Sample Accurate Automation "Volume, Pan, Off is selected, MIDI events from the Smart Control Automation Lane (CC 21) are sent early

Expected result: MIDI event timing is accurate without needing to enable Sample Accurate Automation

Actual Result: MIDI event timing is inaccurate unless Sample Accurate Automation is enabled

In my case this means enabling an audio related preference that uses more CPU to ensure MIDI event timing, which seems illogical

 

My main goal in this case is to use the MIDI Scripter. I'd prefer to use an External MIDI Track, but External MIDI Tracks do not support the Scripter Plugin.

As I try to use Software Instrument Tracks using the External Instrument Plugin I notice how MIDI event output seems to be tangled in the audio thread/stack/whatever.

 

TL;DR Anyone else?

Link to comment
Share on other sites

FWIW, you can't trust MIDI sent over IAC to be accurate timing-wise or even sometimes in terms of the order of bytes -- specifically, CC's. Logic, or the IAC system (hard to tell which) is notorious for duplicating messages bytes and/or sending them out of order, especially when you start playback.

 

Suggest looking at the MIDI Monitor program from www.snoize.com. Then, send MIDI to a port on your MIDI interface (assuming you have one) and use that monitor to snoop on the order of the bytes there.

 

One thing I can attest to is that the order/sequence of messages you see reported in the Scripter's "console" is accurate. But the order of the bytes will, of course, depend on how you've coded the Script. So that might be something to check too.

Link to comment
Share on other sites

Thanks Ski.

 

FWIW, you can't trust MIDI sent over IAC to be accurate timing-wise or even sometimes in terms of the order of bytes -- specifically, CC's. Logic, or the IAC system (hard to tell which) is notorious for duplicating messages bytes and/or sending them out of order, especially when you start playback.

True, Logic does often send a clump of MIDI messages at transport start/stop, but that is usually due to events within Logic not a Core MIDI issue.

Based on my own experience, stories of inaccuracy due to any particular MIDI bus/Core MIDI are not true. As a matter of fact I have wasted a lot of time creating and maintaining alternatives to the IAC bus by relying on such reports. If ski or someone can create a MIDI event timing issue that is reproducible and due to a MIDI port or bus I'd like to see it. Sometimes a machine that has been on for several days needs a restart to flush out the MIDI system, but that's the only Core MIDI weirdness I have found.

 

Particular to this post, MIDI events in general are being sent across the IAC bus with total accuracy. In this case it is only the events being triggered by a Smart Control controlling a MIDI FX Scripter plugin that are sent at unexpected times. The bus does not "know" what within Logic Pro X.app is sending a MIDI message; another reason it likely is not the IAC bus.

 

Suggest looking at the MIDI Monitor program from http://www.snoize.com. Then, send MIDI to a port on your MIDI interface (assuming you have one) and use that monitor to snoop on the order of the bytes there.

I do mention the MIDI monitor application in my original post:

2) Using an external MIDI event detector such as MIDI Monitor notice the order of MIDI events

I have been using that, as well as other resources, to check the order of MIDI events into/out from Logic. I posted here after testing the issue as carefully as I could, including trying alternate MIDI ports/busses.

 

One thing I can attest to is that the order/sequence of messages you see reported in the Scripter's "console" is accurate. But the order of the bytes will, of course, depend on how you've coded the Script. So that might be something to check too.

 

I was able to "fix" the issue by changing the Sample Accurate Automation setting; this makes me suspect it's something about the way MIDI events are prioritized on Software Instrument Tracks. I'd be very interested if there are issues with the JavaScript I used; but again, since changing the Sample Accurate Automation settings resolves the issue not sure how JavaScript could be the culprit.

 

Ski,did you read my post or look at the Logic X Project I linked to help explain the issue?

 

I'd be curious to hear from any Logic Pro X users who are interested in reproducing the behavior, have experienced something similar, or have further suggestions.

Edited by 1offby
Link to comment
Share on other sites

Here's the test script for anyone interested:

//Logic X Scripter plugin
//Test Timing of Scripter Automation Lane
//Try this with Logic X Preferences>Audio>General>Sample Accurate Automation set to "off" and "Volume, Pan, Sends, Plug-In Parameters"
var TEST = [
       [0, "One"],
       [64, "Two"],
       [127, "Three"],
   ];
//midi channel for ccOut
var midiChannel = 1;
//cc number for ccOut
var ccNum = 21;
//instrument name
var instrument = "TEST";
//make string for menu
var menuList = [];
var i;
for (i = 0; i < TEST.length; i += 1) {
menuList[menuList.length] = TEST[i][1];
}
//create the Logic X Scripter Control
var PluginParameters = [
       {name: instrument,
           type: "menu",
           valueStrings: menuList,
           numberOfSteps: TEST.length,
           defaultValue: 0 } ];
//send a cc number on parameter change just BEFORE a note event. Use an external application, such as MIDI Monitor, to trace event timing out of Logic
function ParameterChanged(param, value) {
   'use strict';
   if (value >= 0) {
       var articChange = new ControlChange;
       articChange.number = ccNum;
       articChange.value = TEST[value][0];
       articChange.channel = midiChannel;
       articChange.send();
}
}

Link to comment
Share on other sites

In reply-in-brief, my experience with both the timing and accuracy of MIDI events being sent over IAC are as I stated. It's particularly with the jittery timing of MIDI-over-IAC that I don't recommend it for professional use. All I can say is "YMMV".

 

Ski,did you read my post or look at the Logic X Project I linked to help explain the issue?

 

I read your post. Don't need to look at the project because I know MIDI and IAC behavior very well, so I offered general commentary which I thought might be useful to you. Now... you're using automation to send workaday MIDI data. Knowing how inaccurate Logic's automation timing can be even when playing back events generated from its own channel strip controls or "fader" events generated from plugins, I'm not surprised to see that you've having difficulties.

 

And your script is basic enough to understand without having to put it through its paces.

 

So my analysis, FWIW (and that might not be much, but then again you're getting my time and benefit of experience for free so the complaint department is over there ----> ) is that you're experiencing timing inaccuracies as a result of using two potentially inaccurate transmission methods. Therefore, I'm not surprised you're seeing this behavior.

 

And yes, turning off sample accurate automation sometimes makes the playback of certain kinds of automation more accurate. Go figure. So perhaps that's something to file a bug report about.

Link to comment
Share on other sites

Ski:

Don't need to look at the project because I know MIDI and IAC behavior very well

OK

And yes, turning off sample accurate automation sometimes makes the playback of certain kinds of automation more accurate. Go figure. So perhaps that's something to file a bug report about.

To clarify, I am reporting the opposite result. Per my initial post:

MIDI Scripter plugins on tracks set to the "External Instrument" plugin send MIDI data at the wrong time unless Preferences>Audio>General>Sample Accurate Automation "Volume, Pan, Sends & Plug-In Parameters" is selected.

Ski:

you're getting my time and benefit of experience for free so the complaint department is over there ----> )

I may incorrectly understand community forums as an egalitarian location for sharing software issues etc rather than a spot where experts dispense their "time and benefit of experience" to a grateful public. I have found that solutions can come from any source, not just the experts.

My main goal in making this posting was to report the behavior I can reproduce on two systems, see if anyone can replicate, and create an archive for future users should this behavior truly be an issue within Logic X.

Ski:

my experience with both the timing and accuracy of MIDI events being sent over IAC are as I stated. It's particularly with the jittery timing of MIDI-over-IAC that I don't recommend it for professional use. All I can say is "YMMV"

I understand that is your experience. One method for reporting such behavior involves finding a reproducible error and trying to understand its source. There are several things that can contribute to MIDI message timing issues and I simply have not been able to find a scenario where the IAC bus is the cause, or any less/more problematic than any MIDI bus. As I said:

If ski or someone can create a MIDI event timing issue that is reproducible and due to a MIDI port or bus I'd like to see it.

I really mean that! But anecdotal reports don't help me as a software user.

I am still curious whether anyone has experienced a similar issue to the thread topic.

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...