User presets are just normal .json files.
They are formatted to be friendly to edit in any code or text editor.

Hacking preset files
You can think of Sine Machine’s UI as basically generating a bunch of numbers for the underlying synth engine.
Modifying the preset let’s you escape the “rails” of the user interface and specify patterns of values that might not be possible via the UI.
If you make changes after a patch has been loaded, you’ll need to reload/restart Sine Machine to get it to update. This may change in the future.
Hacking preset files comes with some amount of risk.
In general, single parameter values will be sanitized to ensure they stay within the parameter’s lower and upper bounds.
However, it still might be possible to find some edge cases that will result in very loud or unpleasant sounds. And typos will cause the patch to no longer load.
Modifying per-harmonic values
Any time you see a slider + odd/even selector + “rainbow” harmonic XY control in the interface, they are working together to produce 511 values behind the scenes, 1 value for each harmonic.
For example, you could provide specific per-harmonic values for pitch noise:

If you open up the json file, you’ll find an entry for pitchNoiseAmounts.

The first item in the brackets is the value for the first harmonic, the second item is the second, and so on.
The first item is the first harmonic, the second item is the second, and so on.
Values like pitchNoiseAmounts range from 0 to 1 which maps to 0 to 100% in the UI.
Feel free to alter the values you like. The json is pretty tolerant to editing.
For example, you could decide to specify only 5 values — for the first 5 harmonics — the rest will fall back to their default (in this case, 1.0) when imported:
"pitchNoiseAmounts": [0.1,0.2,0.3,0.4,0.5]
pitchMapping
By editing pitchMapping in the json, you can change the ratio of the partials to be non-harmonic, something not possible to do in the UI itself.
See the factory preset Leads / the softest sine for an example. All partials are set to be sightly detuned fundamentals.
JSON Hacking FAQ
- The preset name that Sine Machine will display in the UI is the value of
namein the json (not the preset’s file name!). - Envelope values (
decayorrelease), are specified in seconds. - If you want to change the tuning of the partials, specify the ratios in
pitchMapping— don’t worry about these going above nyquist, the engine will not attempt to produce sounds above nyquist.
Leave a Reply