Initiating Automation Recording

I have modified my code for the new Automation changes. Everything works except I am not able to record new automation. I can playback existing automation, but nothing new. I am thinking there must be a step I am missing to get it to record.

Previously, I simply selected the automation parameter, and then

edit->getAutomationRecordManager().setWritingAutomation(true);

To accommodate the new automation changes, are there additional steps for recording?

Yes, a track also needs to be in one of the write modes now. Touch or Latch are the preferred ones.

Perfect! That did the trick.

As a test, I simply added

trackPtr->automationMode = te::AutomationMode::write;

and I am again recording automation.

Could an argument be made that it should default to te::AutomationMode::write?

Thank you!

Write generally isn’t what you want as it will just overwrite any existing automation on a track with the current value as soon as play starts. If it’s not doing that, then that’s a bug…

Latch is the most similar to the old behaviour.

latch is fine. I am suggesting that it seems it should default to a value. So, since latch is most similar to the old behavior that seems like the logical choice. Then the user can choose to change it as needed.

I think it should default to latch right?

    template<>
    struct VariantConverter<tracktion::engine::AutomationMode>
    {
        static tracktion::engine::AutomationMode fromVar (const var& v)
        {
            using namespace tracktion::engine;
            return automationModeFromString (v.toString()).value_or (AutomationMode::latch);
        }

        static var toVar (tracktion::engine::AutomationMode v)
        {
            return toString (v);
        }
    };

Its not defaulting to latch for me. In my usage, I am not fetching the value in the manner you show. I simply assign the AutomationMode when I select the AutomatableParameter. And I am fine with that. It just seems the variable should be initialized to some default.

By the way, write mode does cleanup of redundant automation points, but latch mode does not.

Actually, looks like it’s being created with this:

    automationMode.referTo (state, IDs::automationMode, um, {});

where {} is the default for the enum which will be read.
I think that’s correct? Most hosts start with “read” for the automation don’t they?
I might be convinced it should be latch though…


Do you mean the AutomationCurve::simplify step isn’t being called for latch?
I think it should happen at punchOut which happens when play stops for latch?

I simply do

trackPtr->setCurrentlyShownAutoParam(automatableParameter);
trackPtr->automationMode = te::AutomationMode::latch;

When I do that, simplify() is never called.

If, instead, I do

trackPtr->setCurrentlyShownAutoParam(automatableParameter);
trackPtr->automationMode = te::AutomationMode::write;

then simplify() is called.

Should be fixed here:

Yes, simplify() is working for me in latch mode.

Thank you!