How do arpeggiators work, really? And how can we design one using simple code in Arduino and C++? Let's dive into the topic and learn how to use classes, various data structures and callbacks.
Case study: a simple synth with an arpeggiator
In this lesson we our focus will be the arpeggiator. The functions we'll build include BPM control, chord mode, direction change and randomness.
You can already check the code in the link below. Note that we might modify it in the future, so keep an eye for updates.
Modular programming using classes
As the complexity of an instruments grows we need to organize the code in a way that helps us design and reason about our software. And classes are a perfect vehicle for doing this. We will look at how to split the synth into the building blocks and how those blocks can talk to each other.
Using the Metro object (DaisySP/Daisyduino)
Metro is fairly simple module allowing to generate clock which we will need to run the arpeggiator.
Improving on C++ program structures
As always, we will show some common concepts in C++ programming. This time, we'll touch on function pointers, simple templates, structs and more.
All you need is a computer. If you have the Daisy Seed you can install the toolchain on your machine beforehand. You can also check out the code we will be working with on this Github page.