Beginner question - can the Tracktion Engine be used in plugins?

I’m very new to Juce, I’m trying to make an arpeggiator that listens to incoming midi and then creates arpeggiated sequences synced to a grid. I’ve been able to intercept the incoming midi messages and create the notes I want to arpeggiate, but I don’t understand how to do the actual arpeggiation.

I’ve seen suggestions to “use the Tracktion Engine”, so my first question is, can I use the Tracktion Engine to make a VST? I’m unsure if this can be done.

You need to figure that out. Maybe the forum helps if you ask a more specific question.

The Tracktion Engine does not help to solve that problem.

1 Like

Take a look at the Arpeggiator tutorial.

1 Like

Tracktion Engine is primarily used for building apps with sequenced content on a timeline. What you’re describing sounds more like a “live” arpeggiator which would be more simply done in pure JUCE.
As @LiamG says, take a look at the JUCE Arpeggiator tutorial.

For others coming here seeing the topic title though, yes Tracktion Engine can be built as a plugin.

1 Like

I’m on it, thanks :slight_smile:

Yes, I’m creating more of a “live” arpeggiator. Thank you, I will go through the Arpeggiator tutorial.

Please be aware, though, that the code in this tutorial uses dynamic memory allocation on the audio thread, which is actually unsafe. Working on the audio thread is notoriously difficult because you can’t use memory allocation, locks, or exceptions (these will all lead to audio dropouts and glitches). You’ll find a lot more details about these problems and how to deal with them on the forum, but be warned that it isn’t easy.

It’s a bit perplexing that this tutorial code is written in an unsafe way, but I assume it’s just intended to get you off the ground quickly.

An easy solution would be if you give the array a fix minimumAllocatedSize to avoid allocation while running in the real-time loop. Something like 200 should be more than enough for an arpeggiator:

juce::Array<int, DummyCriticalSection, 200>

This way you can use the juce::array like in the demo example and you don’t have to fear any allocation after construction unless the size gets bigger than 200.

Or is there a reason to avoid this?