Getting Started with Axoloti

Posted on 2015-09-11 by Jan Vantomme
Tags: music, writing

I've started writing my second book a while ago. This time, the subject is Axoloti, a platform for creating synthesizers, drum machines, effects processors or other weird instruments. I've decided to use leanpub, so I don't have to work with a publisher. This allows me to sell the book while I'm writing it, and keep the book more affordable. The first chapter is available as a free sample, if you want to read the rest of the book, you'll need to buy it. You can get the book right over here: https://leanpub.com/getting-started-with-axoloti.

Since the first chapter is available for free, I've decided to publish it over here as well. So here we go…

In this first chapter, you will learn how to build a basic monophonic synthesizer by creating objects and connecting them. Your synth will only be able to play one note at a time, but that should be enough. The Minimoog was monophonic as well, and a lot of great music was made with it. Time to get started.

Part 1: Making Noise

Start by creating a new document. Double-click anywhere in the empty document to bring up the object selector window. Type osc, and select the osc/sine object. Press enter to add the object to your document.

fig 1.1 — The object selector.

Now that you know how to create objects, it’s time to add some more. These are the four objects you need to create your first synthesizer.

  • midi/in/keyb mod: This object represents a MIDI keyboard, and will handle all incoming notes.
  • osc/sine: A basic sine wave oscillator. This is the object that will generate the sound.
  • math/*c: This object multiplies the signal running through it with a constant value. You will use it to control the volume of your synthesizer. Make sure you use the one with the red inlet and outlet, as this object will be used on the audio signal.
  • audio/out stereo: This object will send the audio signal to the audio outputs on the Axoloti board.

Once you’ve added the objects, your document should look like Figure 1.2. This might be a good time to save your document.

Figure 1.2 — All objects needed to create a basic synthesizer with Axoloti.

The next thing you need to do, is connecting the objects with “patch cables”. Inlets are displayed on the left to the object, outlets on the right side. You’ll notice that these inlets and outlets have different colors. In the objects you’ve created, you’ll see that there are blue, red and yellow inlets and outlets. Best practice is to connect inlets and outlets of the same color, but there are some exceptions you will learn about later. These are the connections you should make now.

  1. Connect the note outlet of the keyboard object to the pitchm inlet of the oscillator.
  2. Connect the outlet of the oscillator to the inlet of the math/*c object.
  3. Connect the outlet of the math/*c object to both inlets of the audio out objet.

Once you’ve connected the objects, your document should look like Figure 1.3.

Figure 1.3 — All objects are connected.

So that’s it. Your first synthesizer is finished, and ready to play.

  1. Make sure your Axoloti board is connected to your computer with the Micro USB cable.
  2. Plug in some headphones, or connect the main audio out to your amplifier or speakers.
  3. Press the Live checkbox at the top left of your document to compile and upload your first patch to the Axoloti board.
  4. Go to Window > Keyboard to bring up the virtual keyboard. You can also plug in a MIDI keyboard, as this is more fun to play.
  5. Press a note on the virtual keyboard. At this moment you should hear nothing.
  6. Rotate the dial of the math/*c slowly to turn up the volume.
  7. Press some more notes, and hear the sound of your first synthesizer.

Figure 1.4 — Playing the synthesizer with the keyboard.

Part 2: Making the Noise Stop

As you may have noticed, the sound keeps playing once you’ve pressed a note on the keyboard. This is probably not the behavior you want. A good synthesizer should make noise when you press a key, and stop when you release it. Let’s take a look at how you can fix this by adding only one object.

  1. Double click your document to bring up the object selector window.
  2. Type gain, and select the gain/vca object.
  3. Press enter to add the object to your document.

Your document should now look like Figure 1.5.

Figure 1.5 — A gain/vca object was added to the document.

It’s time to change how the objects in your patch are connected.

  1. Disconnect the wire between the oscillator and the math/*c object. You can do this by right-clicking on the oscillator outlet and selecting Disconnect outlet from the menu. Another way to do this is to click on the outlet, and dragging the cable away.
  2. The new gain/vca object you’ve just created needs to be placed between the oscillator and the math/*c object.
  3. Connect the outlet of the oscillator to the red inlet of the gain/vca object.
  4. Connect the outlet of the gain/vca object to the inlet of the math/*c object.
  5. Connect the yellow gate outlet of the MIDI keyboard object to the blue inlet of the gain/vca object. This is a one of the possible connections between different colors.

If you’ve done everything correct, your document should look like Figure 1.6.

Figure 1.6 — All objects are connected.

The new patch is now ready to play. Press the Live checkbox at the top left of your document, and start playing some notes on the keyboard. You’ll notice that the sound stops when you release the key.

Part 3: Adding Velocity

Your current patch is starting to work the way most synthesizers work. But there is a small problem: all notes are played at the same volume. In this third step, you will add the functionality to play softer notes between the loud ones. This will make your music a bit more interesting.

  1. Double click in your document to bring up the object selector window.
  2. Type gain, and select the gain/vca object.
  3. Press enter to add the object to your document.
  4. Disconnect the wire between the first gain/vca object and the math/*c object.
  5. Connect the outlet of the first gain/vca object to the red inlet of the second gain/vca object.
  6. Connect the outlet of the second gain/vca object to the inlet of the math/*c object.
  7. Connect the velocity outlet of the MIDI keyboard object to the blue inlet of the second gain/vca object.

Your patch should now look like Figure 1.7.

Figure 1.7 — Velocity functionality was implemented in the patch.

The synth is now ready to play. Press the Live checkbox on your document window and start playing the keyboard. Drag the velocity slider and listen how the volume of the notes change. If you use a real MIDI keyboard, you can play it harder or softer to hear the difference.

Part 4: Adding an Envelope

Most synthesizers have envelopes to control the volume of the oscillator or the frequency of the filter. ADSR stands for Attack/Decay/Sustain/Release. In this part, you will learn how to add an envelope to control the volume.

  1. Double click in your document to bring up the object selector window.
  2. Type adsr and press enter to create an ADSR envelope.
  3. Disconnect the wire from the gate outlet of the keyboard to the first gain/vca object.
  4. Connect the gate outlet of the keyboard to the inlet of the ADSR envelope.
  5. Connect the outlet of the ADSR envelope to the blue inlet of the first gain/vca object.
  6. Double click in your document to bring up the object selector window.
  7. Type kscope, to add a kscope 128 p object. This object will be used to display the signal of the ADSR envelope.
  8. Connect the outlet of the ADSR envelope to the blue inlet of the new kscope object.

If you did everything correct, your patch should look like Figure 1.8.

Figure 1.8 — An ADSR envelope was added to the patch.

Envelope Parameters

Let’s take a look at what the different dials of the ADSR envelope do. The white line in Figure 1.9 shows the amplitude of the envelope.

Figure 1.9 — Schematic of an ADSR Envelope.

  • Attack: The time it takes to reach the maximum volume of the sound when you press a key on your keyboard. If you set this dial to the left, the sound will reach its maximum volume very quickly. If you set this dial to the right, it will take some time to reach the maximum volume.
  • Decay: The time it takes to reach the sustain level of your sound after the attack.
  • Sustain: The volume of your sound until you release the key.
  • Release: The time it takes to go from the sustain level to zero after you release the key. If you set this dial to the left, the sound will stop fast when you release the key on your keyboard. If you set the dial to the right, the sound will slowly fade out.

You can now press the Live checkbox and start playing the keyboard. Change the parameters on the ADSR envelope and listen how it changes your sound. You can see what the different parameters do by watching the signal in the kscope object.

Part 5: Adding a Filter

The last thing needed to create an even more interesting sound is a filter. There are lots of different filters available in the Axoloti object library. You will find them in the filter directory of the object selector.

  1. Double click in your document to bring up the object selector window.
  2. Type filter, select the bp svf m filter, and press enter to add the object to your document.
  3. Disconnect the wire between the second gain/vca object and the math/*c object.
  4. Connect the outlet of the second gain/vca object to the red inlet of the filter you’ve just created.
  5. Connect the outlet of the filter to the math/*c object.

Your final synthesiser is should look like Figure 1.10. Press the Live button and play around with the pitch and resonance dials and hear what happens to your sound if you play the keyboard.

Figure 1.10 — A bandpass filter was added to the patch.

Exercises

Now that you know how to create a basic monophonic synthesizer, it’s time to test your knowledge. Try some of these exercises and hear the broad range of sounds you can make with just one oscillator, an envelope and a filter.

  1. You’ve created a sine wave oscillator at the beginning of this chapter. Replace it with a saw or square oscillator and see how this affects the sound of your synthesizer.
  2. Change the Envelope. Use a Attack/Decay Envelope (AD), Attack/Hold/Decay Envelope (AHD) or Hold/Decay Envelope (HD). You’ll find these objects in the env directory in the object selector.
  3. Change the Filter, or connect an extra ADSR envelope to the resonance inlet of the filter in your final patch.

Tweet this article