SynthMaker Manual Help Open SynthMaker (opens in a new tab)
Code

Inside a built-in module

SynthMaker's own modules are written in the same code as a Code module. Open one, a Filter or an Envelope, and read the lines that make its sound: exactly the code SynthMaker runs for it.

Reading a built-in module's code is free.

1Open it

  1. In the Patch, double-click a module, or choose View code in its menu (⋯ on its card).
  2. Its code takes the Patch's place, with the way back in the breadcrumb above it.
  3. Its card stays beside it: turn its knobs and play while you read.
  1. Step 1: Open the Filter. Smooth Pluck › Filter: inside the built-in Filter, opened with a double-click on its box. (larger)
  2. Step 2: Built-in · read only. The bar says Built-in · read only; under it, the code the engine runs for the Filter. (larger)

2Read it

The bar over the code says Built-in · read only. The code is exactly what runs, the comments at its top say what it does, and every line is the same kind of line as in a Code module: y' is y one sample ago, and rate the samples in a second. It also uses a few functions of the engine's own, such as single(…) and synced(…); they work in your copy too.

Some names in the code aren't the card's: in is a word of the code, so the Filter's in is x there. The bar lists them.

3Its graph

Choose Graph or Both to see the same code as a picture of its maths, as a Code module's: every +, × and function a box, its wires, and each y' a one-sample delay with its loop drawn back. Choose a box and its part of the code lights up; the cursor in the code chooses its box.

Its knobs show their values now, as on its card: turn the cutoff and the graph's cutoff follows.

Inside the Filter, Both: its code beside its graph of primitives.
The Filter's code beside its graph.

4Not written in code yet

Some modules are still written in C++, the language SynthMaker's engine is written in. They open too, and say so: Written in C++ for now; its code arrives in a later update. SynthMaker never shows code that isn't what runs.

Inside the Oscillator: Written in C++ for now; its code arrives in a later update.
The Oscillator, opened: still C++.

5Edit a copy

A built-in never changes. To change one, choose Edit a copy in the bar over its code. In this sound only, the module becomes a Code module of your own, Filter (mine), with the same code under a name of its own, MyFilter. It keeps its wires and its knobs where they were, and it sounds exactly the same until you change a line.

You stay inside it, and now its code is yours to type in. Undo brings the built-in back.

  1. Step 1: Edit a copy. Edit a copy, beside Copy, in the bar above the code. (larger)
  2. Step 2: Filter (mine): yours. Smooth Pluck › Filter (mine): your own module, MyFilter, with the same code. (larger)

Try it

  1. Open Smooth Pluck and double-click its Filter.
  2. Turn the Filter's cutoff on its card while you play, and find cutoff in its code.
  3. Choose Edit a copy, then change octT = log2(max(cutoff, 10)) to use cutoff * 2: the Filter opens an octave higher.
Open the example sound: Smooth Pluck ↗ (opens in a new tab)

Remember