iOS 0.2.0: instruments as AUv3, in-app host with keyboard, MIDI in and benchmark

Shared SizzleDeviceAU base for effects and instruments; sizzle::Instrument voice
pools; Android's factory presets generated into the specs header; the app hosts
every device in-process (no dependence on the system plugin registry).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Reactorcoremeltdown
2026-11-15 22:17:47 +01:00
co-authored by Claude Opus 5.5
parent a5b2f4c873
commit 7f231c8f79
35 changed files with 1989 additions and 368 deletions
+15
View File
@@ -3,6 +3,21 @@
Sizzle for iOS/iPadOS (`cc.tiredsysadmin.ios.sizzle`). One entry per version in
`../versions.properties` (`ios.versionName` / `ios.versionCode`).
## 0.2.0 (build 4)
- All six instruments, now in C++ and matching the Android app sample for sample:
Synth, Morph Pad, Wavetable, Grain Cloud, Sampler and the SF2/XI loader, as
AUv3 instruments ("Tired Sysadmin: Sizzle …", 8 voices each, notes placed
sample-accurately) next to the eight effects.
- Factory presets from the Android app for Ambience, Synth, Morph Pad, Grain
Cloud, Wavetable and Mix Tightener (127 in all).
- The app now plays the devices itself, without going through iOS's plugin list:
pick an instrument and an effect, edit them, play from the on-screen keyboard
or any MIDI controller, load a WAV into a Sampler pad or an SF2/XI/WAV into the
loader. Audio keeps playing in the background.
- Benchmark: renders every device for 10 s and shows what it costs on this
device, as a share of one CPU core.
## 0.1.2 (build 3)
- Fix: **Check all plugins** crashed the app right after an update. iOS can still
+3 -2
View File
@@ -76,9 +76,10 @@ core-test: build/core/golden_test build/core/sampler_test
build/core/sampler_test
# ------------------------------------------------------------------ app
build/core/au_test: app/FX/SizzleEffectAU.mm app/FX/SizzleEffectAU.h app/FX/Components.gen.h app/tests/au_test.mm $(CORE_SRC) $(CORE_HDR)
AU_SRC := app/FX/SizzleDeviceAU.mm app/FX/SizzleEffectAU.mm app/FX/SizzleInstrumentAU.mm
build/core/au_test: $(AU_SRC) $(wildcard app/FX/*.h app/FX/*.hpp) app/tests/au_test.mm $(CORE_SRC) $(CORE_HDR)
mkdir -p build/core
$(CXX) $(CXXFLAGS) -Wno-deprecated-declarations -fobjc-arc -Iapp/FX -o $@ app/FX/SizzleEffectAU.mm app/tests/au_test.mm $(CORE_SRC) \
$(CXX) $(CXXFLAGS) -Wno-deprecated-declarations -fobjc-arc -Iapp/FX -o $@ $(AU_SRC) app/tests/au_test.mm $(CORE_SRC) \
-framework AVFoundation -framework AudioToolbox -framework Foundation
au-test: build/core/au_test
+6
View File
@@ -59,6 +59,12 @@ Each milestone ends with a build that runs on the iPad.
wavetables, the sample store and the WAV/SF2/XI readers (`core/tests/sampler_test`).
`make -C ios core-test`: 61 reference scenarios + 16 sampler tests.
- 2026-11-15, 0.2.0: the instruments as AUv3 (`aumu`) on `sizzle::Instrument` (the
engine's per-channel voice pool), checked on the Mac against the C++ instruments
with sample-accurate MIDI (`make -C ios au-test`). The app hosts every device
in-process (`SizzleHost`, manufacturer 'Tsyl'), so it works without the system
plugin registry, and benchmarks each device on the device it runs on.
Notes for the engine port (from the voice ports):
- Kotlin seeds every new FrasilVoice and GrainCloud from global counters, and every
SynthVoice builds a FrasilVoice. The C++ engine owns one `frasil::FrasilSeeds`,
+2 -2
View File
@@ -11,8 +11,8 @@ Makefile (`make -C ios help`).
| `core/include/sizzle/DeviceSpecs.gen.hpp` | Every device's parameters, generated from `ToolboxType` (Kotlin) |
| `core/tests/golden_test.cpp` | Compares the core with audio the Kotlin code renders |
| `app/components.txt` | The plugin list (AU type, subtype, device, name) |
| `app/FX/` | The effects extension: `SizzleEffectAU` (the AUv3) and `SizzleFXViewController` (factory + editor) |
| `app/Host/` | The container app: lists the plugins, checks each one on the device |
| `app/FX/` | The plugin extension: `SizzleDeviceAU` (shared: parameters, presets, state), `SizzleEffectAU` (aufx), `SizzleInstrumentAU` (aumu), `SizzleFXViewController` (factory + editor). The app compiles the same classes to host them itself |
| `app/Host/` | The app: `SizzleHost` plays the devices in-process (instrument → effect → output, keyboard, MIDI in, samples, benchmark); `PluginCheck` checks the extension's plugins |
| `app/tests/au_test.mm` | Mac-side test of the AUv3 wrapper |
| `tools/gen_components.py` | `components.txt` → the extension's Info.plist and `Components.gen.h` |
| `spike/` | The TrollStore AUv3 feasibility spike (see the end of this file) |
+16 -10
View File
@@ -2,16 +2,22 @@
#pragma once
#include <AudioToolbox/AudioToolbox.h>
typedef struct { OSType subtype; const char *toolboxType; const char *name; } SizzleComponent;
typedef struct { OSType subtype; OSType type; const char *toolboxType; const char *name; } SizzleComponent;
static const SizzleComponent kSizzleComponents[] = {
{'sBcr', "BITCRUSHER", "Bitcrusher"},
{'sFlt', "FILTER", "Filter"},
{'sEqx', "EQ10", "10-Band EQ"},
{'sDly', "DELAY", "Tape Delay"},
{'sMxt', "MIX_TIGHTENER", "Mix Tightener"},
{'sTpe', "TAPE_ENGINE", "Tape Engine"},
{'sGrn', "GRANULAR", "Granular Glitch"},
{'sAmb', "AMBIENCE", "Ambience Reverb"}
{'sBcr', 'aufx', "BITCRUSHER", "Bitcrusher"},
{'sFlt', 'aufx', "FILTER", "Filter"},
{'sEqx', 'aufx', "EQ10", "10-Band EQ"},
{'sDly', 'aufx', "DELAY", "Tape Delay"},
{'sMxt', 'aufx', "MIX_TIGHTENER", "Mix Tightener"},
{'sTpe', 'aufx', "TAPE_ENGINE", "Tape Engine"},
{'sGrn', 'aufx', "GRANULAR", "Granular Glitch"},
{'sAmb', 'aufx', "AMBIENCE", "Ambience Reverb"},
{'sSyn', 'aumu', "NES_SYNTH", "Synth"},
{'sMph', 'aumu', "MORPH_PAD", "Morph Pad"},
{'sWav', 'aumu', "WAVETABLE", "Wavetable"},
{'sGrc', 'aumu', "GRAIN_CLOUD", "Grain Cloud"},
{'sSmp', 'aumu', "SAMPLER", "Sampler"},
{'sSf2', 'aumu', "SOUNDFONT", "SF2-XI Loader"}
};
static const int kSizzleComponentCount = 8;
static const int kSizzleComponentCount = 14;
+66
View File
@@ -106,6 +106,72 @@
<key>type</key><string>aufx</string>
<key>version</key><integer>65536</integer>
</dict>
<dict>
<key>description</key><string>Sizzle Synth</string>
<key>factoryFunction</key><string>SizzleFXViewController</string>
<key>manufacturer</key><string>Tsys</string>
<key>name</key><string>Tired Sysadmin: Sizzle Synth</string>
<key>sandboxSafe</key><true/>
<key>subtype</key><string>sSyn</string>
<key>tags</key><array><string>Synthesizer</string></array>
<key>type</key><string>aumu</string>
<key>version</key><integer>65536</integer>
</dict>
<dict>
<key>description</key><string>Sizzle Morph Pad</string>
<key>factoryFunction</key><string>SizzleFXViewController</string>
<key>manufacturer</key><string>Tsys</string>
<key>name</key><string>Tired Sysadmin: Sizzle Morph Pad</string>
<key>sandboxSafe</key><true/>
<key>subtype</key><string>sMph</string>
<key>tags</key><array><string>Synthesizer</string></array>
<key>type</key><string>aumu</string>
<key>version</key><integer>65536</integer>
</dict>
<dict>
<key>description</key><string>Sizzle Wavetable</string>
<key>factoryFunction</key><string>SizzleFXViewController</string>
<key>manufacturer</key><string>Tsys</string>
<key>name</key><string>Tired Sysadmin: Sizzle Wavetable</string>
<key>sandboxSafe</key><true/>
<key>subtype</key><string>sWav</string>
<key>tags</key><array><string>Synthesizer</string></array>
<key>type</key><string>aumu</string>
<key>version</key><integer>65536</integer>
</dict>
<dict>
<key>description</key><string>Sizzle Grain Cloud</string>
<key>factoryFunction</key><string>SizzleFXViewController</string>
<key>manufacturer</key><string>Tsys</string>
<key>name</key><string>Tired Sysadmin: Sizzle Grain Cloud</string>
<key>sandboxSafe</key><true/>
<key>subtype</key><string>sGrc</string>
<key>tags</key><array><string>Synthesizer</string></array>
<key>type</key><string>aumu</string>
<key>version</key><integer>65536</integer>
</dict>
<dict>
<key>description</key><string>Sizzle Sampler</string>
<key>factoryFunction</key><string>SizzleFXViewController</string>
<key>manufacturer</key><string>Tsys</string>
<key>name</key><string>Tired Sysadmin: Sizzle Sampler</string>
<key>sandboxSafe</key><true/>
<key>subtype</key><string>sSmp</string>
<key>tags</key><array><string>Synthesizer</string></array>
<key>type</key><string>aumu</string>
<key>version</key><integer>65536</integer>
</dict>
<dict>
<key>description</key><string>Sizzle SF2-XI Loader</string>
<key>factoryFunction</key><string>SizzleFXViewController</string>
<key>manufacturer</key><string>Tsys</string>
<key>name</key><string>Tired Sysadmin: Sizzle SF2-XI Loader</string>
<key>sandboxSafe</key><true/>
<key>subtype</key><string>sSf2</string>
<key>tags</key><array><string>Synthesizer</string></array>
<key>type</key><string>aumu</string>
<key>version</key><integer>65536</integer>
</dict>
</array>
</dict>
<key>NSExtensionPointIdentifier</key><string>com.apple.AudioUnit-UI</string>
+18
View File
@@ -0,0 +1,18 @@
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
// SPDX-License-Identifier: GPL-3.0-or-later
// For subclasses of SizzleDeviceAU only (Objective-C++).
#import "SizzleDeviceAU.h"
#include <memory>
#include "SizzleDeviceKernel.hpp"
@interface SizzleDeviceAU ()
/// Subclasses: build the render-side kernel (called once from init).
- (std::unique_ptr<sizzle::DeviceKernel>)makeKernel;
/// The kernel (owned by the base).
@property (nonatomic, readonly) sizzle::DeviceKernel *kernel;
@end
+36
View File
@@ -0,0 +1,36 @@
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
// SPDX-License-Identifier: GPL-3.0-or-later
#import <AudioToolbox/AudioToolbox.h>
NS_ASSUME_NONNULL_BEGIN
/// What every Sizzle AUv3 shares: the device (a ToolboxType, e.g. "DELAY" or
/// "WAVETABLE") and its parameters from the generated specs, the hand-over of
/// settings to the render thread, factory presets (Android's PresetLibrary set),
/// user presets and saved state. Subclasses add busses and the render block:
/// SizzleEffectAU (aufx) and SizzleInstrumentAU (aumu). Pick the right one with
/// +classForComponentType:.
@interface SizzleDeviceAU : AUAudioUnit
/// Standard initializer: the device comes from the component's subtype
/// (components.txt). Used by AU registration (in-process and in the extension).
- (nullable instancetype)initWithComponentDescription:(AudioComponentDescription)desc
options:(AudioComponentInstantiationOptions)options
error:(NSError **)outError;
/// The AU class for a component type: kAudioUnitType_MusicDevice → instruments,
/// anything else → effects.
+ (Class)classForComponentType:(OSType)type;
/// The device's name as shown in Sizzle ("Tape Delay").
@property (nonatomic, readonly) NSString *displayName;
/// Its ToolboxType name ("DELAY").
@property (nonatomic, readonly) NSString *toolboxType;
/// Formats a parameter value the way Sizzle's editor does (units, %, choices).
- (NSString *)stringForParameter:(AUParameter *)param value:(AUValue)value;
@end
NS_ASSUME_NONNULL_END
+221
View File
@@ -0,0 +1,221 @@
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
// SPDX-License-Identifier: GPL-3.0-or-later
#import "SizzleDeviceAU+Private.h"
#import "Components.gen.h"
#import "SizzleEffectAU.h"
#import "SizzleInstrumentAU.h"
#include <cstring>
#include <vector>
#include "sizzle/DeviceSpecs.gen.hpp"
using namespace sizzle;
static int choiceIndex(const ParamSpec &s, const char *name) {
for (int i = 0; s.choices[i]; ++i) if (std::strcmp(s.choices[i], name) == 0) return i;
return 0;
}
static NSString *const kStateKey = @"sizzleValues";
@implementation SizzleDeviceAU {
std::unique_ptr<DeviceKernel> _k;
AUParameterTree *_tree;
Params _base; // main thread: the full settings (incl. hidden keys)
NSArray<AUAudioUnitPreset *> *_factoryPresets;
std::vector<int> _factoryIndex; // AU preset number → gen::factoryPresets index
AUAudioUnitPreset *_currentPreset;
NSString *_displayName;
NSString *_toolboxType;
}
+ (Class)classForComponentType:(OSType)type {
return type == kAudioUnitType_MusicDevice ? SizzleInstrumentAU.class : SizzleEffectAU.class;
}
- (instancetype)initWithComponentDescription:(AudioComponentDescription)desc
options:(AudioComponentInstantiationOptions)options
error:(NSError **)outError {
const SizzleComponent *comp = nullptr;
for (int i = 0; i < kSizzleComponentCount; ++i)
if (kSizzleComponents[i].subtype == desc.componentSubType) comp = &kSizzleComponents[i];
const DeviceSpec *spec = comp ? findDevice(comp->toolboxType) : nullptr;
if (!spec) {
if (outError) *outError = [NSError errorWithDomain:NSOSStatusErrorDomain code:kAudioUnitErr_InvalidElement userInfo:nil];
return nil;
}
self = [super initWithComponentDescription:desc options:options error:outError];
if (!self) return nil;
_displayName = @(comp->name);
_toolboxType = @(comp->toolboxType);
_k = [self makeKernel];
_k->spec = spec;
_k->type = comp->toolboxType;
[self buildParameterTree];
_base.fill(*spec);
[self pushBase];
[self buildFactoryPresets];
self.maximumFramesToRender = 4096;
return self;
}
- (std::unique_ptr<DeviceKernel>)makeKernel { return nullptr; } // subclasses
- (DeviceKernel *)kernel { return _k.get(); }
- (NSString *)displayName { return _displayName; }
- (NSString *)toolboxType { return _toolboxType; }
#pragma mark - parameters
- (void)buildParameterTree {
const DeviceSpec *spec = _k->spec;
NSMutableArray<AUParameter *> *params = [NSMutableArray array];
AudioUnitParameterOptions flags = kAudioUnitParameterFlag_IsReadable | kAudioUnitParameterFlag_IsWritable;
for (int i = 0; i < spec->paramCount; ++i) {
const ParamSpec &s = spec->params[i];
AUParameter *p;
if (s.isEnum()) {
NSMutableArray<NSString *> *names = [NSMutableArray array];
for (int c = 0; s.choices[c]; ++c) [names addObject:@(s.choices[c])];
p = [AUParameterTree createParameterWithIdentifier:@(s.key) name:@(s.label) address:(AUParameterAddress)i
min:0 max:(AUValue)(names.count - 1)
unit:kAudioUnitParameterUnit_Indexed unitName:nil
flags:flags valueStrings:names dependentParameters:nil];
p.value = (AUValue)s.def;
} else {
p = [AUParameterTree createParameterWithIdentifier:@(s.key) name:@(s.label) address:(AUParameterAddress)i
min:s.min max:s.max
unit:s.isInt ? kAudioUnitParameterUnit_Indexed : kAudioUnitParameterUnit_Generic
unitName:nil flags:flags valueStrings:nil dependentParameters:nil];
p.value = s.def;
}
_k->values[i].store(p.value);
[params addObject:p];
}
_tree = [AUParameterTree createTreeWithChildren:params];
DeviceKernel *k = _k.get();
_tree.implementorValueObserver = ^(AUParameter *param, AUValue value) {
if (param.address < (AUParameterAddress)k->spec->paramCount) {
k->values[param.address].store(value, std::memory_order_relaxed);
k->valuesSeq.fetch_add(1, std::memory_order_release);
}
};
_tree.implementorValueProvider = ^AUValue(AUParameter *param) {
return param.address < (AUParameterAddress)k->spec->paramCount ? k->values[param.address].load() : 0;
};
__weak SizzleDeviceAU *weakSelf = self;
_tree.implementorStringFromValueCallback = ^NSString *(AUParameter *param, const AUValue *value) {
return [weakSelf stringForParameter:param value:value ? *value : param.value] ?: @"";
};
}
- (AUParameterTree *)parameterTree { return _tree; }
/// Publish [_base] to the render thread and move the AU parameters to match it.
- (void)pushBase {
const DeviceSpec *spec = _k->spec;
for (int i = 0; i < spec->paramCount; ++i) {
const ParamSpec &s = spec->params[i];
AUValue v = s.isEnum() ? (AUValue)choiceIndex(s, _base.s(s.key, s.choices[0])) : _base.f(s.key, s.def);
[_tree parameterWithAddress:(AUParameterAddress)i].value = v; // notifies UI + kernel
}
_k->publish(_base);
}
/// Bring [_base] up to date with the AU parameters (they're the source of truth for
/// the visible keys; _base also holds hidden ones).
- (void)pullBase { _k->overlay(_base); }
- (NSString *)stringForParameter:(AUParameter *)param value:(AUValue)value {
if (param.address >= (AUParameterAddress)_k->spec->paramCount) return @"";
const ParamSpec &s = _k->spec->params[param.address];
if (s.isEnum()) {
int n = s.choiceCount(), i = (int)std::lround(value);
return @(s.choices[i < 0 ? 0 : (i >= n ? n - 1 : i)]);
}
const char *label = s.label;
if (strstr(label, "(dB)")) return [NSString stringWithFormat:@"%.1f dB", value];
if (strstr(label, "(ms)")) return [NSString stringWithFormat:@"%.0f ms", value];
if (s.isInt) return s.min < 0 ? [NSString stringWithFormat:@"%+d", (int)std::lround(value)]
: [NSString stringWithFormat:@"%d", (int)std::lround(value)];
if (s.min == 0 && s.max == 1) return [NSString stringWithFormat:@"%d%%", (int)std::lround(value * 100)];
if (s.min == -1 && s.max == 1) return [NSString stringWithFormat:@"%+d%%", (int)std::lround(value * 100)];
return [NSString stringWithFormat:@"%.2f", value];
}
#pragma mark - presets and state
- (void)buildFactoryPresets {
NSMutableArray *list = [NSMutableArray array];
for (int i = 0; i < gen::factoryPresetCount; ++i) {
if (_k->type != gen::factoryPresets[i].type) continue;
AUAudioUnitPreset *p = [AUAudioUnitPreset new];
p.number = (NSInteger)_factoryIndex.size();
p.name = @(gen::factoryPresets[i].name);
_factoryIndex.push_back(i);
[list addObject:p];
}
_factoryPresets = list;
}
- (NSArray<AUAudioUnitPreset *> *)factoryPresets { return _factoryPresets; }
- (BOOL)supportsUserPresets { return YES; }
- (AUAudioUnitPreset *)currentPreset { return _currentPreset; }
- (void)setCurrentPreset:(AUAudioUnitPreset *)preset {
if (preset == nil) { _currentPreset = nil; return; }
if (preset.number >= 0) {
if (preset.number < (NSInteger)_factoryIndex.size()) {
const char *const *kv = gen::factoryPresets[_factoryIndex[(size_t)preset.number]].values;
_base.fill(*_k->spec);
for (int i = 0; kv[i] && kv[i + 1]; i += 2) _base.set(kv[i], kv[i + 1]);
[self pushBase];
}
_currentPreset = preset;
} else {
NSError *err = nil;
NSDictionary *state = [self presetStateFor:preset error:&err];
if (state) self.fullState = state;
_currentPreset = preset;
}
}
- (NSDictionary<NSString *, id> *)fullState {
NSMutableDictionary *state = [NSMutableDictionary dictionaryWithDictionary:[super fullState] ?: @{}];
[self pullBase];
NSMutableDictionary *values = [NSMutableDictionary dictionary];
for (int i = 0; i < _base.size(); ++i) values[@(_base.keyAt(i))] = @(_base.valueAt(i));
state[kStateKey] = values;
state[@"sizzleType"] = _toolboxType;
return state;
}
- (void)setFullState:(NSDictionary<NSString *, id> *)fullState {
[super setFullState:fullState];
NSDictionary *values = fullState[kStateKey];
if (![values isKindOfClass:[NSDictionary class]]) return;
_base.fill(*_k->spec);
for (NSString *key in values) {
id v = values[key];
if ([key isKindOfClass:[NSString class]] && [v isKindOfClass:[NSString class]])
_base.set(key.UTF8String, ((NSString *)v).UTF8String);
}
[self pushBase];
}
#pragma mark - render resources
- (BOOL)allocateRenderResourcesAndReturnError:(NSError **)outError {
if (![super allocateRenderResourcesAndReturnError:outError]) return NO;
_k->musicalContext = self.musicalContextBlock;
_k->seenValues = _k->seenMailbox = 0; // apply settings on the first render
return YES;
}
- (void)deallocateRenderResources {
_k->musicalContext = nil;
[super deallocateRenderResources];
}
@end
+106
View File
@@ -0,0 +1,106 @@
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
// The audio-thread side of a Sizzle AUv3 (SizzleDeviceAU and its subclasses).
// Objective-C++ only (holds an AU host block).
#import <AudioToolbox/AudioToolbox.h>
#include <atomic>
#include <cmath>
#include <string>
#include "sizzle/Params.hpp"
#include "sizzle/Specs.hpp"
namespace sizzle {
/**
* Everything the render thread touches, owned by the AU.
*
* Two ways settings reach the device, neither of them locking:
* - AU parameters (host automation, the editor) are written into [values] (one
* atomic float per parameter, address = index in the spec) and bump [valuesSeq];
* - whole settings (presets, restored state, hidden keys such as the Mix
* Tightener's) are written by the main thread into the spare half of [mailbox]
* and published with [mailboxIdx] / [mailboxSeq].
* The render thread copies the published mailbox into [live], overlays the
* parameter values, and calls apply() only when something changed or the tempo moved.
*/
struct DeviceKernel {
const DeviceSpec *spec = nullptr;
std::string type;
std::atomic<float> values[Params::kMax];
std::atomic<uint32_t> valuesSeq{1};
Params mailbox[2];
std::atomic<int> mailboxIdx{0};
std::atomic<uint32_t> mailboxSeq{1};
// render thread only
Params live;
uint32_t seenValues = 0, seenMailbox = 0;
double tempo = 120.0;
AUHostMusicalContextBlock musicalContext = nil;
virtual ~DeviceKernel() = default;
/** New settings for the device (render thread). */
virtual void apply(const Params &p, float tempoBpm) = 0;
/** Main thread: hand whole settings to the render thread. */
void publish(const Params &p) {
int next = 1 - mailboxIdx.load(std::memory_order_acquire);
mailbox[next] = p;
mailboxIdx.store(next, std::memory_order_release);
mailboxSeq.fetch_add(1, std::memory_order_release);
}
/** The parameter values as Params text: a choice name or a number. */
void overlay(Params &p) {
for (int i = 0; i < spec->paramCount; ++i) {
const ParamSpec &s = spec->params[i];
float v = values[i].load(std::memory_order_relaxed);
if (s.isEnum()) {
int n = s.choiceCount(), idx = (int)std::lround(v);
p.set(s.key, s.choices[idx < 0 ? 0 : (idx >= n ? n - 1 : idx)]);
} else {
p.set(s.key, s.isInt ? std::round(v) : v);
}
}
}
/** Render thread: a host parameter event (automation). */
void setValue(AUParameterAddress a, AUValue v) {
if (a < (AUParameterAddress)spec->paramCount) {
values[a].store(v, std::memory_order_relaxed);
valuesSeq.fetch_add(1, std::memory_order_release);
}
}
/** Render thread: pick up the host tempo; true if it changed. */
bool pollTempo() {
if (!musicalContext) return false;
double bpm = 0;
if (musicalContext(&bpm, nullptr, nullptr, nullptr, nullptr, nullptr) && bpm > 0 && bpm != tempo) {
tempo = bpm;
return true;
}
return false;
}
/** Render thread: apply new settings if anything changed. */
void refresh(bool force) {
uint32_t ms = mailboxSeq.load(std::memory_order_acquire);
uint32_t vs = valuesSeq.load(std::memory_order_acquire);
if (ms == seenMailbox && vs == seenValues && !force) return;
if (ms != seenMailbox) live = mailbox[mailboxIdx.load(std::memory_order_acquire)];
seenMailbox = ms;
seenValues = vs;
overlay(live);
apply(live, (float)tempo);
}
};
} // namespace sizzle
+4 -17
View File
@@ -1,26 +1,13 @@
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
// SPDX-License-Identifier: GPL-3.0-or-later
#import <AudioToolbox/AudioToolbox.h>
#import "SizzleDeviceAU.h"
NS_ASSUME_NONNULL_BEGIN
/// One Sizzle audio effect as an AUv3 (`aufx`): wraps a C++ `sizzle::Effect`
/// chosen by its ToolboxType name ("DELAY", "FILTER", …). Parameters come from the
/// generated device specs; each channel runs its own mono effect instance.
@interface SizzleEffectAU : AUAudioUnit
- (nullable instancetype)initWithComponentDescription:(AudioComponentDescription)desc
toolboxType:(const char *)toolboxType
displayName:(NSString *)displayName
error:(NSError **)outError;
/// The device's name as shown in Sizzle ("Tape Delay").
@property (nonatomic, readonly) NSString *displayName;
/// Formats a parameter value the way Sizzle's editor does (units, %, choices).
- (NSString *)stringForParameter:(AUParameter *)param value:(AUValue)value;
/// One Sizzle audio effect as an AUv3 (`aufx`): a C++ `sizzle::Effect` per channel
/// (the effects are mono, as in Sizzle's mixer: stereo runs dual mono).
@interface SizzleEffectAU : SizzleDeviceAU
@end
NS_ASSUME_NONNULL_END
+19 -285
View File
@@ -2,137 +2,45 @@
// SPDX-License-Identifier: GPL-3.0-or-later
#import "SizzleEffectAU.h"
#import "Components.gen.h"
#import "SizzleDeviceAU+Private.h"
#import <AVFoundation/AVFoundation.h>
#include <atomic>
#include <cmath>
#include <cstring>
#include <memory>
#include <string>
#include <vector>
#include "sizzle/DeviceSpecs.gen.hpp"
#include "sizzle/Effect.hpp"
using namespace sizzle;
namespace {
/**
* Everything the render thread touches, owned by the AU.
*
* Two ways settings reach the effect, neither of them locking:
* - AU parameters (host automation, the UI) are written into [values] (one atomic
* float per parameter, address = index in the spec) and bump [valuesSeq];
* - whole settings (presets, restored state, hidden keys such as the Mix
* Tightener's) are written by the main thread into the spare half of [mailbox]
* and published with [mailboxIdx] / [mailboxSeq].
* The render thread copies the published mailbox into [live], overlays the
* parameter values, and calls Effect::update only when something changed.
*/
struct Kernel {
const DeviceSpec *spec = nullptr;
std::string type;
struct EffectKernel final : DeviceKernel {
std::unique_ptr<Effect> fx[2];
int channels = 0;
std::atomic<float> values[Params::kMax];
std::atomic<uint32_t> valuesSeq{1};
Params mailbox[2];
std::atomic<int> mailboxIdx{0};
std::atomic<uint32_t> mailboxSeq{1};
// render thread only
Params live;
uint32_t seenValues = 0, seenMailbox = 0;
double tempo = 120.0;
std::atomic<bool> bypass{false};
std::vector<float> inBuf[2];
AUHostMusicalContextBlock musicalContext = nil;
void publish(const Params &p) {
int next = 1 - mailboxIdx.load(std::memory_order_acquire);
mailbox[next] = p;
mailboxIdx.store(next, std::memory_order_release);
mailboxSeq.fetch_add(1, std::memory_order_release);
}
/** Parameter i's value as Params text: a choice name or a number. */
void overlay(Params &p) {
for (int i = 0; i < spec->paramCount; ++i) {
const ParamSpec &s = spec->params[i];
float v = values[i].load(std::memory_order_relaxed);
if (s.isEnum()) {
int n = s.choiceCount(), idx = (int)std::lround(v);
p.set(s.key, s.choices[idx < 0 ? 0 : (idx >= n ? n - 1 : idx)]);
} else {
p.set(s.key, s.isInt ? std::round(v) : v);
}
}
}
/** Called at the top of each render cycle. */
void refresh(bool tempoChanged) {
uint32_t ms = mailboxSeq.load(std::memory_order_acquire);
uint32_t vs = valuesSeq.load(std::memory_order_acquire);
if (ms == seenMailbox && vs == seenValues && !tempoChanged) return;
if (ms != seenMailbox) live = mailbox[mailboxIdx.load(std::memory_order_acquire)];
seenMailbox = ms;
seenValues = vs;
overlay(live);
for (int c = 0; c < channels; ++c) fx[c]->update(live, (float)tempo);
void apply(const Params &p, float tempoBpm) override {
for (int c = 0; c < channels; ++c) fx[c]->update(p, tempoBpm);
}
};
int choiceIndex(const ParamSpec &s, const char *name) {
for (int i = 0; s.choices[i]; ++i) if (std::strcmp(s.choices[i], name) == 0) return i;
return 0;
}
} // namespace
@implementation SizzleEffectAU {
std::unique_ptr<Kernel> _k;
AUAudioUnitBusArray *_inputs;
AUAudioUnitBusArray *_outputs;
AUAudioUnitBus *_inBus;
AUAudioUnitBus *_outBus;
AUParameterTree *_tree;
Params _base; // main thread: the full settings (incl. hidden keys)
NSArray<AUAudioUnitPreset *> *_factoryPresets;
AUAudioUnitPreset *_currentPreset;
NSString *_displayName;
}
/// The standard initializer (used by AUAudioUnit registration and the Mac test):
/// picks the device from the component's subtype in components.txt.
- (std::unique_ptr<DeviceKernel>)makeKernel { return std::make_unique<EffectKernel>(); }
- (EffectKernel *)fxKernel { return static_cast<EffectKernel *>(self.kernel); }
- (instancetype)initWithComponentDescription:(AudioComponentDescription)desc
options:(AudioComponentInstantiationOptions)options
error:(NSError **)outError {
for (int i = 0; i < kSizzleComponentCount; ++i)
if (kSizzleComponents[i].subtype == desc.componentSubType)
return [self initWithComponentDescription:desc toolboxType:kSizzleComponents[i].toolboxType
displayName:@(kSizzleComponents[i].name) error:outError];
if (outError) *outError = [NSError errorWithDomain:NSOSStatusErrorDomain code:kAudioUnitErr_InvalidElement userInfo:nil];
return nil;
}
- (instancetype)initWithComponentDescription:(AudioComponentDescription)desc
toolboxType:(const char *)toolboxType
displayName:(NSString *)displayName
error:(NSError **)outError {
self = [super initWithComponentDescription:desc options:0 error:outError];
self = [super initWithComponentDescription:desc options:options error:outError];
if (!self) return nil;
_displayName = displayName;
_k = std::make_unique<Kernel>();
_k->type = toolboxType;
_k->spec = findDevice(toolboxType);
if (!_k->spec) {
if (outError) *outError = [NSError errorWithDomain:NSOSStatusErrorDomain code:kAudioUnitErr_InvalidProperty userInfo:nil];
return nil;
}
AVAudioFormat *fmt = [[AVAudioFormat alloc] initStandardFormatWithSampleRate:44100 channels:2];
_inBus = [[AUAudioUnitBus alloc] initWithFormat:fmt error:outError];
_outBus = [[AUAudioUnitBus alloc] initWithFormat:fmt error:outError];
@@ -141,162 +49,9 @@ int choiceIndex(const ParamSpec &s, const char *name) {
_outBus.maximumChannelCount = 2;
_inputs = [[AUAudioUnitBusArray alloc] initWithAudioUnit:self busType:AUAudioUnitBusTypeInput busses:@[_inBus]];
_outputs = [[AUAudioUnitBusArray alloc] initWithAudioUnit:self busType:AUAudioUnitBusTypeOutput busses:@[_outBus]];
[self buildParameterTree];
_base.fill(*_k->spec);
[self pushBase];
[self buildFactoryPresets];
self.maximumFramesToRender = 4096;
return self;
}
- (NSString *)displayName { return _displayName; }
#pragma mark - parameters
- (void)buildParameterTree {
const DeviceSpec *spec = _k->spec;
NSMutableArray<AUParameter *> *params = [NSMutableArray array];
for (int i = 0; i < spec->paramCount; ++i) {
const ParamSpec &s = spec->params[i];
AUParameter *p;
AudioUnitParameterOptions flags = kAudioUnitParameterFlag_IsReadable | kAudioUnitParameterFlag_IsWritable;
if (s.isEnum()) {
NSMutableArray<NSString *> *names = [NSMutableArray array];
for (int c = 0; s.choices[c]; ++c) [names addObject:@(s.choices[c])];
p = [AUParameterTree createParameterWithIdentifier:@(s.key) name:@(s.label) address:(AUParameterAddress)i
min:0 max:(AUValue)(names.count - 1)
unit:kAudioUnitParameterUnit_Indexed unitName:nil
flags:flags valueStrings:names dependentParameters:nil];
p.value = (AUValue)s.def;
} else {
p = [AUParameterTree createParameterWithIdentifier:@(s.key) name:@(s.label) address:(AUParameterAddress)i
min:s.min max:s.max
unit:s.isInt ? kAudioUnitParameterUnit_Indexed : kAudioUnitParameterUnit_Generic
unitName:nil flags:flags valueStrings:nil dependentParameters:nil];
p.value = s.def;
}
_k->values[i].store(p.value);
[params addObject:p];
}
_tree = [AUParameterTree createTreeWithChildren:params];
Kernel *k = _k.get();
_tree.implementorValueObserver = ^(AUParameter *param, AUValue value) {
if (param.address < (AUParameterAddress)k->spec->paramCount) {
k->values[param.address].store(value, std::memory_order_relaxed);
k->valuesSeq.fetch_add(1, std::memory_order_release);
}
};
_tree.implementorValueProvider = ^AUValue(AUParameter *param) {
return param.address < (AUParameterAddress)k->spec->paramCount ? k->values[param.address].load() : 0;
};
__weak SizzleEffectAU *weakSelf = self;
_tree.implementorStringFromValueCallback = ^NSString *(AUParameter *param, const AUValue *value) {
return [weakSelf stringForParameter:param value:value ? *value : param.value] ?: @"";
};
}
- (AUParameterTree *)parameterTree { return _tree; }
/// Publish [_base] to the render thread and move the AU parameters to match it.
- (void)pushBase {
const DeviceSpec *spec = _k->spec;
for (int i = 0; i < spec->paramCount; ++i) {
const ParamSpec &s = spec->params[i];
AUValue v = s.isEnum() ? (AUValue)choiceIndex(s, _base.s(s.key, s.choices[0])) : _base.f(s.key, s.def);
[_tree parameterWithAddress:(AUParameterAddress)i].value = v; // notifies UI + kernel
}
_k->publish(_base);
}
/// Bring [_base] up to date with the AU parameters (they're the source of truth for
/// the visible keys; _base also holds hidden ones).
- (void)pullBase {
_k->overlay(_base);
}
- (NSString *)stringForParameter:(AUParameter *)param value:(AUValue)value {
if (param.address >= (AUParameterAddress)_k->spec->paramCount) return @"";
const ParamSpec &s = _k->spec->params[param.address];
if (s.isEnum()) {
int n = s.choiceCount(), i = (int)std::lround(value);
return @(s.choices[i < 0 ? 0 : (i >= n ? n - 1 : i)]);
}
const char *label = s.label;
if (strstr(label, "(dB)")) return [NSString stringWithFormat:@"%.1f dB", value];
if (strstr(label, "(ms)")) return [NSString stringWithFormat:@"%.0f ms", value];
if (s.isInt) return s.min < 0 ? [NSString stringWithFormat:@"%+d", (int)std::lround(value)]
: [NSString stringWithFormat:@"%d", (int)std::lround(value)];
if (s.min == 0 && s.max == 1) return [NSString stringWithFormat:@"%d%%", (int)std::lround(value * 100)];
if (s.min == -1 && s.max == 1) return [NSString stringWithFormat:@"%+d%%", (int)std::lround(value * 100)];
return [NSString stringWithFormat:@"%.2f", value];
}
#pragma mark - presets and state
- (void)buildFactoryPresets {
NSMutableArray *list = [NSMutableArray array];
if (_k->type == "MIX_TIGHTENER") {
for (int i = 0; gen::mixTightenerPresets[i]; ++i) {
AUAudioUnitPreset *p = [AUAudioUnitPreset new];
p.number = i;
p.name = @(gen::mixTightenerPresets[i][0]);
[list addObject:p];
}
}
_factoryPresets = list;
}
- (NSArray<AUAudioUnitPreset *> *)factoryPresets { return _factoryPresets; }
- (BOOL)supportsUserPresets { return YES; }
- (AUAudioUnitPreset *)currentPreset { return _currentPreset; }
- (void)setCurrentPreset:(AUAudioUnitPreset *)preset {
if (preset == nil) { _currentPreset = nil; return; }
if (preset.number >= 0) {
if (preset.number < (NSInteger)_factoryPresets.count && _k->type == "MIX_TIGHTENER") {
const char *const *kv = gen::mixTightenerPresets[preset.number];
_base.fill(*_k->spec);
for (int i = 1; kv[i] && kv[i + 1]; i += 2) _base.set(kv[i], kv[i + 1]);
[self pushBase];
}
_currentPreset = preset;
} else {
NSError *err = nil;
NSDictionary *state = [self presetStateFor:preset error:&err];
if (state) self.fullState = state;
_currentPreset = preset;
}
}
static NSString *const kStateKey = @"sizzleValues";
- (NSDictionary<NSString *, id> *)fullState {
NSMutableDictionary *state = [NSMutableDictionary dictionaryWithDictionary:[super fullState] ?: @{}];
[self pullBase];
NSMutableDictionary *values = [NSMutableDictionary dictionary];
for (int i = 0; i < _base.size(); ++i) values[@(_base.keyAt(i))] = @(_base.valueAt(i));
state[kStateKey] = values;
state[@"sizzleType"] = @(_k->type.c_str());
return state;
}
- (void)setFullState:(NSDictionary<NSString *, id> *)fullState {
[super setFullState:fullState];
NSDictionary *values = fullState[kStateKey];
if (![values isKindOfClass:[NSDictionary class]]) return;
_base.fill(*_k->spec);
for (NSString *key in values) {
id v = values[key];
if ([key isKindOfClass:[NSString class]] && [v isKindOfClass:[NSString class]])
_base.set(key.UTF8String, ((NSString *)v).UTF8String);
}
[self pushBase];
}
#pragma mark - busses and render
- (AUAudioUnitBusArray *)inputBusses { return _inputs; }
- (AUAudioUnitBusArray *)outputBusses { return _outputs; }
- (NSArray<NSNumber *> *)channelCapabilities { return @[@1, @1, @2, @2]; }
@@ -304,19 +59,18 @@ static NSString *const kStateKey = @"sizzleValues";
- (void)setShouldBypassEffect:(BOOL)bypass {
[super setShouldBypassEffect:bypass];
_k->bypass.store(bypass);
self.fxKernel->bypass.store(bypass);
}
- (BOOL)allocateRenderResourcesAndReturnError:(NSError **)outError {
if (![super allocateRenderResourcesAndReturnError:outError]) return NO;
AVAudioChannelCount chIn = _inBus.format.channelCount, chOut = _outBus.format.channelCount;
if (chIn != chOut || chOut < 1 || chOut > 2) {
if (outError) *outError = [NSError errorWithDomain:NSOSStatusErrorDomain code:kAudioUnitErr_FailedInitialization userInfo:nil];
self.renderResourcesAllocated = NO;
return NO;
}
if (![super allocateRenderResourcesAndReturnError:outError]) return NO;
EffectKernel *k = self.fxKernel;
int sr = (int)std::lround(_outBus.format.sampleRate);
Kernel *k = _k.get();
k->channels = (int)chOut;
for (int c = 0; c < 2; ++c) {
k->fx[c] = c < k->channels ? Effect::create(k->type.c_str(), sr) : nullptr;
@@ -324,22 +78,19 @@ static NSString *const kStateKey = @"sizzleValues";
}
if (!k->fx[0]) {
if (outError) *outError = [NSError errorWithDomain:NSOSStatusErrorDomain code:kAudioUnitErr_FailedInitialization userInfo:nil];
self.renderResourcesAllocated = NO;
[super deallocateRenderResources];
return NO;
}
k->musicalContext = self.musicalContextBlock;
k->seenValues = k->seenMailbox = 0; // force update() on the first render
return YES;
}
- (void)deallocateRenderResources {
for (auto &f : _k->fx) f.reset();
_k->musicalContext = nil;
for (auto &f : self.fxKernel->fx) f.reset();
[super deallocateRenderResources];
}
- (AUInternalRenderBlock)internalRenderBlock {
Kernel *k = _k.get();
EffectKernel *k = self.fxKernel;
return ^AUAudioUnitStatus(AudioUnitRenderActionFlags *actionFlags, const AudioTimeStamp *timestamp,
AVAudioFrameCount frameCount, NSInteger outputBusNumber,
AudioBufferList *outputData, const AURenderEvent *events,
@@ -360,28 +111,11 @@ static NSString *const kStateKey = @"sizzleValues";
AUAudioUnitStatus err = pullInputBlock(&pullFlags, timestamp, frameCount, 0, &in.list);
if (err != noErr) return err;
// Host automation arrives as render events: apply at block start.
bool changed = false;
for (const AURenderEvent *e = events; e; e = e->head.next) {
if (e->head.eventType == AURenderEventParameter || e->head.eventType == AURenderEventParameterRamp) {
AUParameterAddress a = e->parameter.parameterAddress;
if (a < (AUParameterAddress)k->spec->paramCount) {
k->values[a].store(e->parameter.value, std::memory_order_relaxed);
changed = true;
}
}
}
if (changed) k->valuesSeq.fetch_add(1, std::memory_order_release);
bool tempoChanged = false;
if (k->musicalContext) {
double bpm = 0;
if (k->musicalContext(&bpm, nullptr, nullptr, nullptr, nullptr, nullptr) && bpm > 0 && bpm != k->tempo) {
k->tempo = bpm;
tempoChanged = true;
}
}
k->refresh(tempoChanged);
// Host automation: applied at block start.
for (const AURenderEvent *e = events; e; e = e->head.next)
if (e->head.eventType == AURenderEventParameter || e->head.eventType == AURenderEventParameterRamp)
k->setValue(e->parameter.parameterAddress, e->parameter.value);
k->refresh(k->pollTempo());
bool bypass = k->bypass.load(std::memory_order_relaxed);
for (int c = 0; c < k->channels && c < (int)outputData->mNumberBuffers; ++c) {
+16
View File
@@ -0,0 +1,16 @@
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
// SPDX-License-Identifier: GPL-3.0-or-later
#import <CoreAudioKit/CoreAudioKit.h>
#import "SizzleDeviceAU.h"
NS_ASSUME_NONNULL_BEGIN
/// The extension's principal class (the AU factory) and the generic device editor.
/// The app uses the same editor for the devices it hosts itself.
@interface SizzleFXViewController : AUViewController <AUAudioUnitFactory>
/// Show the editor for an AU created elsewhere (the in-app host). Call once.
- (void)attachAudioUnit:(SizzleDeviceAU *)au;
@end
NS_ASSUME_NONNULL_END
+15 -20
View File
@@ -1,8 +1,9 @@
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
// SPDX-License-Identifier: GPL-3.0-or-later
// The FX extension's principal class: the factory for every effect listed in
// components.txt (picked by subtype) and a generic editor for its parameters
// The extension's principal class: the factory for every device listed in
// components.txt (picked by subtype; instruments and effects) and a generic editor
// for its parameters
// (sliders, segmented switches for short choice lists, menus for long ones).
// The card-style editors of the Android app come later; this keeps every
// parameter reachable meanwhile.
@@ -10,16 +11,13 @@
#import <CoreAudioKit/CoreAudioKit.h>
#import <UIKit/UIKit.h>
#import "Components.gen.h"
#import "SizzleEffectAU.h"
@interface SizzleFXViewController : AUViewController <AUAudioUnitFactory>
@end
#import "SizzleFXViewController.h"
static UIColor *Amber(void) { return [UIColor colorWithRed:0.96 green:0.76 blue:0.29 alpha:1]; }
static UIColor *Dim(void) { return [UIColor colorWithWhite:0.62 alpha:1]; }
@implementation SizzleFXViewController {
SizzleEffectAU *_au;
SizzleDeviceAU *_au;
UIStackView *_stack;
NSMutableDictionary<NSNumber *, UIControl *> *_controls;
NSMutableDictionary<NSNumber *, UILabel *> *_valueLabels;
@@ -30,18 +28,15 @@ static UIColor *Dim(void) { return [UIColor colorWithWhite:0.62 alpha:1]; }
#pragma mark - factory
- (AUAudioUnit *)createAudioUnitWithComponentDescription:(AudioComponentDescription)desc error:(NSError **)error {
for (int i = 0; i < kSizzleComponentCount; ++i) {
if (kSizzleComponents[i].subtype == desc.componentSubType) {
_au = [[SizzleEffectAU alloc] initWithComponentDescription:desc
toolboxType:kSizzleComponents[i].toolboxType
displayName:@(kSizzleComponents[i].name)
error:error];
dispatch_async(dispatch_get_main_queue(), ^{ [self buildIfReady]; });
return _au;
}
}
if (error) *error = [NSError errorWithDomain:NSOSStatusErrorDomain code:kAudioUnitErr_InvalidElement userInfo:nil];
return nil;
_au = [[[SizzleDeviceAU classForComponentType:desc.componentType] alloc]
initWithComponentDescription:desc options:0 error:error];
if (_au) dispatch_async(dispatch_get_main_queue(), ^{ [self buildIfReady]; });
return _au;
}
- (void)attachAudioUnit:(SizzleDeviceAU *)au {
_au = au;
[self buildIfReady];
}
#pragma mark - view
@@ -96,7 +91,7 @@ static UIColor *Dim(void) { return [UIColor colorWithWhite:0.62 alpha:1]; }
presets.tintColor = Amber();
presets.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
NSMutableArray<UIAction *> *items = [NSMutableArray array];
__weak SizzleEffectAU *au = _au;
__weak SizzleDeviceAU *au = _au;
__weak UIButton *weakButton = presets;
for (AUAudioUnitPreset *p in _au.factoryPresets) {
[items addObject:[UIAction actionWithTitle:p.name image:nil identifier:nil handler:^(UIAction *a) {
+20
View File
@@ -0,0 +1,20 @@
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
// SPDX-License-Identifier: GPL-3.0-or-later
#import "SizzleDeviceAU.h"
NS_ASSUME_NONNULL_BEGIN
/// One Sizzle instrument as an AUv3 (`aumu`): a C++ `sizzle::Instrument` (8 voices,
/// as one Sizzle mixer channel) played by MIDI, sample-accurately. The instruments
/// are mono; the output carries the same signal on both channels.
@interface SizzleInstrumentAU : SizzleDeviceAU
/// Where the Sampler, SF2/XI loader and Grain Cloud find samples (a
/// `sizzle::sampler::SampleStore *`; it must outlive the AU). Set before
/// allocateRenderResources. Without one those instruments stay silent.
@property (nonatomic, nullable) void *sampleStore;
@end
NS_ASSUME_NONNULL_END
+139
View File
@@ -0,0 +1,139 @@
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
// SPDX-License-Identifier: GPL-3.0-or-later
#import "SizzleInstrumentAU.h"
#import "SizzleDeviceAU+Private.h"
#import <AVFoundation/AVFoundation.h>
#include <cstring>
#include <vector>
#include "sizzle/Instrument.hpp"
using namespace sizzle;
namespace {
struct InstrumentKernel final : DeviceKernel {
std::unique_ptr<Instrument> inst;
std::vector<float> outBuf; // for hosts that pass null output buffers
void apply(const Params &p, float tempoBpm) override { if (inst) inst->update(p, tempoBpm); }
/** One MIDI message (any channel). */
void midi(const uint8_t *d, int len) {
if (!inst || len < 1) return;
uint8_t status = d[0] & 0xF0;
if (status == 0x90 && len >= 3 && d[2] > 0) inst->noteOn(d[1], d[2]);
else if ((status == 0x80 || status == 0x90) && len >= 3) inst->noteOff(d[1]);
else if (status == 0xB0 && len >= 3) {
if (d[1] == 123) inst->allNotesOff(); // all notes off
else if (d[1] == 120) inst->kill(); // all sound off
}
}
};
} // namespace
@implementation SizzleInstrumentAU {
AUAudioUnitBusArray *_outputs;
AUAudioUnitBus *_outBus;
}
- (std::unique_ptr<DeviceKernel>)makeKernel { return std::make_unique<InstrumentKernel>(); }
- (InstrumentKernel *)instKernel { return static_cast<InstrumentKernel *>(self.kernel); }
- (instancetype)initWithComponentDescription:(AudioComponentDescription)desc
options:(AudioComponentInstantiationOptions)options
error:(NSError **)outError {
self = [super initWithComponentDescription:desc options:options error:outError];
if (!self) return nil;
AVAudioFormat *fmt = [[AVAudioFormat alloc] initStandardFormatWithSampleRate:44100 channels:2];
_outBus = [[AUAudioUnitBus alloc] initWithFormat:fmt error:outError];
if (!_outBus) return nil;
_outBus.maximumChannelCount = 2;
_outputs = [[AUAudioUnitBusArray alloc] initWithAudioUnit:self busType:AUAudioUnitBusTypeOutput busses:@[_outBus]];
return self;
}
- (AUAudioUnitBusArray *)outputBusses { return _outputs; }
- (NSArray<NSNumber *> *)channelCapabilities { return @[@0, @1, @0, @2]; }
- (BOOL)allocateRenderResourcesAndReturnError:(NSError **)outError {
if (![super allocateRenderResourcesAndReturnError:outError]) return NO;
InstrumentKernel *k = self.instKernel;
k->inst = Instrument::create(k->type.c_str(), (int)std::lround(_outBus.format.sampleRate),
static_cast<sampler::SampleStore *>(self.sampleStore));
k->outBuf.assign(self.maximumFramesToRender, 0.f);
if (!k->inst) {
if (outError) *outError = [NSError errorWithDomain:NSOSStatusErrorDomain code:kAudioUnitErr_FailedInitialization userInfo:nil];
[super deallocateRenderResources];
return NO;
}
return YES;
}
- (void)deallocateRenderResources {
self.instKernel->inst.reset();
[super deallocateRenderResources];
}
- (AUInternalRenderBlock)internalRenderBlock {
InstrumentKernel *k = self.instKernel;
return ^AUAudioUnitStatus(AudioUnitRenderActionFlags *actionFlags, const AudioTimeStamp *timestamp,
AVAudioFrameCount frameCount, NSInteger outputBusNumber,
AudioBufferList *outputData, const AURenderEvent *events,
AURenderPullInputBlock pullInputBlock) {
Instrument *inst = k->inst.get();
if (!inst) return kAudioUnitErr_Uninitialized;
UInt32 nb = outputData->mNumberBuffers;
if (nb < 1) return noErr;
if (frameCount > k->outBuf.size()) return kAudioUnitErr_TooManyFramesToProcess;
// Hosts may pass null buffers: then the AU supplies its own.
if (!outputData->mBuffers[0].mData) outputData->mBuffers[0].mData = k->outBuf.data();
float *out0 = (float *)outputData->mBuffers[0].mData;
k->refresh(k->pollTempo());
inst->blockStart((int)frameCount);
// Render between events so each note starts on its own sample.
const AUEventSampleTime start = (AUEventSampleTime)timestamp->mSampleTime;
const AURenderEvent *e = events;
AVAudioFrameCount frame = 0;
while (frame < frameCount) {
while (e && e->head.eventSampleTime - start <= (AUEventSampleTime)frame) {
switch (e->head.eventType) {
case AURenderEventMIDI:
k->midi(e->MIDI.data, e->MIDI.length);
break;
case AURenderEventParameter:
case AURenderEventParameterRamp:
k->setValue(e->parameter.parameterAddress, e->parameter.value);
k->refresh(false);
break;
default: break;
}
e = e->head.next;
}
AVAudioFrameCount end = frameCount;
if (e) {
AUEventSampleTime t = e->head.eventSampleTime - start;
if (t < (AUEventSampleTime)end) end = (AVAudioFrameCount)std::max<AUEventSampleTime>(t, frame + 1);
}
for (AVAudioFrameCount i = frame; i < end; ++i) {
float y = inst->render();
out0[i] = std::isfinite(y) ? y : 0.f;
}
frame = end;
}
outputData->mBuffers[0].mDataByteSize = frameCount * sizeof(float);
for (UInt32 c = 1; c < nb; ++c) {
if (!outputData->mBuffers[c].mData) outputData->mBuffers[c].mData = out0;
else std::memcpy(outputData->mBuffers[c].mData, out0, frameCount * sizeof(float));
outputData->mBuffers[c].mDataByteSize = frameCount * sizeof(float);
}
(void)actionFlags; (void)outputBusNumber; (void)pullInputBlock;
return noErr;
};
}
@end
+2
View File
@@ -1 +1,3 @@
#import "ObjC/SPKTry.h"
#import "SizzleHost.h"
#import "SizzleFXViewController.h"
+86 -11
View File
@@ -2,36 +2,111 @@
// SPDX-License-Identifier: GPL-3.0-or-later
import SwiftUI
import UniformTypeIdentifiers
/// The container app: what Sizzle installs as plugins, and an on-device check
/// that each one loads and processes sound. The plugins themselves are used from
/// a host (AUM, GarageBand, Loopy, …).
/// The app for now: play any Sizzle instrument through any Sizzle effect from the
/// keyboard or a MIDI controller, edit them, load samples, and measure each device
/// on this iPad. The tracker and the rest of Sizzle come in later milestones.
struct ContentView: View {
@StateObject private var model = HostModel()
@StateObject private var check = PluginCheck()
@State private var importing = false
@State private var pad = 0
@State private var showReport = false
var body: some View {
VStack(alignment: .leading, spacing: 12) {
VStack(alignment: .leading, spacing: 10) {
header
controls
editor
HStack {
Button("−") { model.octave = max(0, model.octave - 1) }.buttonStyle(.bordered)
Text("C\(model.octave)").font(.system(.body, design: .monospaced)).frame(width: 40)
Button("+") { model.octave = min(7, model.octave + 1) }.buttonStyle(.bordered)
Spacer()
Text(model.host.midiSources.isEmpty ? "No MIDI input" : "MIDI: " + model.host.midiSources.joined(separator: ", "))
.font(.system(.caption, design: .monospaced)).foregroundColor(.gray).lineLimit(1)
}
KeyboardView(octave: model.octave,
noteOn: { model.host.note(on: Int32($0), velocity: 100) },
noteOff: { model.host.noteOff(Int32($0)) })
.frame(height: 150)
}
.padding()
.preferredColorScheme(.dark)
.fileImporter(isPresented: $importing, allowedContentTypes: [.audio, .data]) { result in
if case .success(let url) = result { model.loadSample(url, pad: pad) }
}
.sheet(isPresented: $showReport) { reportSheet }
.alert(model.message ?? "", isPresented: Binding(get: { model.message != nil }, set: { if !$0 { model.message = nil } })) {
Button("OK") { model.message = nil }
}
}
private var header: some View {
HStack(alignment: .firstTextBaseline) {
Text("Sizzle").font(.system(.largeTitle, design: .monospaced)).foregroundColor(.orange)
Text("AUv3 plugins for AUM, GarageBand, Loopy and other hosts.\nLook for \"Tired Sysadmin: Sizzle …\".")
.font(.system(.footnote, design: .monospaced)).foregroundColor(.gray)
Text(versionLine).font(.system(.caption, design: .monospaced)).foregroundColor(.gray)
Button("Check all plugins") { Task { await check.run() } }
.buttonStyle(.bordered).disabled(check.running)
Spacer()
Button("Benchmark") { model.benchmark(); showReport = true }.disabled(model.busy)
Button("Check plugins") { showReport = true; Task { await check.run() } }
}
}
private var controls: some View {
HStack {
Menu {
ForEach(model.instruments, id: \.subtype) { d in Button(d.name) { model.select(d) } }
} label: { Label(model.instrument?.name ?? "Instrument", systemImage: "pianokeys") }
Image(systemName: "arrow.right").foregroundColor(.gray)
Menu {
Button("No effect") { model.selectEffect(nil) }
ForEach(model.effects, id: \.subtype) { d in Button(d.name) { model.selectEffect(d) } }
} label: { Label(model.effect?.name ?? "No effect", systemImage: "slider.horizontal.3") }
Spacer()
if model.effect != nil {
Picker("Edit", selection: $model.editingEffect) {
Text("Instrument").tag(false)
Text("Effect").tag(true)
}.pickerStyle(.segmented).frame(width: 220)
}
if model.canLoadSample {
if model.instrument?.toolboxType == "SAMPLER" {
Stepper("Pad \(pad + 1)", value: $pad, in: 0...15).frame(width: 150)
}
Button("Load sample…") { importing = true }
}
}
}
@ViewBuilder private var editor: some View {
if let unit = model.editedUnit {
DeviceEditorView(unit: unit)
.id(ObjectIdentifier(unit))
.frame(maxHeight: .infinity)
} else {
Spacer()
}
}
private var reportSheet: some View {
VStack(alignment: .leading, spacing: 8) {
Text("Benchmark and plugin check").font(.headline)
ScrollView {
Text(check.lines.joined(separator: "\n"))
Text((model.report + [""] + check.lines).joined(separator: "\n"))
.font(.system(.footnote, design: .monospaced))
.frame(maxWidth: .infinity, alignment: .leading)
.textSelection(.enabled)
}
if model.busy { ProgressView() }
}
.padding()
.preferredColorScheme(.dark)
.onAppear { check.listInstalled() }
}
private var versionLine: String {
let v = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "?"
let b = Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "?"
return "version \(v) (\(b)) · iOS \(ProcessInfo.processInfo.operatingSystemVersionString)"
return "\(v) (\(b))"
}
}
+17
View File
@@ -0,0 +1,17 @@
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
// SPDX-License-Identifier: GPL-3.0-or-later
import SwiftUI
/// The plugins' own editor (SizzleFXViewController) for a device the app hosts.
struct DeviceEditorView: UIViewControllerRepresentable {
let unit: SizzleDeviceAU
func makeUIViewController(context: Context) -> SizzleFXViewController {
let vc = SizzleFXViewController()
vc.attachAudioUnit(unit)
return vc
}
func updateUIViewController(_ vc: SizzleFXViewController, context: Context) {}
}
+64
View File
@@ -0,0 +1,64 @@
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
// SPDX-License-Identifier: GPL-3.0-or-later
import SwiftUI
/// The app's state around SizzleHost: which devices play, which editor shows,
/// and the results of the benchmark / plugin check.
@MainActor
final class HostModel: ObservableObject {
let host = SizzleHost()
let devices = SizzleHost.devices
var instruments: [SizzleHostDevice] { devices.filter { $0.isInstrument } }
var effects: [SizzleHostDevice] { devices.filter { !$0.isInstrument } }
@Published var instrument: SizzleHostDevice?
@Published var effect: SizzleHostDevice?
/// Which device's editor is shown: false = the instrument, true = the effect.
@Published var editingEffect = false
@Published var octave = 4
@Published var report: [String] = []
@Published var busy = false
@Published var message: String?
init() {
if let first = instruments.first { select(first) }
}
func select(_ device: SizzleHostDevice) {
host.selectInstrument(device) { [weak self] error in
guard let self = self else { return }
if let error = error { self.message = error.localizedDescription; return }
self.instrument = device
self.editingEffect = false
}
}
func selectEffect(_ device: SizzleHostDevice?) {
host.selectEffect(device) { [weak self] error in
guard let self = self else { return }
if let error = error { self.message = error.localizedDescription; return }
self.effect = device
self.editingEffect = device != nil
}
}
var editedUnit: SizzleDeviceAU? { editingEffect ? host.effect : host.instrument }
var canLoadSample: Bool {
let t = instrument?.toolboxType
return t == "SAMPLER" || t == "SOUNDFONT"
}
func loadSample(_ url: URL, pad: Int) {
do { try host.loadSample(from: url, pad: Int32(pad)) }
catch { message = error.localizedDescription }
}
func benchmark() {
busy = true
report = []
host.benchmark({ [weak self] line in self?.report.append(line) },
done: { [weak self] in self?.busy = false })
}
}
+26
View File
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
</array>
</dict>
</plist>
+59
View File
@@ -0,0 +1,59 @@
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
// SPDX-License-Identifier: GPL-3.0-or-later
import SwiftUI
/// Two octaves of piano keys from C of [octave] (MIDI 60 = C4). Each key tracks its
/// own touch, so chords work; a key sends note-on on touch and note-off on release.
struct KeyboardView: View {
let octave: Int
let noteOn: (Int) -> Void
let noteOff: (Int) -> Void
private let whiteSteps = [0, 2, 4, 5, 7, 9, 11]
private let blackSteps: [(step: Int, afterWhite: Int)] = [(1, 0), (3, 1), (6, 3), (8, 4), (10, 5)]
var body: some View {
GeometryReader { geo in
let whites = 14
let w = geo.size.width / CGFloat(whites)
let base = (octave + 1) * 12
ZStack(alignment: .topLeading) {
HStack(spacing: 1) {
ForEach(0..<whites, id: \.self) { i in
Key(note: base + (i / 7) * 12 + whiteSteps[i % 7], black: false, noteOn: noteOn, noteOff: noteOff)
.frame(width: w - 1, height: geo.size.height)
}
}
ForEach(0..<10, id: \.self) { i in
let o = i / 5, b = blackSteps[i % 5]
Key(note: base + o * 12 + b.step, black: true, noteOn: noteOn, noteOff: noteOff)
.frame(width: w * 0.6, height: geo.size.height * 0.6)
.offset(x: CGFloat(o * 7 + b.afterWhite + 1) * w - w * 0.3)
}
}
}
}
private struct Key: View {
let note: Int
let black: Bool
let noteOn: (Int) -> Void
let noteOff: (Int) -> Void
@State private var down = false
var body: some View {
Rectangle()
.fill(down ? Color.orange : (black ? Color(white: 0.12) : Color(white: 0.92)))
.overlay(alignment: .bottom) {
if !black && note % 12 == 0 {
Text("C\(note / 12 - 1)").font(.system(size: 10, design: .monospaced))
.foregroundColor(.gray).padding(.bottom, 4)
}
}
.gesture(DragGesture(minimumDistance: 0)
.onChanged { _ in if !down { down = true; noteOn(note) } }
.onEnded { _ in down = false; noteOff(note) })
}
}
}
+16 -9
View File
@@ -18,19 +18,19 @@ final class PluginCheck: ObservableObject {
componentManufacturer: Self.manufacturer,
componentFlags: 0, componentFlagsMask: 0)
return AVAudioUnitComponentManager.shared().components(matching: any)
.filter { $0.audioComponentDescription.componentType == kAudioUnitType_Effect }
.filter { [kAudioUnitType_Effect, kAudioUnitType_MusicDevice].contains($0.audioComponentDescription.componentType) }
}
func listInstalled() {
let comps = installed()
lines = ["Registered effects: \(comps.count)"] + comps.map { " \($0.name)" }
lines = ["Registered plugins (extension): \(comps.count)"] + comps.map { " \($0.name)" }
}
func run() async {
running = true
defer { running = false }
let comps = installed()
lines = ["Checking \(comps.count) effects…"]
lines = ["Plugin extension (as AUM loads it): \(comps.count) registered"]
var ok = 0
for c in comps {
let result = await check(c)
@@ -86,13 +86,20 @@ final class PluginCheck: ObservableObject {
let ex = SPKTry {
do {
try engine.enableManualRenderingMode(.offline, format: format, maximumFrameCount: 4096)
engine.attach(player)
engine.attach(unit)
engine.connect(player, to: unit, format: format)
engine.connect(unit, to: engine.mainMixerNode, format: format)
try engine.start()
player.scheduleBuffer(self.testBuffer(format: format), completionHandler: nil)
player.play()
if let inst = unit as? AVAudioUnitMIDIInstrument {
engine.connect(unit, to: engine.mainMixerNode, format: format)
try engine.start()
inst.startNote(60, withVelocity: 100, onChannel: 0)
inst.startNote(64, withVelocity: 100, onChannel: 0)
} else {
engine.attach(player)
engine.connect(player, to: unit, format: format)
engine.connect(unit, to: engine.mainMixerNode, format: format)
try engine.start()
player.scheduleBuffer(self.testBuffer(format: format), completionHandler: nil)
player.play()
}
} catch { thrown = error }
}
if let ex = ex { return "FAIL exception \(ex)" }
+53
View File
@@ -0,0 +1,53 @@
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
// SPDX-License-Identifier: GPL-3.0-or-later
#import <AVFoundation/AVFoundation.h>
#import "SizzleDeviceAU.h"
NS_ASSUME_NONNULL_BEGIN
/// One Sizzle device the app can host (from components.txt).
NS_SWIFT_SENDABLE
@interface SizzleHostDevice : NSObject
@property (nonatomic, readonly) NSString *name;
@property (nonatomic, readonly) NSString *toolboxType;
@property (nonatomic, readonly) OSType subtype;
@property (nonatomic, readonly) BOOL isInstrument;
@end
/**
* The app's own host: Sizzle's devices registered in this process (manufacturer
* 'Tsyl', so they never collide with the extension's 'Tsys' copies and don't depend
* on the system plugin registry), played through AVAudioEngine:
* instrument → optional effect → output. Notes come from the on-screen keyboard
* and every connected MIDI source. Main thread only.
*/
NS_SWIFT_UI_ACTOR
@interface SizzleHost : NSObject
@property (class, nonatomic, readonly) NSArray<SizzleHostDevice *> *devices;
@property (nonatomic, readonly, nullable) SizzleDeviceAU *instrument;
@property (nonatomic, readonly, nullable) SizzleDeviceAU *effect;
@property (nonatomic, readonly) NSArray<NSString *> *midiSources;
/// Swap the instrument / the effect (nil = no effect). Completion on the main thread.
- (void)selectInstrument:(SizzleHostDevice *)device completion:(NS_SWIFT_UI_ACTOR void (^)(NSError *_Nullable))completion;
- (void)selectEffect:(nullable SizzleHostDevice *)device completion:(NS_SWIFT_UI_ACTOR void (^)(NSError *_Nullable))completion;
- (void)noteOn:(int)note velocity:(int)velocity;
- (void)noteOff:(int)note;
- (void)allNotesOff;
/// Load a WAV (Sampler: into pad [pad]) or SF2/XI (SF2/XI loader) into the current
/// instrument. Returns NO with a message in [error] if the file can't be used.
- (BOOL)loadSampleFromURL:(NSURL *)url pad:(int)pad error:(NSError **)error;
/// Render every device offline for 10 s of audio (instruments with 8 notes held,
/// effects on noise) and report each one's cost as a share of one CPU core.
/// Lines arrive on the main thread; runs on a background thread.
- (void)benchmark:(NS_SWIFT_UI_ACTOR void (^)(NSString *line))line done:(NS_SWIFT_UI_ACTOR void (^)(void))done;
@end
NS_ASSUME_NONNULL_END
+335
View File
@@ -0,0 +1,335 @@
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
// SPDX-License-Identifier: GPL-3.0-or-later
#import "SizzleHost.h"
#import "Components.gen.h"
#import "SizzleInstrumentAU.h"
#import <CoreMIDI/CoreMIDI.h>
#import <mach/mach_time.h>
#import <sys/sysctl.h>
#include <cmath>
#include <optional>
#include <string>
#include <vector>
#include "sampler/SampleStore.hpp"
#include "sampler/SoundFontLoader.hpp"
#include "echofield/GrainSources.hpp"
#include "wavetable/WaveTables.hpp"
using namespace sizzle;
/// In-process registrations use their own manufacturer code, so they never clash
/// with the extension's ('Tsys') when both are visible in this process.
static const OSType kLocalManufacturer = 'Tsyl';
/// Samples for the Sampler, SF2/XI loader and Grain Cloud custom sources. Lives for
/// the whole process, as the AUs require.
static sampler::SampleStore &store() {
static sampler::SampleStore *s = new sampler::SampleStore();
return *s;
}
static AudioComponentDescription descFor(const SizzleComponent &c) {
return AudioComponentDescription{c.type, c.subtype, kLocalManufacturer, 0, 0};
}
static void registerDevices() {
static dispatch_once_t once;
dispatch_once(&once, ^{
for (int i = 0; i < kSizzleComponentCount; ++i) {
const SizzleComponent &c = kSizzleComponents[i];
[AUAudioUnit registerSubclass:[SizzleDeviceAU classForComponentType:c.type]
asComponentDescription:descFor(c) name:@(c.name) version:1];
}
});
}
static NSError *hostError(NSString *msg) {
return [NSError errorWithDomain:@"cc.tiredsysadmin.ios.sizzle" code:1 userInfo:@{NSLocalizedDescriptionKey: msg}];
}
@implementation SizzleHostDevice {
@public
int _index;
}
- (NSString *)name { return @(kSizzleComponents[_index].name); }
- (NSString *)toolboxType { return @(kSizzleComponents[_index].toolboxType); }
- (OSType)subtype { return kSizzleComponents[_index].subtype; }
- (BOOL)isInstrument { return kSizzleComponents[_index].type == kAudioUnitType_MusicDevice; }
@end
@interface SizzleHost ()
@property (atomic, copy, nullable) AUScheduleMIDIEventBlock midiBlock;
@end
@implementation SizzleHost {
AVAudioEngine *_engine;
AVAudioUnit *_instNode;
AVAudioUnit *_fxNode;
MIDIClientRef _midiClient;
MIDIPortRef _midiPort;
NSArray<NSString *> *_midiSources;
}
+ (NSArray<SizzleHostDevice *> *)devices {
NSMutableArray *list = [NSMutableArray array];
for (int i = 0; i < kSizzleComponentCount; ++i) {
SizzleHostDevice *d = [SizzleHostDevice new];
d->_index = i;
[list addObject:d];
}
return list;
}
- (instancetype)init {
self = [super init];
if (!self) return nil;
registerDevices();
_engine = [AVAudioEngine new];
_midiSources = @[];
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
[[AVAudioSession sharedInstance] setActive:YES error:nil];
[self startMIDI];
return self;
}
- (SizzleDeviceAU *)instrument { return (SizzleDeviceAU *)_instNode.AUAudioUnit; }
- (SizzleDeviceAU *)effect { return (SizzleDeviceAU *)_fxNode.AUAudioUnit; }
- (NSArray<NSString *> *)midiSources { return _midiSources; }
#pragma mark - graph
- (void)instantiate:(SizzleHostDevice *)device completion:(void (^)(AVAudioUnit *_Nullable, NSError *_Nullable))completion {
AudioComponentDescription d = descFor(kSizzleComponents[device->_index]);
// Subclasses registered in this process always load in-process.
[AVAudioUnit instantiateWithComponentDescription:d options:0
completionHandler:^(AVAudioUnit *unit, NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{ completion(unit, error); });
}];
}
- (void)rebuild {
[_engine stop];
for (AVAudioNode *n in [_engine.attachedNodes copy])
if (n != _engine.mainMixerNode && n != _engine.outputNode && n != _engine.inputNode) [_engine detachNode:n];
if (!_instNode) return;
[_engine attachNode:_instNode];
AVAudioNode *last = _instNode;
if (_fxNode) {
[_engine attachNode:_fxNode];
[_engine connect:_instNode to:_fxNode format:nil];
last = _fxNode;
}
[_engine connect:last to:_engine.mainMixerNode format:nil];
NSError *err = nil;
if (![_engine startAndReturnError:&err]) NSLog(@"engine start: %@", err);
self.midiBlock = _instNode.AUAudioUnit.scheduleMIDIEventBlock;
}
- (void)selectInstrument:(SizzleHostDevice *)device completion:(void (^)(NSError *))completion {
[self instantiate:device completion:^(AVAudioUnit *unit, NSError *error) {
if (!unit) { completion(error ?: hostError(@"Couldn't load the instrument.")); return; }
((SizzleInstrumentAU *)unit.AUAudioUnit).sampleStore = &store();
self.midiBlock = nil;
self->_instNode = unit;
[self rebuild];
completion(nil);
}];
}
- (void)selectEffect:(SizzleHostDevice *)device completion:(void (^)(NSError *))completion {
if (!device) { _fxNode = nil; [self rebuild]; completion(nil); return; }
[self instantiate:device completion:^(AVAudioUnit *unit, NSError *error) {
if (!unit) { completion(error ?: hostError(@"Couldn't load the effect.")); return; }
self->_fxNode = unit;
[self rebuild];
completion(nil);
}];
}
#pragma mark - notes
- (void)send:(uint8_t)status d1:(uint8_t)d1 d2:(uint8_t)d2 {
AUScheduleMIDIEventBlock b = self.midiBlock;
if (!b) return;
uint8_t bytes[3] = {status, d1, d2};
b(AUEventSampleTimeImmediate, 0, 3, bytes);
}
- (void)noteOn:(int)note velocity:(int)velocity { [self send:0x90 d1:(uint8_t)note d2:(uint8_t)velocity]; }
- (void)noteOff:(int)note { [self send:0x80 d1:(uint8_t)note d2:0]; }
- (void)allNotesOff { [self send:0xB0 d1:123 d2:0]; }
#pragma mark - MIDI input
- (void)startMIDI {
__weak SizzleHost *weakSelf = self;
MIDIClientCreateWithBlock(CFSTR("Sizzle"), &_midiClient, ^(const MIDINotification *n) {
if (n->messageID == kMIDIMsgSetupChanged)
dispatch_async(dispatch_get_main_queue(), ^{ [weakSelf connectSources]; });
});
MIDIInputPortCreateWithBlock(_midiClient, CFSTR("Sizzle in"), &_midiPort, ^(const MIDIPacketList *list, void *src) {
AUScheduleMIDIEventBlock b = weakSelf.midiBlock;
if (!b) return;
const MIDIPacket *p = &list->packet[0];
for (UInt32 i = 0; i < list->numPackets; ++i) {
// Split the packet into channel messages (running status not used by
// keyboards in practice; system messages are skipped).
for (UInt16 j = 0; j < p->length;) {
uint8_t st = p->data[j];
if (st < 0x80 || st >= 0xF0) { ++j; continue; }
int len = (st & 0xF0) == 0xC0 || (st & 0xF0) == 0xD0 ? 2 : 3;
if (j + len > p->length) break;
b(AUEventSampleTimeImmediate, 0, (NSInteger)len, &p->data[j]);
j += (UInt16)len;
}
p = MIDIPacketNext(p);
}
});
[self connectSources];
}
- (void)connectSources {
NSMutableArray *names = [NSMutableArray array];
ItemCount n = MIDIGetNumberOfSources();
for (ItemCount i = 0; i < n; ++i) {
MIDIEndpointRef src = MIDIGetSource(i);
MIDIPortConnectSource(_midiPort, src, nullptr);
CFStringRef name = nullptr;
MIDIObjectGetStringProperty(src, kMIDIPropertyDisplayName, &name);
if (name) [names addObject:(__bridge_transfer NSString *)name];
}
_midiSources = names;
}
#pragma mark - samples
- (BOOL)loadSampleFromURL:(NSURL *)url pad:(int)pad error:(NSError **)error {
SizzleDeviceAU *au = self.instrument;
NSString *type = au.toolboxType;
if (![type isEqualToString:@"SAMPLER"] && ![type isEqualToString:@"SOUNDFONT"]) {
if (error) *error = hostError(@"Pick the Sampler or the SF2/XI loader first.");
return NO;
}
BOOL scoped = [url startAccessingSecurityScopedResource];
NSData *data = [NSData dataWithContentsOfURL:url options:NSDataReadingMappedIfSafe error:error];
if (scoped) [url stopAccessingSecurityScopedResource];
if (!data) return NO;
const uint8_t *bytes = (const uint8_t *)data.bytes;
std::string id = std::string(url.lastPathComponent.UTF8String) + "#" + NSUUID.UUID.UUIDString.UTF8String;
NSMutableDictionary *state = [au.fullState mutableCopy];
NSMutableDictionary *values = [state[@"sizzleValues"] mutableCopy] ?: [NSMutableDictionary dictionary];
if ([type isEqualToString:@"SOUNDFONT"]) {
std::optional<sampler::SoundFontLoader::Loaded> loaded = sampler::SoundFontLoader::load(bytes, data.length);
if (!loaded) {
if (auto wav = sampler::SampleStore::decodeWav(bytes, data.length)) loaded = sampler::SoundFontLoader::Loaded{std::move(*wav), 60};
}
if (!loaded) { if (error) *error = hostError(@"Not an SF2, XI or WAV file Sizzle can read."); return NO; }
int root = loaded->rootNote;
store().put(id, std::move(loaded->sample));
values[@"sfSample"] = @(id.c_str());
values[@"sfRoot"] = [NSString stringWithFormat:@"%d.0", root];
} else {
std::optional<Sample> wav = sampler::SampleStore::decodeWav(bytes, data.length);
if (!wav) { if (error) *error = hostError(@"Not a WAV file Sizzle can read."); return NO; }
store().put(id, std::move(*wav));
values[[NSString stringWithFormat:@"pad%d", pad]] = @(id.c_str());
}
state[@"sizzleValues"] = values;
au.fullState = state;
return YES;
}
#pragma mark - benchmark
static NSString *machine() {
size_t n = 0;
sysctlbyname("hw.machine", nullptr, &n, nullptr, 0);
std::string s(n, '\0');
sysctlbyname("hw.machine", s.data(), &n, nullptr, 0);
return @(s.c_str());
}
/// Seconds to render [seconds] of audio through [au] in 256-frame blocks.
static double timeRender(SizzleDeviceAU *au, BOOL instrument, double seconds) {
const int sr = 44100, n = 256;
au.maximumFramesToRender = 4096;
NSError *err = nil;
if (![au allocateRenderResourcesAndReturnError:&err]) return -1;
if (instrument) {
AUScheduleMIDIEventBlock midi = au.scheduleMIDIEventBlock;
for (int k = 0; k < 8; ++k) { // a held 8-note chord, within the Sampler's pads
uint8_t on[3] = {0x90, (uint8_t)(36 + k * 2), 100};
midi(AUEventSampleTimeImmediate, 0, 3, on);
}
}
std::vector<float> L(n), R(n), noise(n);
uint32_t seed = 1;
for (float &v : noise) { seed = seed * 1103515245u + 12345u; v = ((seed >> 8) & 0xFFFF) / 65535.f - 0.5f; }
float *src = noise.data();
AURenderPullInputBlock pull = ^AUAudioUnitStatus(AudioUnitRenderActionFlags *f, const AudioTimeStamp *t,
AUAudioFrameCount frames, NSInteger bus, AudioBufferList *data) {
for (UInt32 c = 0; c < data->mNumberBuffers; ++c) data->mBuffers[c].mData = src;
return noErr;
};
AURenderBlock render = au.renderBlock;
const int blocks = (int)(seconds * sr / n);
uint64_t t0 = mach_absolute_time();
for (int b = 0; b < blocks; ++b) {
struct { AudioBufferList list; AudioBuffer extra; } out;
out.list.mNumberBuffers = 2;
out.list.mBuffers[0] = {1, (UInt32)(n * 4), L.data()};
out.list.mBuffers[1] = {1, (UInt32)(n * 4), R.data()};
AudioTimeStamp ts = {};
ts.mSampleTime = (Float64)b * n;
ts.mFlags = kAudioTimeStampSampleTimeValid;
AudioUnitRenderActionFlags flags = 0;
render(&flags, &ts, n, 0, &out.list, instrument ? (AURenderPullInputBlock)nil : pull);
}
uint64_t t1 = mach_absolute_time();
[au deallocateRenderResources];
mach_timebase_info_data_t tb;
mach_timebase_info(&tb);
return (double)(t1 - t0) * tb.numer / tb.denom / 1e9;
}
- (void)benchmark:(void (^)(NSString *))line done:(void (^)(void))done {
void (^say)(NSString *) = ^(NSString *s) { dispatch_async(dispatch_get_main_queue(), ^{ line(s); }); };
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
say([NSString stringWithFormat:@"%@ · %lu cores · 10 s of 44.1 kHz audio per device",
machine(), (unsigned long)NSProcessInfo.processInfo.activeProcessorCount]);
// Generated once on first use; time the devices, not the generation.
wavetable::WaveTables::prewarmBlocking();
echofield::GrainSources::prewarmBlocking();
{ // a test sample for the Sampler pads 0..15 and the SF2/XI loader
Sample s;
s.sampleRate = 44100;
for (int i = 0; i < 88200; ++i) s.data.push_back(0.5f * std::sin(i * 0.0313f) * std::exp(-i / 60000.f));
s.loopStart = 4000; s.loopEnd = 40000;
store().put("bench", std::move(s));
}
for (SizzleHostDevice *d in SizzleHost.devices) {
NSError *err = nil;
Class cls = [SizzleDeviceAU classForComponentType:kSizzleComponents[d->_index].type];
SizzleDeviceAU *au = [[cls alloc] initWithComponentDescription:descFor(kSizzleComponents[d->_index]) options:0 error:&err];
if (!au) { say([NSString stringWithFormat:@"%-16@ failed to load", d.name]); continue; }
if (d.isInstrument) {
((SizzleInstrumentAU *)au).sampleStore = &store();
NSMutableDictionary *state = [au.fullState mutableCopy];
NSMutableDictionary *values = [state[@"sizzleValues"] mutableCopy];
for (int pad = 0; pad < 16; ++pad) values[[NSString stringWithFormat:@"pad%d", pad]] = @"bench";
values[@"sfSample"] = @"bench";
state[@"sizzleValues"] = values;
au.fullState = state;
}
double secs = timeRender(au, d.isInstrument, 10.0);
if (secs < 0) { say([NSString stringWithFormat:@"%-16@ failed to start", d.name]); continue; }
say([NSString stringWithFormat:@"%-16@ %5.1f%% of a core%@", d.name, secs / 10.0 * 100.0,
d.isInstrument ? @" (8 notes)" : @""]);
}
dispatch_async(dispatch_get_main_queue(), done);
});
}
@end
+6
View File
@@ -12,3 +12,9 @@ aufx sMxt MIX_TIGHTENER Mix Tightener
aufx sTpe TAPE_ENGINE Tape Engine
aufx sGrn GRANULAR Granular Glitch
aufx sAmb AMBIENCE Ambience Reverb
aumu sSyn NES_SYNTH Synth
aumu sMph MORPH_PAD Morph Pad
aumu sWav WAVETABLE Wavetable
aumu sGrc GRAIN_CLOUD Grain Cloud
aumu sSmp SAMPLER Sampler
aumu sSf2 SOUNDFONT SF2-XI Loader
+20 -1
View File
@@ -47,11 +47,27 @@ targets:
Sizzle:
type: application
platform: iOS
sources: [Host]
info:
path: Host/Info.plist
properties:
UIBackgroundModes: [audio]
# The app hosts the devices itself (in-process), so it compiles the plugin
# classes and the editor too, and links the whole core.
sources:
- Host
- FX/SizzleDeviceAU.mm
- FX/SizzleEffectAU.mm
- FX/SizzleInstrumentAU.mm
- FX/SizzleFXViewController.mm
dependencies:
- target: SizzleFX
embed: true
codeSign: false
- target: SizzleCore
- sdk: AudioToolbox.framework
- sdk: AVFoundation.framework
- sdk: CoreAudioKit.framework
- sdk: CoreMIDI.framework
settings:
base:
PRODUCT_BUNDLE_IDENTIFIER: cc.tiredsysadmin.ios.sizzle
@@ -64,3 +80,6 @@ targets:
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad: "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"
ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon
SWIFT_OBJC_BRIDGING_HEADER: Host/Bridging.h
USER_HEADER_SEARCH_PATHS: ["$(SRCROOT)/FX"]
OTHER_LDFLAGS: ["-lc++", "-force_load", "$(BUILT_PRODUCTS_DIR)/libSizzleCore.a"]
+103 -6
View File
@@ -9,6 +9,9 @@
// 2. parameters: moving every parameter through the AU's tree must change the
// output to exactly what the core gives for those values;
// 3. presets (Mix Tightener) and saved state (fullState round trip);
// 5. instruments: MIDI notes at given sample offsets through the AU's render
// block must give exactly what the C++ Instrument gives for the same notes;
// the Sampler / SF2 get a test sample through fullState;
// 4. zero-copy input: calling the render block directly with an upstream that
// points the input buffers at its own memory instead of filling ours. Real
// hosts do that out of process; AVAudioEngine in-process copies, which is why
@@ -20,7 +23,12 @@
#include <fstream>
#include <vector>
#import "Components.gen.h"
#import "SizzleEffectAU.h"
#import "SizzleDeviceAU.h"
#import "SizzleInstrumentAU.h"
#include "sizzle/Instrument.hpp"
#include "sampler/SampleStore.hpp"
#include "echofield/GrainSources.hpp"
#include "wavetable/WaveTables.hpp"
#include "sizzle/DeviceSpecs.gen.hpp"
#include "sizzle/Effect.hpp"
@@ -138,15 +146,101 @@ static double maxDiff(const std::vector<float> &a, const std::vector<float> &b)
return m;
}
static sampler::SampleStore gStore;
/// Instruments: render the AU's render block directly with MIDI events at sample
/// offsets inside 512-frame blocks, against the C++ Instrument with the same notes.
static void checkInstrument(AudioComponentDescription d, const SizzleComponent &sc) {
const int sr = 44100, n = 512, blocks = 120; // ~1.4 s
struct Note { int frame, status, midi, vel; };
const Note notes[] = {{100, 0x90, 60, 100}, {9000, 0x90, 64, 90}, {9000, 0x90, 67, 70},
{26000, 0x80, 60, 0}, {30001, 0x80, 64, 0}, {30001, 0x80, 67, 0},
{40000, 0x90, 48, 127}, {52000, 0x80, 48, 0}};
const bool sampled = !strcmp(sc.toolboxType, "SAMPLER") || !strcmp(sc.toolboxType, "SOUNDFONT");
char msg[200];
AVAudioUnit *unit = instantiate(d);
if (!unit) { check(false, "instantiate", sc.name); return; }
SizzleInstrumentAU *au = (SizzleInstrumentAU *)unit.AUAudioUnit;
au.sampleStore = &gStore;
const DeviceSpec *spec = findDevice(sc.toolboxType);
Params p; p.fill(*spec);
if (sampled) { // point it at the test sample through saved state
NSMutableDictionary *values = [NSMutableDictionary dictionary];
for (int i = 0; i < p.size(); ++i) values[@(p.keyAt(i))] = @(p.valueAt(i));
if (!strcmp(sc.toolboxType, "SAMPLER")) { values[@"pad12"] = @"t"; values[@"pad24"] = @"t"; p.set("pad12", "t"); p.set("pad24", "t"); }
else { values[@"sfSample"] = @"t"; p.set("sfSample", "t"); }
au.fullState = @{@"sizzleValues": values};
}
au.maximumFramesToRender = 4096;
NSError *err = nil;
if (![au allocateRenderResourcesAndReturnError:&err]) { check(false, "allocate", sc.name); return; }
auto inst = Instrument::create(sc.toolboxType, sr, &gStore);
inst->update(p, 120.f);
std::vector<float> want, got;
AURenderBlock render = au.renderBlock;
AUScheduleMIDIEventBlock midi = au.scheduleMIDIEventBlock;
size_t next = 0;
for (int b = 0; b < blocks; ++b) {
const int base = b * n;
// reference: same notes on the same frames
inst->blockStart(n);
size_t k = next;
for (int i = 0; i < n; ++i) {
while (k < sizeof notes / sizeof notes[0] && notes[k].frame == base + i) {
if (notes[k].status == 0x90) inst->noteOn(notes[k].midi, notes[k].vel); else inst->noteOff(notes[k].midi);
++k;
}
want.push_back(inst->render());
}
// AU: schedule this block's notes at their sample times, then render
for (; next < k; ++next) {
uint8_t bytes[3] = {(uint8_t)notes[next].status, (uint8_t)notes[next].midi, (uint8_t)notes[next].vel};
midi((AUEventSampleTime)notes[next].frame, 0, 3, bytes);
}
float bufL[512], bufR[512];
struct { AudioBufferList list; AudioBuffer extra; } out;
out.list.mNumberBuffers = 2;
out.list.mBuffers[0] = {1, (UInt32)(n * 4), bufL};
out.list.mBuffers[1] = {1, (UInt32)(n * 4), bufR};
AudioTimeStamp ts = {};
ts.mSampleTime = base;
ts.mFlags = kAudioTimeStampSampleTimeValid;
AudioUnitRenderActionFlags flags = 0;
if (render(&flags, &ts, n, 0, &out.list, nil) != noErr) { check(false, "render", sc.name); return; }
for (int i = 0; i < n; ++i) {
if (bufL[i] != bufR[i]) { check(false, "left != right", sc.name); return; }
got.push_back(bufL[i]);
}
}
[au deallocateRenderResources];
double peak = 0;
for (float v : want) peak = std::max(peak, (double)std::fabs(v));
double dl = maxDiff(got, want);
snprintf(msg, sizeof msg, "MIDI at sample offsets: AU == Instrument (%.2g, peak %.3f)", dl, peak);
check(dl < 1e-6 && peak > 0.01, msg, sc.name);
}
int main(int argc, char **argv) {
@autoreleasepool {
if (argc < 2) { std::fprintf(stderr, "usage: au_test <golden/input.f32>\n"); return 2; }
std::vector<float> in = readF32(argv[1]);
wavetable::WaveTables::prewarmBlocking();
echofield::GrainSources::prewarmBlocking();
{ // the Sampler / SF2 test sample: 0.5 s decaying saw at 44.1 kHz, looped
Sample s;
s.sampleRate = 44100;
for (int i = 0; i < 22050; ++i) s.data.push_back(0.6f * (2.f * fmodf(i * 220.f / 44100.f, 1.f) - 1.f) * expf(-i / 20000.f));
s.loopStart = 4000; s.loopEnd = 16000;
gStore.put("t", std::move(s));
}
in.resize(48000); // 1 s is plenty
for (int c = 0; c < kSizzleComponentCount; ++c) {
const SizzleComponent &sc = kSizzleComponents[c];
AudioComponentDescription d = {kAudioUnitType_Effect, sc.subtype, 'Tsys', 0, 0};
[AUAudioUnit registerSubclass:SizzleEffectAU.class asComponentDescription:d name:@(sc.name) version:1];
AudioComponentDescription d = {sc.type, sc.subtype, 'Tsys', 0, 0};
[AUAudioUnit registerSubclass:[SizzleDeviceAU classForComponentType:sc.type] asComponentDescription:d name:@(sc.name) version:1];
if (sc.type == kAudioUnitType_MusicDevice) { checkInstrument(d, sc); continue; }
AVAudioUnit *unit = instantiate(d);
if (!unit) { check(false, "instantiate", sc.name); continue; }
const DeviceSpec *spec = findDevice(sc.toolboxType);
@@ -180,12 +274,15 @@ int main(int argc, char **argv) {
if (au.factoryPresets.count > 0) {
au.currentPreset = au.factoryPresets[1];
Params pp; pp.fill(*spec);
const char *const *kv = gen::mixTightenerPresets[1];
for (int i = 1; kv[i] && kv[i + 1]; i += 2) pp.set(kv[i], kv[i + 1]);
const FactoryPreset *fp = nullptr;
for (int i = 0, n = 0; i < gen::factoryPresetCount; ++i)
if (!strcmp(gen::factoryPresets[i].type, sc.toolboxType) && n++ == 1) fp = &gen::factoryPresets[i];
const char *const *kv = fp->values;
for (int i = 0; kv[i] && kv[i + 1]; i += 2) pp.set(kv[i], kv[i + 1]);
want = renderCore(sc.toolboxType, pp, in);
renderAU(unit, in, L, R);
dl = maxDiff(L, want);
snprintf(msg, sizeof msg, "factory preset \"%s\": AU == core (%.2g)", kv[0], dl);
snprintf(msg, sizeof msg, "factory preset \"%s\": AU == core (%.2g)", fp->name, dl);
check(dl < 1e-6, msg, sc.name);
}
+260
View File
@@ -361,4 +361,264 @@ inline const char *const mixTightener28[] = {"Mix Glue", "cHiAtk", "15", "cHiMk"
inline const char *const mixTightener29[] = {"Loudness Max", "cHiMk", "2", "cHiRatio", "3", "cHiThr", "-20", "cLoMk", "2", "cLoRatio", "3", "cLoThr", "-20", "cMidMk", "2", "cMidRatio", "3", "cMidThr", "-18", "eqHiFreq", "9000", "eqHiGain", "2", "eqLoFreq", "90", "eqLoGain", "1", "limCeil", "-0.1", "limRel", "40", "outGain", "4", "xHi", "2800", "xLo", "180", nullptr};
inline const char *const *const mixTightenerPresets[] = {mixTightener0, mixTightener1, mixTightener2, mixTightener3, mixTightener4, mixTightener5, mixTightener6, mixTightener7, mixTightener8, mixTightener9, mixTightener10, mixTightener11, mixTightener12, mixTightener13, mixTightener14, mixTightener15, mixTightener16, mixTightener17, mixTightener18, mixTightener19, mixTightener20, mixTightener21, mixTightener22, mixTightener23, mixTightener24, mixTightener25, mixTightener26, mixTightener27, mixTightener28, mixTightener29, nullptr};
// Factory presets (PresetLibrary.seedFactoryPresets): device, name, then the
// slot's full settings as key/value pairs, nullptr-terminated.
inline const char *const factory0[] = {"algo", "Room 1", "decay", "0.45", "diffusion", "0.55", "dry", "0.0", "duckamt", "0.0", "duckattack", "10.0", "duckrelease", "200.0", "duckthresh", "-20.0", "erlevel", "0.7", "hfdamp", "0.0", "lfabsorb", "0.0", "modamt", "0.15", "modrate", "0.3", "predelay", "10.0", "roomsize", "0.75", "saturation", "0.08", "wet", "-6.0", nullptr};
inline const char *const factory1[] = {"algo", "Room 2", "decay", "1.8", "diffusion", "0.7", "dry", "0.0", "duckamt", "0.0", "duckattack", "10.0", "duckrelease", "200.0", "duckthresh", "-20.0", "erlevel", "0.6", "hfdamp", "0.0", "lfabsorb", "0.0", "modamt", "0.25", "modrate", "0.4", "predelay", "10.0", "roomsize", "1.6", "saturation", "0.08", "wet", "-4.0", nullptr};
inline const char *const factory2[] = {"algo", "Room 2", "decay", "1.4", "diffusion", "0.65", "dry", "0.0", "duckamt", "0.0", "duckattack", "10.0", "duckrelease", "200.0", "duckthresh", "-20.0", "erlevel", "0.65", "hfdamp", "0.0", "lfabsorb", "0.0", "modamt", "0.2", "modrate", "0.35", "predelay", "10.0", "roomsize", "1.35", "saturation", "0.1", "wet", "-4.0", nullptr};
inline const char *const factory3[] = {"algo", "Room 2", "decay", "2.0", "diffusion", "0.75", "dry", "0.0", "duckamt", "0.0", "duckattack", "10.0", "duckrelease", "200.0", "duckthresh", "-20.0", "erlevel", "0.55", "hfdamp", "0.0", "lfabsorb", "0.0", "modamt", "0.3", "modrate", "0.45", "predelay", "10.0", "roomsize", "1.7", "saturation", "0.06", "wet", "-4.0", nullptr};
inline const char *const factory4[] = {"algo", "Hall 1", "decay", "1.7", "diffusion", "0.72", "dry", "0.0", "duckamt", "0.0", "duckattack", "10.0", "duckrelease", "200.0", "duckthresh", "-20.0", "erlevel", "0.55", "hfdamp", "0.0", "lfabsorb", "0.0", "modamt", "0.2", "modrate", "0.3", "predelay", "10.0", "roomsize", "1.5", "saturation", "0.08", "wet", "-4.0", nullptr};
inline const char *const factory5[] = {"algo", "Hall 1", "decay", "2.0", "diffusion", "0.75", "dry", "0.0", "duckamt", "0.0", "duckattack", "10.0", "duckrelease", "200.0", "duckthresh", "-20.0", "erlevel", "0.5", "hfdamp", "0.0", "lfabsorb", "0.0", "modamt", "0.25", "modrate", "0.35", "predelay", "10.0", "roomsize", "1.65", "saturation", "0.06", "wet", "-4.0", nullptr};
inline const char *const factory6[] = {"algo", "Hall 1", "decay", "2.0", "diffusion", "0.73", "dry", "0.0", "duckamt", "0.0", "duckattack", "10.0", "duckrelease", "200.0", "duckthresh", "-20.0", "erlevel", "0.52", "hfdamp", "0.0", "lfabsorb", "0.0", "modamt", "0.22", "modrate", "0.32", "predelay", "10.0", "roomsize", "1.6", "saturation", "0.07", "wet", "0.0", nullptr};
inline const char *const factory7[] = {"algo", "Hall 2", "decay", "2.05", "diffusion", "0.8", "dry", "0.0", "duckamt", "0.0", "duckattack", "10.0", "duckrelease", "200.0", "duckthresh", "-20.0", "erlevel", "0.5", "hfdamp", "0.0", "lfabsorb", "0.0", "modamt", "0.25", "modrate", "0.3", "predelay", "10.0", "roomsize", "1.8", "saturation", "0.07", "wet", "-4.0", nullptr};
inline const char *const factory8[] = {"algo", "Hall 2", "decay", "1.85", "diffusion", "0.78", "dry", "0.0", "duckamt", "0.0", "duckattack", "10.0", "duckrelease", "200.0", "duckthresh", "-20.0", "erlevel", "0.52", "hfdamp", "0.0", "lfabsorb", "0.0", "modamt", "0.22", "modrate", "0.28", "predelay", "10.0", "roomsize", "1.7", "saturation", "0.06", "wet", "-4.0", nullptr};
inline const char *const factory9[] = {"algo", "Hall 2", "decay", "2.05", "diffusion", "0.82", "dry", "0.0", "duckamt", "0.0", "duckattack", "10.0", "duckrelease", "200.0", "duckthresh", "-20.0", "erlevel", "0.48", "hfdamp", "0.0", "lfabsorb", "0.0", "modamt", "0.28", "modrate", "0.32", "predelay", "10.0", "roomsize", "1.85", "saturation", "0.06", "wet", "-4.0", nullptr};
inline const char *const factory10[] = {"algo", "Plate", "decay", "1.8", "diffusion", "0.85", "dry", "0.0", "duckamt", "0.0", "duckattack", "10.0", "duckrelease", "200.0", "duckthresh", "-20.0", "erlevel", "0.4", "hfdamp", "0.0", "lfabsorb", "0.0", "modamt", "0.3", "modrate", "0.5", "predelay", "10.0", "roomsize", "1.0", "saturation", "0.12", "wet", "-4.0", nullptr};
inline const char *const factory11[] = {"algo", "Plate", "decay", "1.0", "diffusion", "0.8", "dry", "0.0", "duckamt", "0.0", "duckattack", "10.0", "duckrelease", "200.0", "duckthresh", "-20.0", "erlevel", "0.35", "hfdamp", "0.0", "lfabsorb", "0.0", "modamt", "0.2", "modrate", "0.45", "predelay", "10.0", "roomsize", "0.8", "saturation", "0.15", "wet", "-4.0", nullptr};
inline const char *const factory12[] = {"algo", "Plate", "decay", "2.5", "diffusion", "0.88", "dry", "0.0", "duckamt", "0.0", "duckattack", "10.0", "duckrelease", "200.0", "duckthresh", "-20.0", "erlevel", "0.1", "hfdamp", "0.0", "lfabsorb", "0.0", "modamt", "0.35", "modrate", "0.55", "predelay", "10.0", "roomsize", "1.2", "saturation", "0.1", "wet", "-4.0", nullptr};
inline const char *const factory13[] = {"algo", "Spring", "decay", "1.5", "diffusion", "0.45", "dry", "0.0", "duckamt", "0.0", "duckattack", "10.0", "duckrelease", "200.0", "duckthresh", "-20.0", "erlevel", "0.45", "hfdamp", "0.0", "lfabsorb", "0.0", "modamt", "0.5", "modrate", "0.7", "predelay", "10.0", "roomsize", "0.7", "saturation", "0.2", "wet", "-4.0", nullptr};
inline const char *const factory14[] = {"algo", "Plate", "decay", "2.2", "diffusion", "0.5", "dry", "0.0", "duckamt", "0.0", "duckattack", "10.0", "duckrelease", "200.0", "duckthresh", "-20.0", "erlevel", "0.4", "hfdamp", "0.0", "lfabsorb", "0.0", "modamt", "0.55", "modrate", "0.65", "predelay", "10.0", "roomsize", "0.85", "saturation", "0.35", "wet", "-4.0", nullptr};
inline const char *const factory15[] = {"algo", "Spring", "decay", "3.5", "diffusion", "0.55", "dry", "0.0", "duckamt", "0.0", "duckattack", "10.0", "duckrelease", "200.0", "duckthresh", "-20.0", "erlevel", "0.38", "hfdamp", "0.0", "lfabsorb", "0.0", "modamt", "0.6", "modrate", "0.6", "predelay", "10.0", "roomsize", "1.1", "saturation", "0.45", "wet", "-4.0", nullptr};
inline const char *const factory16[] = {"algo", "Goldfoil", "decay", "8.0", "diffusion", "0.9", "dry", "0.0", "duckamt", "0.0", "duckattack", "10.0", "duckrelease", "200.0", "duckthresh", "-20.0", "erlevel", "0.35", "hfdamp", "0.0", "lfabsorb", "0.0", "modamt", "0.4", "modrate", "0.25", "predelay", "10.0", "roomsize", "2.0", "saturation", "0.05", "wet", "-4.0", nullptr};
inline const char *const factory17[] = {"algo", "Goldfoil", "decay", "4.0", "diffusion", "0.85", "dry", "0.0", "duckamt", "0.0", "duckattack", "10.0", "duckrelease", "200.0", "duckthresh", "-20.0", "erlevel", "0.4", "hfdamp", "0.0", "lfabsorb", "0.0", "modamt", "0.45", "modrate", "0.3", "predelay", "10.0", "roomsize", "1.8", "saturation", "0.2", "wet", "-4.0", nullptr};
inline const char *const factory18[] = {"algo", "Goldfoil", "decay", "12.0", "diffusion", "0.95", "dry", "0.0", "duckamt", "0.0", "duckattack", "10.0", "duckrelease", "200.0", "duckthresh", "-20.0", "erlevel", "0.25", "hfdamp", "0.0", "lfabsorb", "0.0", "modamt", "0.65", "modrate", "0.28", "predelay", "10.0", "roomsize", "2.0", "saturation", "0.1", "wet", "-4.0", nullptr};
inline const char *const factory19[] = {"algo", "Room 1", "decay", "0.3", "diffusion", "0.4", "dry", "0.0", "duckamt", "0.0", "duckattack", "10.0", "duckrelease", "200.0", "duckthresh", "-20.0", "erlevel", "0.8", "hfdamp", "0.0", "lfabsorb", "0.0", "modamt", "0.1", "modrate", "0.2", "predelay", "10.0", "roomsize", "0.55", "saturation", "0.05", "wet", "-4.0", nullptr};
inline const char *const factory20[] = {"algo", "Room 1", "decay", "0.6", "diffusion", "0.65", "dry", "0.0", "duckamt", "0.0", "duckattack", "10.0", "duckrelease", "200.0", "duckthresh", "-20.0", "erlevel", "0.65", "hfdamp", "0.0", "lfabsorb", "0.0", "modamt", "0.2", "modrate", "0.35", "predelay", "10.0", "roomsize", "0.9", "saturation", "0.1", "wet", "-4.0", nullptr};
inline const char *const factory21[] = {"attack", "0.005", "cutoff", "0.8", "decay", "0.1", "fatk", "0.005", "fdec", "0.25", "fenvamt", "0.2", "frel", "0.2", "fsus", "0.4", "keytrack", "0.3", "lfodiv", "3.0", "lfophase", "0°", "lfowave", "Tri", "m0amt", "0.0", "m0dst", "Pitch", "m0src", "Off", "m1amt", "0.0", "m1dst", "Pitch", "m1src", "Off", "m2amt", "0.0", "m2dst", "Pitch", "m2src", "Off", "m3amt", "0.0", "m3dst", "Pitch", "m3src", "Off", "noise", "0.0", "osc0fine", "0.0", "osc0level", "0.9", "osc0oct", "0.0", "osc0semi", "0.0", "osc0wave", "Pulse25", "osc1fine", "0.0", "osc1level", "0.0", "osc1oct", "0.0", "osc1semi", "0.0", "osc1wave", "Tri", "osc2fine", "0.0", "osc2level", "0.0", "osc2oct", "0.0", "osc2semi", "0.0", "osc2wave", "Tri", "release", "0.1", "reso", "0.1", "sustain", "0.85", nullptr};
inline const char *const factory22[] = {"attack", "0.002", "cutoff", "0.45", "decay", "0.15", "fatk", "0.005", "fdec", "0.18", "fenvamt", "0.5", "frel", "0.2", "fsus", "0.2", "keytrack", "0.3", "lfodiv", "3.0", "lfophase", "0°", "lfowave", "Tri", "m0amt", "0.0", "m0dst", "Pitch", "m0src", "Off", "m1amt", "0.0", "m1dst", "Pitch", "m1src", "Off", "m2amt", "0.0", "m2dst", "Pitch", "m2src", "Off", "m3amt", "0.0", "m3dst", "Pitch", "m3src", "Off", "noise", "0.0", "osc0fine", "0.0", "osc0level", "0.9", "osc0oct", "-1", "osc0semi", "0.0", "osc0wave", "Square", "osc1fine", "6", "osc1level", "0.5", "osc1oct", "-1", "osc1semi", "0.0", "osc1wave", "Pulse25", "osc2fine", "0.0", "osc2level", "0.0", "osc2oct", "0.0", "osc2semi", "0.0", "osc2wave", "Tri", "release", "0.12", "reso", "0.25", "sustain", "0.6", nullptr};
inline const char *const factory23[] = {"attack", "0.002", "cutoff", "0.5", "decay", "0.2", "fatk", "0.002", "fdec", "0.12", "fenvamt", "0.6", "frel", "0.2", "fsus", "0.1", "keytrack", "0.3", "lfodiv", "4", "lfophase", "0°", "lfowave", "Tri", "m0amt", "0.5", "m0dst", "PWM", "m0src", "LFO", "m1amt", "0.0", "m1dst", "Pitch", "m1src", "Off", "m2amt", "0.0", "m2dst", "Pitch", "m2src", "Off", "m3amt", "0.0", "m3dst", "Pitch", "m3src", "Off", "noise", "0.0", "osc0fine", "0.0", "osc0level", "0.9", "osc0oct", "0.0", "osc0semi", "0.0", "osc0wave", "Pulse12", "osc1fine", "0.0", "osc1level", "0.0", "osc1oct", "0.0", "osc1semi", "0.0", "osc1wave", "Tri", "osc2fine", "0.0", "osc2level", "0.0", "osc2oct", "0.0", "osc2semi", "0.0", "osc2wave", "Tri", "release", "0.15", "reso", "0.3", "sustain", "0.4", nullptr};
inline const char *const factory24[] = {"attack", "0.004", "cutoff", "0.35", "decay", "0.2", "fatk", "0.005", "fdec", "0.25", "fenvamt", "0.2", "frel", "0.2", "fsus", "0.4", "keytrack", "0.3", "lfodiv", "3.0", "lfophase", "0°", "lfowave", "Tri", "m0amt", "0.0", "m0dst", "Pitch", "m0src", "Off", "m1amt", "0.0", "m1dst", "Pitch", "m1src", "Off", "m2amt", "0.0", "m2dst", "Pitch", "m2src", "Off", "m3amt", "0.0", "m3dst", "Pitch", "m3src", "Off", "noise", "0.0", "osc0fine", "0.0", "osc0level", "1.0", "osc0oct", "-1", "osc0semi", "0.0", "osc0wave", "Tri", "osc1fine", "0.0", "osc1level", "0.0", "osc1oct", "0.0", "osc1semi", "0.0", "osc1wave", "Tri", "osc2fine", "0.0", "osc2level", "0.0", "osc2oct", "0.0", "osc2semi", "0.0", "osc2wave", "Tri", "release", "0.15", "reso", "0.05", "sustain", "0.7", nullptr};
inline const char *const factory25[] = {"attack", "0.01", "cutoff", "0.7", "decay", "0.3", "fatk", "0.005", "fdec", "0.25", "fenvamt", "0.3", "frel", "0.2", "fsus", "0.4", "keytrack", "0.3", "lfodiv", "3.0", "lfophase", "0°", "lfowave", "Tri", "m0amt", "0.0", "m0dst", "Pitch", "m0src", "Off", "m1amt", "0.0", "m1dst", "Pitch", "m1src", "Off", "m2amt", "0.0", "m2dst", "Pitch", "m2src", "Off", "m3amt", "0.0", "m3dst", "Pitch", "m3src", "Off", "noise", "0.0", "osc0fine", "0.0", "osc0level", "0.7", "osc0oct", "0.0", "osc0semi", "0.0", "osc0wave", "Saw", "osc1fine", "8", "osc1level", "0.7", "osc1oct", "0.0", "osc1semi", "0.0", "osc1wave", "Saw", "osc2fine", "0.0", "osc2level", "0.3", "osc2oct", "1", "osc2semi", "0.0", "osc2wave", "Square", "release", "0.2", "reso", "0.15", "sustain", "0.7", nullptr};
inline const char *const factory26[] = {"attack", "0.001", "cutoff", "0.85", "decay", "0.08", "fatk", "0.001", "fdec", "0.08", "fenvamt", "-0.3", "frel", "0.2", "fsus", "0.0", "keytrack", "0.3", "lfodiv", "3.0", "lfophase", "0°", "lfowave", "Tri", "m0amt", "0.0", "m0dst", "Pitch", "m0src", "Off", "m1amt", "0.0", "m1dst", "Pitch", "m1src", "Off", "m2amt", "0.0", "m2dst", "Pitch", "m2src", "Off", "m3amt", "0.0", "m3dst", "Pitch", "m3src", "Off", "noise", "1.0", "osc0fine", "0.0", "osc0level", "0.0", "osc0oct", "0.0", "osc0semi", "0.0", "osc0wave", "Tri", "osc1fine", "0.0", "osc1level", "0.0", "osc1oct", "0.0", "osc1semi", "0.0", "osc1wave", "Tri", "osc2fine", "0.0", "osc2level", "0.0", "osc2oct", "0.0", "osc2semi", "0.0", "osc2wave", "Tri", "release", "0.06", "reso", "0.2", "sustain", "0.0", nullptr};
inline const char *const factory27[] = {"attack", "0.01", "cutoff", "0.75", "decay", "0.2", "fatk", "0.005", "fdec", "0.25", "fenvamt", "0.4", "frel", "0.2", "fsus", "0.4", "keytrack", "0.3", "lfodiv", "3", "lfophase", "0°", "lfowave", "Sine", "m0amt", "0.06", "m0dst", "Pitch", "m0src", "LFO", "m1amt", "0.0", "m1dst", "Pitch", "m1src", "Off", "m2amt", "0.0", "m2dst", "Pitch", "m2src", "Off", "m3amt", "0.0", "m3dst", "Pitch", "m3src", "Off", "noise", "0.0", "osc0fine", "0.0", "osc0level", "0.9", "osc0oct", "0.0", "osc0semi", "0.0", "osc0wave", "Square", "osc1fine", "0.0", "osc1level", "0.0", "osc1oct", "0.0", "osc1semi", "0.0", "osc1wave", "Tri", "osc2fine", "0.0", "osc2level", "0.0", "osc2oct", "0.0", "osc2semi", "0.0", "osc2wave", "Tri", "release", "0.15", "reso", "0.1", "sustain", "0.85", nullptr};
inline const char *const factory28[] = {"attack", "0.01", "cutoff", "0.4", "decay", "0.3", "fatk", "0.005", "fdec", "0.25", "fenvamt", "0.4", "frel", "0.2", "fsus", "0.4", "keytrack", "0.3", "lfodiv", "3", "lfophase", "0°", "lfowave", "Tri", "m0amt", "0.5", "m0dst", "Cutoff", "m0src", "LFO", "m1amt", "0.0", "m1dst", "Pitch", "m1src", "Off", "m2amt", "0.0", "m2dst", "Pitch", "m2src", "Off", "m3amt", "0.0", "m3dst", "Pitch", "m3src", "Off", "noise", "0.0", "osc0fine", "0.0", "osc0level", "0.9", "osc0oct", "0.0", "osc0semi", "0.0", "osc0wave", "Saw", "osc1fine", "0.0", "osc1level", "0.0", "osc1oct", "0.0", "osc1semi", "0.0", "osc1wave", "Tri", "osc2fine", "0.0", "osc2level", "0.0", "osc2oct", "0.0", "osc2semi", "0.0", "osc2wave", "Tri", "release", "0.2", "reso", "0.5", "sustain", "0.8", nullptr};
inline const char *const factory29[] = {"attack", "0.002", "cutoff", "0.42", "decay", "0.13", "fatk", "0.001", "fdec", "0.11", "fenvamt", "0.6", "frel", "0.10", "fsus", "0.0", "keytrack", "0.4", "lfodiv", "3.0", "lfophase", "0°", "lfowave", "Tri", "m0amt", "0.0", "m0dst", "Pitch", "m0src", "Off", "m1amt", "0.0", "m1dst", "Pitch", "m1src", "Off", "m2amt", "0.0", "m2dst", "Pitch", "m2src", "Off", "m3amt", "0.0", "m3dst", "Pitch", "m3src", "Off", "noise", "0.0", "osc0fine", "0.0", "osc0level", "0.9", "osc0oct", "-1", "osc0semi", "0.0", "osc0wave", "Square", "osc1fine", "6", "osc1level", "0.45", "osc1oct", "-1", "osc1semi", "0.0", "osc1wave", "Saw", "osc2fine", "0.0", "osc2level", "0.0", "osc2oct", "0.0", "osc2semi", "0.0", "osc2wave", "Tri", "release", "0.09", "reso", "0.38", "sustain", "0.0", nullptr};
inline const char *const factory30[] = {"attack", "0.002", "cutoff", "0.38", "decay", "0.18", "fatk", "0.001", "fdec", "0.14", "fenvamt", "0.70", "frel", "0.10", "fsus", "0.05", "keytrack", "0.5", "lfodiv", "3.0", "lfophase", "0°", "lfowave", "Tri", "m0amt", "0.0", "m0dst", "Pitch", "m0src", "Off", "m1amt", "0.0", "m1dst", "Pitch", "m1src", "Off", "m2amt", "0.0", "m2dst", "Pitch", "m2src", "Off", "m3amt", "0.0", "m3dst", "Pitch", "m3src", "Off", "noise", "0.0", "osc0fine", "0.0", "osc0level", "0.95", "osc0oct", "-1", "osc0semi", "0.0", "osc0wave", "Saw", "osc1fine", "0.0", "osc1level", "0.0", "osc1oct", "0.0", "osc1semi", "0.0", "osc1wave", "Tri", "osc2fine", "0.0", "osc2level", "0.0", "osc2oct", "0.0", "osc2semi", "0.0", "osc2wave", "Tri", "release", "0.10", "reso", "0.70", "sustain", "0.0", nullptr};
inline const char *const factory31[] = {"attack", "0.006", "cutoff", "0.72", "decay", "0.2", "fatk", "0.004", "fdec", "0.25", "fenvamt", "0.25", "frel", "0.2", "fsus", "0.5", "keytrack", "0.5", "lfodiv", "3.0", "lfophase", "0°", "lfowave", "Tri", "m0amt", "0.0", "m0dst", "Pitch", "m0src", "Off", "m1amt", "0.0", "m1dst", "Pitch", "m1src", "Off", "m2amt", "0.0", "m2dst", "Pitch", "m2src", "Off", "m3amt", "0.0", "m3dst", "Pitch", "m3src", "Off", "noise", "0.0", "osc0fine", "0.0", "osc0level", "0.8", "osc0oct", "0.0", "osc0semi", "0.0", "osc0wave", "Saw", "osc1fine", "-7", "osc1level", "0.55", "osc1oct", "0.0", "osc1semi", "0.0", "osc1wave", "Pulse25", "osc2fine", "0.0", "osc2level", "0.3", "osc2oct", "1", "osc2semi", "0.0", "osc2wave", "Saw", "release", "0.18", "reso", "0.40", "sustain", "0.85", nullptr};
inline const char *const factory32[] = {"attack", "0.01", "cutoff", "0.66", "decay", "0.25", "fatk", "0.005", "fdec", "0.25", "fenvamt", "0.3", "frel", "0.2", "fsus", "0.4", "keytrack", "0.5", "lfodiv", "4", "lfophase", "0°", "lfowave", "Tri", "m0amt", "0.4", "m0dst", "PWM", "m0src", "LFO", "m1amt", "0.0", "m1dst", "Pitch", "m1src", "Off", "m2amt", "0.0", "m2dst", "Pitch", "m2src", "Off", "m3amt", "0.0", "m3dst", "Pitch", "m3src", "Off", "noise", "0.0", "osc0fine", "0.0", "osc0level", "0.9", "osc0oct", "0.0", "osc0semi", "0.0", "osc0wave", "Pulse25", "osc1fine", "8", "osc1level", "0.5", "osc1oct", "0.0", "osc1semi", "0.0", "osc1wave", "Square", "osc2fine", "0.0", "osc2level", "0.0", "osc2oct", "0.0", "osc2semi", "0.0", "osc2wave", "Tri", "release", "0.2", "reso", "0.45", "sustain", "0.8", nullptr};
inline const char *const factory33[] = {"attack", "0.008", "cutoff", "0.48", "decay", "0.35", "fatk", "0.008", "fdec", "0.45", "fenvamt", "0.3", "frel", "0.3", "fsus", "0.55", "keytrack", "0.3", "lfodiv", "3.0", "lfophase", "0°", "lfowave", "Tri", "m0amt", "0.0", "m0dst", "Pitch", "m0src", "Off", "m1amt", "0.0", "m1dst", "Pitch", "m1src", "Off", "m2amt", "0.0", "m2dst", "Pitch", "m2src", "Off", "m3amt", "0.0", "m3dst", "Pitch", "m3src", "Off", "noise", "0.06", "osc0fine", "0.0", "osc0level", "0.75", "osc0oct", "-1", "osc0semi", "0.0", "osc0wave", "Saw", "osc1fine", "-14", "osc1level", "0.75", "osc1oct", "-1", "osc1semi", "0.0", "osc1wave", "Saw", "osc2fine", "0.0", "osc2level", "0.5", "osc2oct", "-2", "osc2semi", "0.0", "osc2wave", "Square", "release", "0.28", "reso", "0.50", "sustain", "0.85", nullptr};
inline const char *const factory34[] = {"attack", "0.02", "cutoff", "0.44", "decay", "0.4", "fatk", "0.005", "fdec", "0.25", "fenvamt", "0.25", "frel", "0.2", "fsus", "0.4", "keytrack", "0.25", "lfodiv", "3.0", "lfophase", "0°", "lfowave", "Tri", "m0amt", "0.0", "m0dst", "Pitch", "m0src", "Off", "m1amt", "0.0", "m1dst", "Pitch", "m1src", "Off", "m2amt", "0.0", "m2dst", "Pitch", "m2src", "Off", "m3amt", "0.0", "m3dst", "Pitch", "m3src", "Off", "noise", "0.10", "osc0fine", "-20", "osc0level", "0.7", "osc0oct", "-1", "osc0semi", "0.0", "osc0wave", "Saw", "osc1fine", "20", "osc1level", "0.7", "osc1oct", "-1", "osc1semi", "0.0", "osc1wave", "Saw", "osc2fine", "0.0", "osc2level", "0.4", "osc2oct", "-1", "osc2semi", "0.0", "osc2wave", "Pulse25", "release", "0.35", "reso", "0.55", "sustain", "0.9", nullptr};
inline const char *const factory35[] = {"air", "0.0", "attack", "0.7007874", "beat", "0.0", "body", "1.0", "bpitch", "Unison", "breath", "0.2519685", "bres", "0.5511811", "btone", "0.503937", "cfilter", "0.3464567", "choir", "0.5984252", "color", "0.0", "creso", "0.0", "ctype", "Low", "detune", "0.4015748", "evolve", "0.0", "formant", "0.6692913", "grain", "0.0", "interval", "Unison", "morph", "0.0", "morphTo", "Off", "motion", "0.3464567", "mrate", "0.4015748", "mtime", "0.0", "odd", "0.19685039", "partials", "0.7007874", "peak", "0.0", "release", "0.6535433", "shape", "0.0", "soft", "0.0", "stretch", "0.0", "tide", "0.19685039", "tilt", "0.4488189", "timbre", "0.503937", "tperiod", "0.2992126", "velsens", "0.2992126", "warmth", "0.1496063", nullptr};
inline const char *const factory36[] = {"air", "0.0", "attack", "0.78740156", "beat", "0.0", "body", "1.0", "bpitch", "Unison", "breath", "0.15748031", "bres", "0.47244096", "btone", "0.503937", "cfilter", "0.43307087", "choir", "0.86614174", "color", "0.0", "creso", "0.15748031", "ctype", "Low", "detune", "0.6692913", "evolve", "0.07874016", "formant", "0.6692913", "grain", "0.0", "interval", "-12", "morph", "0.0", "morphTo", "Off", "motion", "0.47244096", "mrate", "0.31496063", "mtime", "0.0", "odd", "0.23622048", "partials", "0.39370078", "peak", "0.0", "release", "0.78740156", "shape", "0.0", "soft", "0.0", "stretch", "0.0", "tide", "0.15748031", "tilt", "0.47244096", "timbre", "0.47244096", "tperiod", "0.39370078", "velsens", "0.2992126", "warmth", "0.19685039", nullptr};
inline const char *const factory37[] = {"air", "0.0", "attack", "0.62992126", "beat", "0.11811024", "body", "1.0", "bpitch", "+12", "breath", "0.5511811", "bres", "0.9055118", "btone", "0.62992126", "cfilter", "0.47244096", "choir", "0.15748031", "color", "1.0", "creso", "0.0", "ctype", "Low", "detune", "0.23622048", "evolve", "0.31496063", "formant", "0.78740156", "grain", "0.15748031", "interval", "Unison", "morph", "0.0", "morphTo", "Off", "motion", "0.31496063", "mrate", "0.23622048", "mtime", "0.0", "odd", "0.39370078", "partials", "0.78740156", "peak", "0.23622048", "release", "0.86614174", "shape", "0.0", "soft", "0.0", "stretch", "0.47244096", "tide", "0.23622048", "tilt", "0.27559054", "timbre", "0.62992126", "tperiod", "0.31496063", "velsens", "0.2992126", "warmth", "0.03937008", nullptr};
inline const char *const factory38[] = {"air", "0.0", "attack", "0.78740156", "beat", "0.0", "body", "1.0", "bpitch", "-12", "breath", "0.19685039", "bres", "0.39370078", "btone", "0.23622048", "cfilter", "0.15748031", "choir", "0.70866144", "color", "0.0", "creso", "0.31496063", "ctype", "Low", "detune", "0.5511811", "evolve", "0.15748031", "formant", "0.47244096", "grain", "0.0", "interval", "-12", "morph", "0.0", "morphTo", "Off", "motion", "0.39370078", "mrate", "0.19685039", "mtime", "0.0", "odd", "0.31496063", "partials", "0.5511811", "peak", "0.0", "release", "0.8267717", "shape", "0.23622048", "soft", "0.0", "stretch", "0.0", "tide", "0.39370078", "tilt", "0.70866144", "timbre", "0.31496063", "tperiod", "0.19685039", "velsens", "0.2992126", "warmth", "0.39370078", nullptr};
inline const char *const factory39[] = {"air", "0.07874016", "attack", "0.70866144", "beat", "0.19685039", "body", "1.0", "bpitch", "+12", "breath", "0.31496063", "bres", "0.6692913", "btone", "0.5905512", "cfilter", "0.511811", "choir", "0.47244096", "color", "0.47244096", "creso", "0.0", "ctype", "Low", "detune", "0.35433072", "evolve", "0.5511811", "formant", "0.70866144", "grain", "0.0", "interval", "Unison", "morph", "0.0", "morphTo", "Off", "motion", "0.43307087", "mrate", "0.35433072", "mtime", "0.0", "odd", "0.11811024", "partials", "0.8267717", "peak", "0.27559054", "release", "0.8267717", "shape", "0.0", "soft", "0.0", "stretch", "0.07874016", "tide", "0.35433072", "tilt", "0.31496063", "timbre", "0.5905512", "tperiod", "0.39370078", "velsens", "0.2992126", "warmth", "0.11811024", nullptr};
inline const char *const factory40[] = {"air", "0.0", "attack", "0.5511811", "beat", "0.0", "body", "1.0", "bpitch", "Unison", "breath", "0.15748031", "bres", "0.39370078", "btone", "0.39370078", "cfilter", "0.31496063", "choir", "0.78740156", "color", "0.23622048", "creso", "0.39370078", "ctype", "Low", "detune", "0.31496063", "evolve", "0.07874016", "formant", "0.5511811", "grain", "0.0", "interval", "Unison", "morph", "0.0", "morphTo", "Off", "motion", "0.27559054", "mrate", "0.31496063", "mtime", "0.0", "odd", "0.47244096", "partials", "0.43307087", "peak", "0.0", "release", "0.62992126", "shape", "0.503937", "soft", "0.0", "stretch", "0.0", "tide", "0.15748031", "tilt", "0.5511811", "timbre", "0.43307087", "tperiod", "0.31496063", "velsens", "0.2992126", "warmth", "0.62992126", nullptr};
inline const char *const factory41[] = {"air", "0.0", "attack", "0.7480315", "beat", "0.0", "body", "1.0", "bpitch", "Unison", "breath", "0.35433072", "bres", "0.5905512", "btone", "0.503937", "cfilter", "0.35433072", "choir", "0.62992126", "color", "0.31496063", "creso", "0.23622048", "ctype", "Low", "detune", "0.47244096", "evolve", "0.23622048", "formant", "0.6692913", "grain", "0.0", "interval", "Unison", "morph", "0.0", "morphTo", "Off", "motion", "0.5511811", "mrate", "0.23622048", "mtime", "0.0", "odd", "0.23622048", "partials", "0.62992126", "peak", "0.0", "release", "0.78740156", "shape", "0.0", "soft", "0.0", "stretch", "0.07874016", "tide", "0.86614174", "tilt", "0.43307087", "timbre", "0.47244096", "tperiod", "0.47244096", "velsens", "0.2992126", "warmth", "0.19685039", nullptr};
inline const char *const factory42[] = {"air", "0.31496063", "attack", "0.47244096", "beat", "0.0", "body", "1.0", "bpitch", "+12", "breath", "0.6692913", "bres", "0.78740156", "btone", "0.6692913", "cfilter", "0.39370078", "choir", "0.19685039", "color", "0.47244096", "creso", "0.0", "ctype", "Low", "detune", "0.31496063", "evolve", "0.23622048", "formant", "0.6692913", "grain", "0.70866144", "interval", "Unison", "morph", "0.0", "morphTo", "Off", "motion", "0.39370078", "mrate", "0.39370078", "mtime", "0.0", "odd", "0.23622048", "partials", "0.31496063", "peak", "0.0", "release", "0.70866144", "shape", "0.0", "soft", "0.0", "stretch", "0.15748031", "tide", "0.23622048", "tilt", "0.47244096", "timbre", "0.47244096", "tperiod", "0.31496063", "velsens", "0.2992126", "warmth", "0.15748031", nullptr};
inline const char *const factory43[] = {"air", "0.39370078", "attack", "0.62992126", "beat", "0.0", "body", "1.0", "bpitch", "Unison", "breath", "0.6692913", "bres", "0.15748031", "btone", "0.5905512", "cfilter", "0.39370078", "choir", "0.0", "color", "0.23622048", "creso", "0.0", "ctype", "Low", "detune", "0.31496063", "evolve", "0.0", "formant", "0.6692913", "grain", "0.0", "interval", "Unison", "morph", "0.0", "morphTo", "Off", "motion", "0.70866144", "mrate", "0.62992126", "mtime", "0.0", "odd", "0.23622048", "partials", "0.15748031", "peak", "0.0", "release", "0.7480315", "shape", "0.0", "soft", "0.0", "stretch", "0.0", "tide", "0.39370078", "tilt", "0.47244096", "timbre", "0.503937", "tperiod", "0.5511811", "velsens", "0.2992126", "warmth", "0.0", nullptr};
inline const char *const factory44[] = {"air", "0.0", "attack", "0.31496063", "beat", "0.0", "body", "1.0", "bpitch", "Unison", "breath", "0.07874016", "bres", "0.47244096", "btone", "0.503937", "cfilter", "0.39370078", "choir", "0.31496063", "color", "0.0", "creso", "0.0", "ctype", "Low", "detune", "0.07874016", "evolve", "0.0", "formant", "0.6692913", "grain", "0.0", "interval", "+7", "morph", "0.0", "morphTo", "Off", "motion", "0.11811024", "mrate", "0.31496063", "mtime", "0.0", "odd", "0.0", "partials", "0.9055118", "peak", "0.0", "release", "0.47244096", "shape", "0.0", "soft", "0.0", "stretch", "0.0", "tide", "0.07874016", "tilt", "0.35433072", "timbre", "0.503937", "tperiod", "0.31496063", "velsens", "0.2992126", "warmth", "0.23622048", nullptr};
inline const char *const factory45[] = {"air", "0.0", "attack", "0.62992126", "beat", "0.0", "body", "1.0", "bpitch", "Unison", "breath", "0.19685039", "bres", "0.5511811", "btone", "0.47244096", "cfilter", "0.39370078", "choir", "0.8267717", "color", "0.503937", "creso", "0.31496063", "ctype", "Band", "detune", "0.27559054", "evolve", "0.11811024", "formant", "0.6692913", "grain", "0.0", "interval", "Unison", "morph", "0.0", "morphTo", "Off", "motion", "0.31496063", "mrate", "0.35433072", "mtime", "0.0", "odd", "0.86614174", "partials", "0.62992126", "peak", "0.0", "release", "0.70866144", "shape", "0.503937", "soft", "0.0", "stretch", "0.0", "tide", "0.19685039", "tilt", "0.39370078", "timbre", "0.47244096", "tperiod", "0.31496063", "velsens", "0.2992126", "warmth", "0.15748031", nullptr};
inline const char *const factory46[] = {"air", "0.0", "attack", "0.70866144", "beat", "0.0", "body", "1.0", "bpitch", "Unison", "breath", "0.11811024", "bres", "0.5511811", "btone", "0.503937", "cfilter", "0.43307087", "choir", "0.511811", "color", "0.0", "creso", "0.47244096", "ctype", "Band", "detune", "0.23622048", "evolve", "0.15748031", "formant", "0.7480315", "grain", "0.0", "interval", "Unison", "morph", "0.0", "morphTo", "Off", "motion", "0.35433072", "mrate", "0.27559054", "mtime", "0.0", "odd", "0.15748031", "partials", "0.984252", "peak", "0.8267717", "release", "0.7480315", "shape", "0.0", "soft", "0.0", "stretch", "0.0", "tide", "0.47244096", "tilt", "0.23622048", "timbre", "0.503937", "tperiod", "0.35433072", "velsens", "0.2992126", "warmth", "0.07874016", nullptr};
inline const char *const factory47[] = {"air", "0.15748031", "attack", "0.6692913", "beat", "0.39370078", "body", "1.0", "bpitch", "+19", "breath", "0.39370078", "bres", "0.78740156", "btone", "0.70866144", "cfilter", "0.5905512", "choir", "0.35433072", "color", "0.70866144", "creso", "0.0", "ctype", "Low", "detune", "0.43307087", "evolve", "0.31496063", "formant", "0.78740156", "grain", "0.07874016", "interval", "+12", "morph", "0.0", "morphTo", "Off", "motion", "0.39370078", "mrate", "0.43307087", "mtime", "0.0", "odd", "0.15748031", "partials", "0.78740156", "peak", "0.15748031", "release", "0.86614174", "shape", "0.0", "soft", "0.0", "stretch", "0.11811024", "tide", "0.23622048", "tilt", "0.19685039", "timbre", "0.6692913", "tperiod", "0.31496063", "velsens", "0.2992126", "warmth", "0.07874016", nullptr};
inline const char *const factory48[] = {"air", "0.0", "attack", "0.39370078", "beat", "0.0", "body", "1.0", "bpitch", "Unison", "breath", "0.11811024", "bres", "0.47244096", "btone", "0.503937", "cfilter", "0.43307087", "choir", "0.8267717", "color", "0.23622048", "creso", "0.27559054", "ctype", "Band", "detune", "0.23622048", "evolve", "0.0", "formant", "0.6692913", "grain", "0.0", "interval", "Unison", "morph", "0.0", "morphTo", "Off", "motion", "0.23622048", "mrate", "0.35433072", "mtime", "0.0", "odd", "0.5511811", "partials", "0.35433072", "peak", "0.0", "release", "0.5511811", "shape", "0.86614174", "soft", "0.0", "stretch", "0.0", "tide", "0.11811024", "tilt", "0.47244096", "timbre", "0.47244096", "tperiod", "0.31496063", "velsens", "0.2992126", "warmth", "0.31496063", nullptr};
inline const char *const factory49[] = {"air", "0.0", "attack", "0.7480315", "beat", "0.0", "body", "1.0", "bpitch", "Unison", "breath", "0.15748031", "bres", "0.47244096", "btone", "0.503937", "cfilter", "0.47244096", "choir", "0.9055118", "color", "0.0", "creso", "0.11811024", "ctype", "Low", "detune", "0.5905512", "evolve", "0.0", "formant", "0.6692913", "grain", "0.0", "interval", "Unison", "morph", "0.0", "morphTo", "Off", "motion", "0.43307087", "mrate", "0.43307087", "mtime", "0.0", "odd", "0.19685039", "partials", "0.31496063", "peak", "0.0", "release", "0.70866144", "shape", "0.70866144", "soft", "0.0", "stretch", "0.0", "tide", "0.15748031", "tilt", "0.43307087", "timbre", "0.511811", "tperiod", "0.31496063", "velsens", "0.2992126", "warmth", "0.23622048", nullptr};
inline const char *const factory50[] = {"air", "0.0", "attack", "0.31496063", "beat", "0.23622048", "body", "1.0", "bpitch", "+12", "breath", "0.35433072", "bres", "0.86614174", "btone", "0.62992126", "cfilter", "0.39370078", "choir", "0.11811024", "color", "1.0", "creso", "0.0", "ctype", "Low", "detune", "0.19685039", "evolve", "0.23622048", "formant", "0.6692913", "grain", "0.0", "interval", "Unison", "morph", "0.0", "morphTo", "Off", "motion", "0.23622048", "mrate", "0.31496063", "mtime", "0.0", "odd", "0.15748031", "partials", "0.9055118", "peak", "0.0", "release", "0.86614174", "shape", "0.0", "soft", "0.0", "stretch", "0.7480315", "tide", "0.15748031", "tilt", "0.23622048", "timbre", "0.5905512", "tperiod", "0.31496063", "velsens", "0.2992126", "warmth", "0.03937008", nullptr};
inline const char *const factory51[] = {"air", "0.0", "attack", "0.86614174", "beat", "0.0", "body", "1.0", "bpitch", "-12", "breath", "0.23622048", "bres", "0.43307087", "btone", "0.27559054", "cfilter", "0.19685039", "choir", "0.70866144", "color", "0.0", "creso", "0.5511811", "ctype", "Low", "detune", "0.43307087", "evolve", "0.19685039", "formant", "0.5511811", "grain", "0.0", "interval", "-12", "morph", "0.0", "morphTo", "Off", "motion", "0.35433072", "mrate", "0.15748031", "mtime", "0.0", "odd", "0.23622048", "partials", "0.47244096", "peak", "0.0", "release", "0.9055118", "shape", "0.15748031", "soft", "0.0", "stretch", "0.0", "tide", "0.31496063", "tilt", "0.6692913", "timbre", "0.35433072", "tperiod", "0.15748031", "velsens", "0.2992126", "warmth", "0.27559054", nullptr};
inline const char *const factory52[] = {"air", "0.23622048", "attack", "0.78740156", "beat", "0.0", "body", "1.0", "bpitch", "+12", "breath", "0.47244096", "bres", "0.31496063", "btone", "0.62992126", "cfilter", "0.5511811", "choir", "0.6692913", "color", "0.23622048", "creso", "0.15748031", "ctype", "High", "detune", "0.47244096", "evolve", "0.15748031", "formant", "0.6692913", "grain", "0.0", "interval", "+12", "morph", "0.0", "morphTo", "Off", "motion", "0.47244096", "mrate", "0.39370078", "mtime", "0.0", "odd", "0.19685039", "partials", "0.39370078", "peak", "0.0", "release", "0.8267717", "shape", "0.0", "soft", "0.0", "stretch", "0.0", "tide", "0.23622048", "tilt", "0.39370078", "timbre", "0.5511811", "tperiod", "0.39370078", "velsens", "0.2992126", "warmth", "0.07874016", nullptr};
inline const char *const factory53[] = {"air", "0.0", "attack", "0.47244096", "beat", "0.78740156", "body", "1.0", "bpitch", "Unison", "breath", "0.19685039", "bres", "0.5511811", "btone", "0.503937", "cfilter", "0.39370078", "choir", "0.39370078", "color", "0.15748031", "creso", "0.0", "ctype", "Low", "detune", "0.23622048", "evolve", "0.11811024", "formant", "0.6692913", "grain", "0.0", "interval", "Unison", "morph", "0.0", "morphTo", "Off", "motion", "0.23622048", "mrate", "0.39370078", "mtime", "0.0", "odd", "0.23622048", "partials", "0.7480315", "peak", "0.0", "release", "0.62992126", "shape", "0.0", "soft", "0.0", "stretch", "0.0", "tide", "0.15748031", "tilt", "0.35433072", "timbre", "0.503937", "tperiod", "0.31496063", "velsens", "0.2992126", "warmth", "0.15748031", nullptr};
inline const char *const factory54[] = {"air", "0.11811024", "attack", "0.5511811", "beat", "0.15748031", "body", "1.0", "bpitch", "+24", "breath", "0.5511811", "bres", "0.9448819", "btone", "0.78740156", "cfilter", "0.62992126", "choir", "0.23622048", "color", "0.78740156", "creso", "0.0", "ctype", "High", "detune", "0.15748031", "evolve", "0.23622048", "formant", "0.86614174", "grain", "0.31496063", "interval", "+12", "morph", "0.0", "morphTo", "Off", "motion", "0.27559054", "mrate", "0.47244096", "mtime", "0.0", "odd", "0.31496063", "partials", "0.86614174", "peak", "0.31496063", "release", "0.78740156", "shape", "0.0", "soft", "0.0", "stretch", "0.23622048", "tide", "0.15748031", "tilt", "0.15748031", "timbre", "0.70866144", "tperiod", "0.31496063", "velsens", "0.2992126", "warmth", "0.0", nullptr};
inline const char *const factory55[] = {"air", "0.0", "attack", "0.70866144", "beat", "0.0", "body", "1.0", "bpitch", "-12", "breath", "0.0", "bres", "0.39370078", "btone", "0.23622048", "cfilter", "0.19685039", "choir", "0.78740156", "color", "0.0", "creso", "0.07874016", "ctype", "Low", "detune", "0.19685039", "evolve", "0.0", "formant", "0.31496063", "grain", "0.0", "interval", "-12", "morph", "0.0", "morphTo", "Off", "motion", "0.19685039", "mrate", "0.23622048", "mtime", "0.0", "odd", "0.15748031", "partials", "0.78740156", "peak", "0.0", "release", "0.7480315", "shape", "0.0", "soft", "0.0", "stretch", "0.0", "tide", "0.15748031", "tilt", "0.78740156", "timbre", "0.31496063", "tperiod", "0.23622048", "velsens", "0.2992126", "warmth", "0.31496063", nullptr};
inline const char *const factory56[] = {"air", "0.0", "attack", "0.70866144", "beat", "0.07874016", "body", "1.0", "bpitch", "Unison", "breath", "0.11811024", "bres", "0.5511811", "btone", "0.503937", "cfilter", "0.39370078", "choir", "0.15748031", "color", "0.0", "creso", "0.0", "ctype", "Low", "detune", "0.15748031", "evolve", "0.39370078", "formant", "0.6692913", "grain", "0.0", "interval", "Unison", "morph", "0.0", "morphTo", "Off", "motion", "0.39370078", "mrate", "0.31496063", "mtime", "0.0", "odd", "0.07874016", "partials", "0.9448819", "peak", "1.0", "release", "0.78740156", "shape", "0.0", "soft", "0.0", "stretch", "0.0", "tide", "0.62992126", "tilt", "0.15748031", "timbre", "0.503937", "tperiod", "0.39370078", "velsens", "0.2992126", "warmth", "0.03937008", nullptr};
inline const char *const factory57[] = {"air", "0.15748031", "attack", "0.47244096", "beat", "0.11811024", "body", "1.0", "bpitch", "Unison", "breath", "0.31496063", "bres", "0.62992126", "btone", "0.35433072", "cfilter", "0.35433072", "choir", "0.62992126", "color", "0.31496063", "creso", "0.62992126", "ctype", "Band", "detune", "0.39370078", "evolve", "0.15748031", "formant", "0.5905512", "grain", "0.47244096", "interval", "Unison", "morph", "0.0", "morphTo", "Off", "motion", "0.31496063", "mrate", "0.43307087", "mtime", "0.0", "odd", "0.47244096", "partials", "0.39370078", "peak", "0.0", "release", "0.62992126", "shape", "0.5511811", "soft", "0.0", "stretch", "0.15748031", "tide", "0.19685039", "tilt", "0.511811", "timbre", "0.43307087", "tperiod", "0.31496063", "velsens", "0.2992126", "warmth", "0.78740156", nullptr};
inline const char *const factory58[] = {"air", "0.0", "attack", "0.78740156", "beat", "0.0", "body", "1.0", "bpitch", "Unison", "breath", "0.0", "bres", "0.39370078", "btone", "0.503937", "cfilter", "0.39370078", "choir", "0.0", "color", "0.0", "creso", "0.0", "ctype", "Low", "detune", "0.0", "evolve", "0.0", "formant", "0.6692913", "grain", "0.0", "interval", "Unison", "morph", "0.0", "morphTo", "Off", "motion", "0.03937008", "mrate", "0.15748031", "mtime", "0.0", "odd", "0.0", "partials", "0.984252", "peak", "0.0", "release", "0.78740156", "shape", "0.0", "soft", "0.0", "stretch", "0.0", "tide", "0.0", "tilt", "1.0", "timbre", "0.39370078", "tperiod", "0.31496063", "velsens", "0.2992126", "warmth", "0.0", nullptr};
inline const char *const factory59[] = {"air", "0.0", "attack", "0.8267717", "beat", "0.0", "body", "1.0", "bpitch", "Unison", "breath", "0.07874016", "bres", "0.39370078", "btone", "0.39370078", "cfilter", "0.31496063", "choir", "0.7480315", "color", "0.0", "creso", "0.07874016", "ctype", "Low", "detune", "0.27559054", "evolve", "0.0", "formant", "0.6692913", "grain", "0.0", "interval", "Unison", "morph", "0.0", "morphTo", "Off", "motion", "0.27559054", "mrate", "0.23622048", "mtime", "0.0", "odd", "0.15748031", "partials", "0.35433072", "peak", "0.0", "release", "0.86614174", "shape", "0.0", "soft", "0.9448819", "stretch", "0.0", "tide", "0.15748031", "tilt", "0.6692913", "timbre", "0.40944883", "tperiod", "0.35433072", "velsens", "0.2992126", "warmth", "0.11811024", nullptr};
inline const char *const factory60[] = {"air", "0.0", "attack", "0.47244096", "beat", "0.27559054", "body", "1.0", "bpitch", "+19", "breath", "0.11811024", "bres", "0.70866144", "btone", "0.7480315", "cfilter", "0.5905512", "choir", "0.27559054", "color", "0.62992126", "creso", "0.6692913", "ctype", "High", "detune", "0.11811024", "evolve", "0.15748031", "formant", "0.86614174", "grain", "0.0", "interval", "+12", "morph", "0.0", "morphTo", "Off", "motion", "0.27559054", "mrate", "0.43307087", "mtime", "0.0", "odd", "0.9448819", "partials", "0.9055118", "peak", "0.5511811", "release", "0.70866144", "shape", "0.503937", "soft", "0.0", "stretch", "0.35433072", "tide", "0.11811024", "tilt", "0.11811024", "timbre", "0.6692913", "tperiod", "0.31496063", "velsens", "0.2992126", "warmth", "0.27559054", nullptr};
inline const char *const factory61[] = {"air", "0.15748031", "attack", "0.5511811", "beat", "0.5511811", "body", "1.0", "bpitch", "+12", "breath", "0.23622048", "bres", "0.47244096", "btone", "0.5511811", "cfilter", "0.47244096", "choir", "0.9448819", "color", "0.15748031", "creso", "0.31496063", "ctype", "Band", "detune", "0.9448819", "evolve", "0.31496063", "formant", "0.6692913", "grain", "0.23622048", "interval", "Unison", "morph", "0.0", "morphTo", "Off", "motion", "0.86614174", "mrate", "0.78740156", "mtime", "0.0", "odd", "0.23622048", "partials", "0.5905512", "peak", "0.0", "release", "0.6692913", "shape", "0.9448819", "soft", "0.0", "stretch", "0.0", "tide", "0.31496063", "tilt", "0.31496063", "timbre", "0.5511811", "tperiod", "0.11811024", "velsens", "0.2992126", "warmth", "0.23622048", nullptr};
inline const char *const factory62[] = {"air", "0.0", "attack", "0.9448819", "beat", "0.0", "body", "1.0", "bpitch", "-12", "breath", "0.11811024", "bres", "0.31496063", "btone", "0.23622048", "cfilter", "0.17322835", "choir", "1.0", "color", "0.0", "creso", "0.47244096", "ctype", "Low", "detune", "0.15748031", "evolve", "0.0", "formant", "0.31496063", "grain", "0.0", "interval", "-12", "morph", "0.0", "morphTo", "Off", "motion", "0.15748031", "mrate", "0.15748031", "mtime", "0.0", "odd", "0.70866144", "partials", "0.47244096", "peak", "0.23622048", "release", "0.9448819", "shape", "0.503937", "soft", "0.23622048", "stretch", "0.0", "tide", "0.47244096", "tilt", "0.7480315", "timbre", "0.27559054", "tperiod", "0.5511811", "velsens", "0.2992126", "warmth", "0.5511811", nullptr};
inline const char *const factory63[] = {"air", "0.23622048", "attack", "0.78740156", "beat", "0.19685039", "body", "1.0", "bpitch", "+19", "breath", "0.35433072", "bres", "0.62992126", "btone", "0.86614174", "cfilter", "0.70866144", "choir", "0.5511811", "color", "0.23622048", "creso", "0.11811024", "ctype", "High", "detune", "0.43307087", "evolve", "0.47244096", "formant", "0.9448819", "grain", "0.0", "interval", "+12", "morph", "0.0", "morphTo", "Off", "motion", "0.47244096", "mrate", "0.39370078", "mtime", "0.0", "odd", "0.11811024", "partials", "0.8267717", "peak", "0.31496063", "release", "0.86614174", "shape", "0.07874016", "soft", "0.0", "stretch", "0.03937008", "tide", "0.5511811", "tilt", "0.11811024", "timbre", "0.78740156", "tperiod", "0.27559054", "velsens", "0.2992126", "warmth", "0.15748031", nullptr};
inline const char *const factory64[] = {"air", "0.03937008", "attack", "0.86614174", "beat", "0.0", "body", "1.0", "bpitch", "-12", "breath", "0.7480315", "bres", "0.78740156", "btone", "0.14173229", "cfilter", "0.14173229", "choir", "0.43307087", "color", "0.47244096", "creso", "0.39370078", "ctype", "Low", "detune", "0.23622048", "evolve", "0.07874016", "formant", "0.31496063", "grain", "0.39370078", "interval", "-12", "morph", "0.0", "morphTo", "Off", "motion", "0.23622048", "mrate", "0.15748031", "mtime", "0.0", "odd", "0.23622048", "partials", "0.31496063", "peak", "0.0", "release", "0.9448819", "shape", "0.0", "soft", "0.47244096", "stretch", "0.0", "tide", "0.35433072", "tilt", "0.86614174", "timbre", "0.23622048", "tperiod", "0.47244096", "velsens", "0.2992126", "warmth", "0.23622048", nullptr};
inline const char *const factory65[] = {"air", "0.0", "attack", "0.39370078", "beat", "0.31496063", "body", "1.0", "bpitch", "+24", "breath", "0.15748031", "bres", "0.78740156", "btone", "0.78740156", "cfilter", "0.47244096", "choir", "0.07874016", "color", "0.70866144", "creso", "0.0", "ctype", "Low", "detune", "0.09448819", "evolve", "0.35433072", "formant", "0.9448819", "grain", "0.0", "interval", "+12", "morph", "0.0", "morphTo", "Off", "motion", "0.19685039", "mrate", "0.23622048", "mtime", "0.0", "odd", "0.07874016", "partials", "0.9448819", "peak", "0.86614174", "release", "0.9448819", "shape", "0.0", "soft", "1.0", "stretch", "0.19685039", "tide", "0.11811024", "tilt", "0.23622048", "timbre", "0.70866144", "tperiod", "0.43307087", "velsens", "0.2992126", "warmth", "0.0", nullptr};
inline const char *const factory66[] = {"air", "0.0", "attack", "0.78740156", "beat", "0.0", "body", "1.0", "bpitch", "Unison", "breath", "0.07874016", "bres", "0.47244096", "btone", "0.39370078", "cfilter", "0.2992126", "choir", "0.86614174", "color", "0.0", "creso", "0.43307087", "ctype", "Band", "detune", "0.23622048", "evolve", "0.11811024", "formant", "0.48818898", "grain", "0.0", "interval", "-12", "morph", "0.0", "morphTo", "Off", "motion", "0.23622048", "mrate", "0.19685039", "mtime", "0.0", "odd", "0.31496063", "partials", "0.6692913", "peak", "0.70866144", "release", "0.78740156", "shape", "0.0", "soft", "0.70866144", "stretch", "0.0", "tide", "0.23622048", "tilt", "0.5511811", "timbre", "0.39370078", "tperiod", "0.511811", "velsens", "0.2992126", "warmth", "0.19685039", nullptr};
inline const char *const factory67[] = {"air", "0.31496063", "attack", "0.31496063", "beat", "0.0", "body", "1.0", "bpitch", "+19", "breath", "1.0", "bres", "0.86614174", "btone", "0.78740156", "cfilter", "0.5511811", "choir", "0.27559054", "color", "0.70866144", "creso", "0.23622048", "ctype", "High", "detune", "0.31496063", "evolve", "0.0", "formant", "0.6692913", "grain", "0.6692913", "interval", "Unison", "morph", "0.0", "morphTo", "Off", "motion", "0.62992126", "mrate", "0.86614174", "mtime", "0.0", "odd", "0.39370078", "partials", "0.31496063", "peak", "0.0", "release", "0.5511811", "shape", "0.23622048", "soft", "0.0", "stretch", "0.0", "tide", "0.15748031", "tilt", "0.31496063", "timbre", "0.62992126", "tperiod", "0.15748031", "velsens", "0.2992126", "warmth", "0.11811024", nullptr};
inline const char *const factory68[] = {"air", "0.0", "attack", "0.86614174", "beat", "0.062992126", "body", "1.0", "bpitch", "Unison", "breath", "0.062992126", "bres", "0.47244096", "btone", "0.503937", "cfilter", "0.35433072", "choir", "0.6692913", "color", "0.0", "creso", "0.0", "ctype", "Low", "detune", "0.17322835", "evolve", "0.07874016", "formant", "0.6692913", "grain", "0.0", "interval", "+7", "morph", "0.0", "morphTo", "Off", "motion", "0.15748031", "mrate", "0.11811024", "mtime", "0.0", "odd", "0.07874016", "partials", "0.5511811", "peak", "0.15748031", "release", "0.9448819", "shape", "0.0", "soft", "0.86614174", "stretch", "0.0", "tide", "0.27559054", "tilt", "0.78740156", "timbre", "0.43307087", "tperiod", "0.62992126", "velsens", "0.2992126", "warmth", "0.07874016", nullptr};
inline const char *const factory69[] = {"air", "0.47244096", "attack", "0.70866144", "beat", "0.15748031", "body", "1.0", "bpitch", "-12", "breath", "0.86614174", "bres", "0.5511811", "btone", "0.27559054", "cfilter", "0.22047244", "choir", "0.62992126", "color", "0.31496063", "creso", "0.5511811", "ctype", "Low", "detune", "0.5511811", "evolve", "0.39370078", "formant", "0.47244096", "grain", "0.5511811", "interval", "-12", "morph", "0.0", "morphTo", "Off", "motion", "0.78740156", "mrate", "0.6692913", "mtime", "0.0", "odd", "0.31496063", "partials", "0.31496063", "peak", "0.0", "release", "0.86614174", "shape", "0.23622048", "soft", "0.15748031", "stretch", "0.0", "tide", "0.9448819", "tilt", "0.70866144", "timbre", "0.31496063", "tperiod", "0.19685039", "velsens", "0.2992126", "warmth", "0.70866144", nullptr};
inline const char *const factory70[] = {"air", "0.07874016", "attack", "0.6692913", "beat", "0.23622048", "body", "1.0", "bpitch", "+12", "breath", "0.19685039", "bres", "0.70866144", "btone", "0.6692913", "cfilter", "0.511811", "choir", "0.39370078", "color", "0.39370078", "creso", "0.15748031", "ctype", "Band", "detune", "0.31496063", "evolve", "0.78740156", "formant", "0.8267717", "grain", "0.0", "interval", "+12", "morph", "0.0", "morphTo", "Off", "motion", "0.47244096", "mrate", "0.35433072", "mtime", "0.0", "odd", "0.47244096", "partials", "0.9448819", "peak", "0.62992126", "release", "0.8267717", "shape", "0.0", "soft", "0.31496063", "stretch", "0.11811024", "tide", "0.39370078", "tilt", "0.19685039", "timbre", "0.62992126", "tperiod", "0.31496063", "velsens", "0.2992126", "warmth", "0.07874016", nullptr};
inline const char *const factory71[] = {"attack", "0.15", "dens_mul", "0.0", "drift", "0.35", "end", "1.0", "freeze", "Off", "grain_tone", "-0.1", "harmony", "0.35", "level", "0.75", "mode", "Cloud", "motion", "0.3", "pitch", "0.0", "pitch_rand", "0.0", "position", "0.35", "release", "0.45", "reverse", "0.1", "scan", "0.0", "scatter", "0.5", "size_mul", "0.0", "size_rand", "0.3", "source", "Felt Piano", "start", "0.0", "texture", "0.78", "velo", "0.5", "window", "Auto", nullptr};
inline const char *const factory72[] = {"attack", "0.15", "dens_mul", "0.0", "drift", "0.3", "end", "1.0", "freeze", "Off", "grain_tone", "-0.1", "harmony", "0.5", "level", "0.75", "mode", "Bloom", "motion", "0.35", "pitch", "0.0", "pitch_rand", "0.0", "position", "0.35", "release", "0.45", "reverse", "0.1", "scan", "0.0", "scatter", "0.4", "size_mul", "0.0", "size_rand", "0.3", "source", "Bowed Glass", "start", "0.0", "texture", "0.7", "velo", "0.5", "window", "Auto", nullptr};
inline const char *const factory73[] = {"attack", "0.15", "dens_mul", "0.0", "drift", "0.3", "end", "1.0", "freeze", "Off", "grain_tone", "-0.1", "harmony", "0.3", "level", "0.75", "mode", "Dust", "motion", "0.4", "pitch", "0.0", "pitch_rand", "0.0", "position", "0.35", "release", "0.45", "reverse", "0.1", "scan", "0.0", "scatter", "0.7", "size_mul", "0.0", "size_rand", "0.3", "source", "Music Box", "start", "0.0", "texture", "0.45", "velo", "0.5", "window", "Auto", nullptr};
inline const char *const factory74[] = {"attack", "0.15", "dens_mul", "0.0", "drift", "0.55", "end", "1.0", "freeze", "Off", "grain_tone", "-0.1", "harmony", "0.25", "level", "0.75", "mode", "Drift", "motion", "0.4", "pitch", "0.0", "pitch_rand", "0.0", "position", "0.35", "release", "0.45", "reverse", "0.1", "scan", "0.0", "scatter", "0.45", "size_mul", "0.0", "size_rand", "0.3", "source", "Warm Pad", "start", "0.0", "texture", "0.7", "velo", "0.5", "window", "Auto", nullptr};
inline const char *const factory75[] = {"attack", "0.15", "dens_mul", "0.0", "drift", "0.4", "end", "1.0", "freeze", "Off", "grain_tone", "-0.1", "harmony", "0.15", "level", "0.75", "mode", "Tape", "motion", "0.35", "pitch", "0.0", "pitch_rand", "0.0", "position", "0.35", "release", "0.45", "reverse", "0.1", "scan", "0.0", "scatter", "0.25", "size_mul", "0.0", "size_rand", "0.3", "source", "Strings", "start", "0.0", "texture", "0.6", "velo", "0.5", "window", "Auto", nullptr};
inline const char *const factory76[] = {"attack", "0.15", "dens_mul", "0.0", "drift", "0.4", "end", "1.0", "freeze", "Off", "grain_tone", "-0.1", "harmony", "0.4", "level", "0.75", "mode", "Cloud", "motion", "0.25", "pitch", "0.0", "pitch_rand", "0.0", "position", "0.35", "release", "0.45", "reverse", "0.1", "scan", "0.0", "scatter", "0.4", "size_mul", "0.0", "size_rand", "0.3", "source", "Low Drone", "start", "0.0", "texture", "0.85", "velo", "0.5", "window", "Auto", nullptr};
inline const char *const factory77[] = {"attack", "0.15", "dens_mul", "0.0", "drift", "0.4", "end", "1.0", "freeze", "Off", "grain_tone", "-0.1", "harmony", "0.45", "level", "0.75", "mode", "Cloud", "motion", "0.3", "pitch", "0.0", "pitch_rand", "0.0", "position", "0.35", "release", "0.45", "reverse", "0.1", "scan", "0.0", "scatter", "0.6", "size_mul", "0.0", "size_rand", "0.3", "source", "Rain Field", "start", "0.0", "texture", "0.88", "velo", "0.5", "window", "Auto", nullptr};
inline const char *const factory78[] = {"attack", "0.15", "dens_mul", "0.0", "drift", "0.3", "end", "1.0", "freeze", "Off", "grain_tone", "-0.1", "harmony", "0.2", "level", "0.75", "mode", "Pulse", "motion", "0.3", "pitch", "0.0", "pitch_rand", "0.0", "position", "0.35", "release", "0.45", "reverse", "0.1", "scan", "0.0", "scatter", "0.6", "size_mul", "0.0", "size_rand", "0.3", "source", "Kalimba", "start", "0.0", "texture", "0.4", "velo", "0.5", "window", "Auto", nullptr};
inline const char *const factory79[] = {"attack", "0.15", "dens_mul", "0.0", "drift", "0.35", "end", "1.0", "freeze", "Off", "grain_tone", "-0.1", "harmony", "0.4", "level", "0.75", "mode", "Cloud", "motion", "0.3", "pitch", "0.0", "pitch_rand", "0.0", "position", "0.35", "release", "0.45", "reverse", "0.1", "scan", "0.0", "scatter", "0.45", "size_mul", "0.0", "size_rand", "0.3", "source", "Breath Choir", "start", "0.0", "texture", "0.85", "velo", "0.5", "window", "Auto", nullptr};
inline const char *const factory80[] = {"attack", "0.15", "dens_mul", "0.0", "drift", "0.4", "end", "1.0", "freeze", "Off", "grain_tone", "-0.1", "harmony", "0.35", "level", "0.75", "mode", "Bloom", "motion", "0.4", "pitch", "0.0", "pitch_rand", "0.0", "position", "0.35", "release", "0.45", "reverse", "0.1", "scan", "0.0", "scatter", "0.5", "size_mul", "0.0", "size_rand", "0.3", "source", "Breath Choir", "start", "0.0", "texture", "0.75", "velo", "0.5", "window", "Auto", nullptr};
inline const char *const factory81[] = {"attack", "0.15", "dens_mul", "0.0", "drift", "0.6", "end", "1.0", "freeze", "Off", "grain_tone", "-0.1", "harmony", "0.3", "level", "0.75", "mode", "Drift", "motion", "0.4", "pitch", "0.0", "pitch_rand", "0.0", "position", "0.35", "release", "0.45", "reverse", "0.1", "scan", "0.0", "scatter", "0.4", "size_mul", "0.0", "size_rand", "0.3", "source", "Low Drone", "start", "0.0", "texture", "0.65", "velo", "0.5", "window", "Auto", nullptr};
inline const char *const factory82[] = {"attack", "0.15", "dens_mul", "0.0", "drift", "0.2", "end", "1.0", "freeze", "Off", "grain_tone", "0.4", "harmony", "0.3", "level", "0.75", "mode", "Dust", "motion", "0.5", "pitch", "12.0", "pitch_rand", "0.0", "position", "0.35", "release", "0.45", "reverse", "0.2", "scan", "0.0", "scatter", "0.55", "size_mul", "0.0", "size_rand", "0.3", "source", "Glass Tines", "start", "0.0", "texture", "0.35", "velo", "0.5", "window", "Auto", nullptr};
inline const char *const factory83[] = {"attack", "0.15", "dens_mul", "0.0", "drift", "0.5", "end", "1.0", "freeze", "Off", "grain_tone", "-0.1", "harmony", "0.3", "level", "0.75", "mode", "Bloom", "motion", "0.5", "pitch", "0.0", "pitch_rand", "0.0", "position", "0.35", "release", "0.45", "reverse", "0.1", "scan", "0.0", "scatter", "0.7", "size_mul", "0.0", "size_rand", "0.3", "source", "Kalimba", "start", "0.0", "texture", "0.6", "velo", "0.5", "window", "Auto", nullptr};
inline const char *const factory84[] = {"attack", "0.15", "dens_mul", "0.0", "drift", "0.4", "end", "1.0", "freeze", "Off", "grain_tone", "-0.1", "harmony", "0.3", "level", "0.75", "mode", "Tape", "motion", "0.4", "pitch", "0.0", "pitch_rand", "0.0", "position", "0.35", "release", "0.45", "reverse", "0.1", "scan", "0.0", "scatter", "0.2", "size_mul", "0.0", "size_rand", "0.3", "source", "Rain Field", "start", "0.0", "texture", "0.5", "velo", "0.5", "window", "Auto", nullptr};
inline const char *const factory85[] = {"attack", "0.01", "cutoff", "0.8", "decay", "0.3", "drive", "0.0", "fenv", "0.2", "ftype", "Low", "keytrack", "0.4", "lfocut", "0.0", "lfodiv", "3", "lfopitch", "0.15", "lfopos", "0.15", "lfowave", "Sine", "mattack", "0.01", "mdecay", "0.8", "menvpos", "0.5", "mrelease", "1.0", "msustain", "0.2", "noise", "0.0", "o1bend", "0.0", "o1fine", "0.0", "o1level", "0.8", "o1oct", "0.0", "o1pos", "0.4", "o1semi", "0.0", "o1table", "Classic", "o2bend", "0.0", "o2fine", "7.0", "o2level", "0.0", "o2oct", "0.0", "o2pos", "0.3", "o2semi", "0.0", "o2table", "Classic", "release", "0.25", "reso", "0.25", "spread", "0.3", "sub", "0.0", "sustain", "0.8", "unison", "1.0", "velsens", "0.5", "wtframe", "Auto", nullptr};
inline const char *const factory86[] = {"attack", "0.8", "cutoff", "0.7", "decay", "0.3", "drive", "0.0", "fenv", "0.2", "ftype", "Low", "keytrack", "0.4", "lfocut", "0.0", "lfodiv", "0", "lfopitch", "0.0", "lfopos", "0.2", "lfowave", "Sine", "mattack", "3.0", "mdecay", "4.0", "menvpos", "0.6", "mrelease", "1.0", "msustain", "0.7", "noise", "0.0", "o1bend", "0.0", "o1fine", "0.0", "o1level", "0.8", "o1oct", "0.0", "o1pos", "0.0", "o1semi", "0.0", "o1table", "Vowels", "o2bend", "0.0", "o2fine", "9.0", "o2level", "0.6", "o2oct", "0.0", "o2pos", "0.5", "o2semi", "0.0", "o2table", "Vowels", "release", "2.5", "reso", "0.15", "spread", "0.4", "sub", "0.0", "sustain", "0.8", "unison", "3", "velsens", "0.5", "wtframe", "Auto", nullptr};
inline const char *const factory87[] = {"attack", "0.4", "cutoff", "0.65", "decay", "0.3", "drive", "0.0", "fenv", "0.2", "ftype", "Low", "keytrack", "0.4", "lfocut", "0.0", "lfodiv", "1", "lfopitch", "0.0", "lfopos", "0.4", "lfowave", "Sine", "mattack", "0.5", "mdecay", "2.0", "menvpos", "0.0", "mrelease", "1.0", "msustain", "0.5", "noise", "0.0", "o1bend", "0.0", "o1fine", "0.0", "o1level", "0.8", "o1oct", "0.0", "o1pos", "0.2", "o1semi", "0.0", "o1table", "PWM", "o2bend", "0.0", "o2fine", "-8.0", "o2level", "0.7", "o2oct", "0.0", "o2pos", "0.6", "o2semi", "0.0", "o2table", "PWM", "release", "1.2", "reso", "0.1", "spread", "0.5", "sub", "0.0", "sustain", "0.8", "unison", "2", "velsens", "0.5", "wtframe", "Auto", nullptr};
inline const char *const factory88[] = {"attack", "0.01", "cutoff", "0.85", "decay", "0.5", "drive", "0.3", "fenv", "0.3", "ftype", "Low", "keytrack", "0.4", "lfocut", "0.0", "lfodiv", "1.0", "lfopitch", "0.0", "lfopos", "0.15", "lfowave", "Sine", "mattack", "0.0", "mdecay", "0.6", "menvpos", "0.9", "mrelease", "1.0", "msustain", "0.1", "noise", "0.0", "o1bend", "0.0", "o1fine", "0.0", "o1level", "0.8", "o1oct", "0.0", "o1pos", "0.0", "o1semi", "0.0", "o1table", "Sync", "o2bend", "0.0", "o2fine", "7.0", "o2level", "0.0", "o2oct", "0.0", "o2pos", "0.3", "o2semi", "0.0", "o2table", "Classic", "release", "0.2", "reso", "0.15", "spread", "0.3", "sub", "0.0", "sustain", "0.6", "unison", "1.0", "velsens", "0.5", "wtframe", "Auto", nullptr};
inline const char *const factory89[] = {"attack", "0.0", "cutoff", "0.9", "decay", "2.5", "drive", "0.0", "fenv", "0.0", "ftype", "Low", "keytrack", "0.8", "lfocut", "0.0", "lfodiv", "1.0", "lfopitch", "0.0", "lfopos", "0.15", "lfowave", "Sine", "mattack", "0.0", "mdecay", "1.5", "menvpos", "-0.6", "mrelease", "1.0", "msustain", "0.0", "noise", "0.0", "o1bend", "0.0", "o1fine", "0.0", "o1level", "0.8", "o1oct", "0.0", "o1pos", "0.6", "o1semi", "0.0", "o1table", "FM", "o2bend", "0.0", "o2fine", "7.0", "o2level", "0.0", "o2oct", "0.0", "o2pos", "0.3", "o2semi", "0.0", "o2table", "Classic", "release", "2.0", "reso", "0.15", "spread", "0.3", "sub", "0.0", "sustain", "0.0", "unison", "1.0", "velsens", "0.5", "wtframe", "Auto", nullptr};
inline const char *const factory90[] = {"attack", "0.005", "cutoff", "0.75", "decay", "1.2", "drive", "0.0", "fenv", "0.2", "ftype", "Low", "keytrack", "0.4", "lfocut", "0.0", "lfodiv", "1.0", "lfopitch", "0.0", "lfopos", "0.15", "lfowave", "Sine", "mattack", "0.0", "mdecay", "1.2", "menvpos", "0.4", "mrelease", "1.0", "msustain", "0.2", "noise", "0.0", "o1bend", "0.0", "o1fine", "0.0", "o1level", "0.8", "o1oct", "0.0", "o1pos", "0.2", "o1semi", "0.0", "o1table", "Glass", "o2bend", "0.0", "o2fine", "7.0", "o2level", "0.3", "o2oct", "1", "o2pos", "0.0", "o2semi", "0.0", "o2table", "Classic", "release", "1.0", "reso", "0.15", "spread", "0.3", "sub", "0.0", "sustain", "0.3", "unison", "1.0", "velsens", "0.5", "wtframe", "Auto", nullptr};
inline const char *const factory91[] = {"attack", "0.02", "cutoff", "0.9", "decay", "0.3", "drive", "0.0", "fenv", "0.2", "ftype", "Low", "keytrack", "0.4", "lfocut", "0.0", "lfodiv", "0", "lfopitch", "0.0", "lfopos", "0.5", "lfowave", "Tri", "mattack", "0.5", "mdecay", "2.0", "menvpos", "0.0", "mrelease", "1.0", "msustain", "0.5", "noise", "0.0", "o1bend", "0.0", "o1fine", "0.0", "o1level", "0.8", "o1oct", "0.0", "o1pos", "0.0", "o1semi", "0.0", "o1table", "Organ", "o2bend", "0.0", "o2fine", "7.0", "o2level", "0.0", "o2oct", "0.0", "o2pos", "0.3", "o2semi", "0.0", "o2table", "Classic", "release", "0.15", "reso", "0.0", "spread", "0.3", "sub", "0.0", "sustain", "1.0", "unison", "1.0", "velsens", "0.5", "wtframe", "Auto", nullptr};
inline const char *const factory92[] = {"attack", "0.0", "cutoff", "0.55", "decay", "0.4", "drive", "0.4", "fenv", "0.35", "ftype", "Low", "keytrack", "0.4", "lfocut", "0.0", "lfodiv", "1.0", "lfopitch", "0.0", "lfopos", "0.15", "lfowave", "Sine", "mattack", "0.0", "mdecay", "0.3", "menvpos", "0.7", "mrelease", "1.0", "msustain", "0.0", "noise", "0.0", "o1bend", "0.0", "o1fine", "0.0", "o1level", "0.8", "o1oct", "-1", "o1pos", "0.1", "o1semi", "0.0", "o1table", "Fold", "o2bend", "0.0", "o2fine", "7.0", "o2level", "0.0", "o2oct", "0.0", "o2pos", "0.3", "o2semi", "0.0", "o2table", "Classic", "release", "0.15", "reso", "0.15", "spread", "0.3", "sub", "0.5", "sustain", "0.7", "unison", "1.0", "velsens", "0.5", "wtframe", "Auto", nullptr};
inline const char *const factory93[] = {"attack", "0.01", "cutoff", "0.8", "decay", "0.3", "drive", "0.0", "fenv", "0.2", "ftype", "Low", "keytrack", "0.4", "lfocut", "0.0", "lfodiv", "4", "lfopitch", "0.0", "lfopos", "0.6", "lfowave", "S&H", "mattack", "0.5", "mdecay", "2.0", "menvpos", "0.0", "mrelease", "1.0", "msustain", "0.5", "noise", "0.0", "o1bend", "0.0", "o1fine", "0.0", "o1level", "0.8", "o1oct", "0.0", "o1pos", "0.3", "o1semi", "0.0", "o1table", "Digital", "o2bend", "0.0", "o2fine", "7.0", "o2level", "0.5", "o2oct", "0.0", "o2pos", "0.9", "o2semi", "7", "o2table", "Digital", "release", "0.4", "reso", "0.3", "spread", "0.3", "sub", "0.0", "sustain", "0.8", "unison", "1.0", "velsens", "0.5", "wtframe", "Auto", nullptr};
inline const char *const factory94[] = {"attack", "1.2", "cutoff", "0.7", "decay", "0.3", "drive", "0.0", "fenv", "0.2", "ftype", "Low", "keytrack", "0.4", "lfocut", "0.2", "lfodiv", "0", "lfopitch", "0.0", "lfopos", "0.15", "lfowave", "Sine", "mattack", "6.0", "mdecay", "6.0", "menvpos", "1.0", "mrelease", "1.0", "msustain", "1.0", "noise", "0.0", "o1bend", "0.0", "o1fine", "0.0", "o1level", "0.8", "o1oct", "0.0", "o1pos", "0.0", "o1semi", "0.0", "o1table", "Comb", "o2bend", "0.0", "o2fine", "7.0", "o2level", "0.0", "o2oct", "0.0", "o2pos", "0.3", "o2semi", "0.0", "o2table", "Classic", "release", "3.0", "reso", "0.15", "spread", "0.45", "sub", "0.0", "sustain", "0.8", "unison", "4", "velsens", "0.5", "wtframe", "Auto", nullptr};
inline const char *const factory95[] = {"attack", "0.0", "cutoff", "0.7", "decay", "0.6", "drive", "0.0", "fenv", "0.4", "ftype", "Low", "keytrack", "0.4", "lfocut", "0.0", "lfodiv", "1.0", "lfopitch", "0.0", "lfopos", "0.15", "lfowave", "Sine", "mattack", "0.0", "mdecay", "0.5", "menvpos", "-1.0", "mrelease", "1.0", "msustain", "0.0", "noise", "0.0", "o1bend", "0.0", "o1fine", "0.0", "o1level", "0.8", "o1oct", "0.0", "o1pos", "1.0", "o1semi", "0.0", "o1table", "Odd Even", "o2bend", "0.0", "o2fine", "7.0", "o2level", "0.0", "o2oct", "0.0", "o2pos", "0.3", "o2semi", "0.0", "o2table", "Classic", "release", "0.4", "reso", "0.3", "spread", "0.3", "sub", "0.0", "sustain", "0.0", "unison", "1.0", "velsens", "0.5", "wtframe", "Auto", nullptr};
inline const char *const factory96[] = {"attack", "2.0", "cutoff", "0.85", "decay", "0.3", "drive", "0.0", "fenv", "0.2", "ftype", "Low", "keytrack", "0.4", "lfocut", "0.0", "lfodiv", "1.0", "lfopitch", "0.0", "lfopos", "0.15", "lfowave", "Sine", "mattack", "5.0", "mdecay", "8.0", "menvpos", "1.0", "mrelease", "1.0", "msustain", "1.0", "noise", "0.0", "o1bend", "0.0", "o1fine", "0.0", "o1level", "0.8", "o1oct", "0.0", "o1pos", "0.0", "o1semi", "0.0", "o1table", "Harmonic Sweep", "o2bend", "0.0", "o2fine", "10.0", "o2level", "0.6", "o2oct", "0.0", "o2pos", "0.0", "o2semi", "0.0", "o2table", "Harmonic Sweep", "release", "3.0", "reso", "0.05", "spread", "0.3", "sub", "0.0", "sustain", "0.8", "unison", "2", "velsens", "0.5", "wtframe", "Auto", nullptr};
inline const char *const factory97[] = {"cHiAtk", "3", "cHiMk", "2", "cHiRatio", "3", "cHiRel", "80", "cHiThr", "-24", "cLoAtk", "8", "cLoMk", "3", "cLoRatio", "4", "cLoRel", "140", "cLoThr", "-22", "cMidMk", "1", "cMidRatio", "2.5", "cMidThr", "-20", "eqHiFreq", "9000", "eqHiGain", "4", "eqLoFreq", "70", "eqLoGain", "4", "eqMidFreq", "450", "eqMidGain", "-2", "limCeil", "-0.3", "limRel", "80", "outGain", "2", "strength", "1.0", "xHi", "3000", "xLo", "120", nullptr};
inline const char *const factory98[] = {"cLoAtk", "12", "cLoMk", "2", "cLoRatio", "3", "cLoRel", "160", "cLoThr", "-20", "cMidMk", "1", "cMidRatio", "2.5", "cMidThr", "-18", "eqHiFreq", "10000", "eqHiGain", "1.5", "eqLoFreq", "90", "eqLoGain", "2", "limCeil", "-0.5", "outGain", "1.5", "strength", "1.0", "xHi", "2500", "xLo", "160", nullptr};
inline const char *const factory99[] = {"cHiAtk", "2", "cHiMk", "2", "cHiRatio", "4", "cHiRel", "60", "cHiThr", "-26", "cLoRatio", "1.5", "cMidRatio", "2", "eqHiFreq", "11000", "eqHiGain", "5", "eqMidFreq", "4000", "eqMidGain", "1", "limCeil", "-0.3", "outGain", "2", "strength", "1.0", "xHi", "4000", nullptr};
inline const char *const factory100[] = {"cHiMk", "2", "cHiRatio", "3", "cHiThr", "-20", "cLoAtk", "6", "cLoMk", "3", "cLoRatio", "5", "cLoRel", "120", "cLoThr", "-18", "cMidAtk", "8", "cMidMk", "3", "cMidRatio", "4", "cMidRel", "120", "cMidThr", "-16", "eqHiFreq", "8000", "eqHiGain", "2", "eqLoFreq", "80", "eqLoGain", "3", "eqMidFreq", "2200", "eqMidGain", "3", "eqMidQ", "1.2", "limCeil", "-0.2", "limRel", "60", "outGain", "3", "strength", "1.0", "xHi", "2000", "xLo", "150", nullptr};
inline const char *const factory101[] = {"cHiRatio", "1.5", "cLoAtk", "4", "cLoMk", "3", "cLoRatio", "6", "cLoRel", "100", "cLoThr", "-16", "cMidRatio", "2", "eqLoFreq", "60", "eqLoGain", "3", "eqMidFreq", "700", "eqMidGain", "-2", "limCeil", "-0.2", "outGain", "2.5", "strength", "1.0", "xHi", "3000", "xLo", "120", nullptr};
inline const char *const factory102[] = {"cHiMk", "1", "cHiRatio", "2", "cHiThr", "-22", "cLoMk", "1.5", "cLoRatio", "2.5", "cLoThr", "-22", "cMidMk", "1", "cMidRatio", "2", "cMidThr", "-20", "eqHiFreq", "9000", "eqHiGain", "1.5", "eqLoFreq", "90", "eqLoGain", "1.5", "limCeil", "-0.5", "outGain", "1.5", "strength", "0.85", "xHi", "2600", "xLo", "180", nullptr};
inline const char *const factory103[] = {"cHiAtk", "2", "cHiMk", "2", "cHiRatio", "3", "cHiRel", "60", "cHiThr", "-22", "cLoAtk", "3", "cLoMk", "2", "cLoRatio", "4", "cLoRel", "90", "cLoThr", "-18", "cMidAtk", "4", "cMidMk", "2", "cMidRatio", "3", "cMidRel", "90", "cMidThr", "-18", "eqHiFreq", "9000", "eqHiGain", "2", "eqLoFreq", "80", "eqLoGain", "2", "eqMidFreq", "2500", "eqMidGain", "1.5", "limCeil", "-0.3", "limRel", "50", "outGain", "2", "strength", "1.0", "xHi", "2500", "xLo", "150", nullptr};
inline const char *const factory104[] = {"cHiRatio", "1.5", "cLoMk", "1", "cLoRatio", "2.5", "cLoThr", "-22", "cMidRatio", "2", "eqHiFreq", "6000", "eqHiGain", "-4", "eqLoFreq", "100", "eqLoGain", "2", "eqMidFreq", "500", "eqMidGain", "1", "limCeil", "-1", "outGain", "1", "strength", "0.8", "xHi", "2200", "xLo", "200", nullptr};
inline const char *const factory105[] = {"cHiAtk", "2", "cHiMk", "2", "cHiRatio", "3", "cHiRel", "70", "cHiThr", "-22", "cLoRatio", "1.5", "cMidAtk", "3", "cMidMk", "2", "cMidRatio", "4", "cMidRel", "100", "cMidThr", "-18", "eqHiFreq", "8000", "eqHiGain", "3", "eqLoFreq", "200", "eqLoGain", "-2", "eqMidFreq", "2000", "eqMidGain", "3", "eqMidQ", "1.5", "limCeil", "-0.3", "outGain", "2", "strength", "1.0", "xHi", "1800", "xLo", "250", nullptr};
inline const char *const factory106[] = {"cHiAtk", "2", "cHiMk", "2", "cHiRatio", "3", "cLoRatio", "1.5", "cMidAtk", "3", "cMidMk", "1", "cMidRatio", "3", "eqHiFreq", "9000", "eqHiGain", "4", "eqMidFreq", "1500", "eqMidGain", "2", "outGain", "2", "strength", "1.0", "xHi", "3000", nullptr};
inline const char *const factory107[] = {"cHiAtk", "5", "cHiMk", "1", "cHiRatio", "2.5", "cHiRel", "120", "cHiThr", "-26", "eqHiFreq", "12000", "eqHiGain", "4", "eqMidFreq", "3000", "eqMidGain", "-1", "limCeil", "-0.5", "outGain", "1.5", "strength", "0.75", "xHi", "5000", nullptr};
inline const char *const factory108[] = {"cHiMk", "1", "cHiRatio", "2.5", "cLoMk", "1", "cLoRatio", "2", "cMidAtk", "4", "cMidMk", "1.5", "cMidRatio", "3", "eqHiFreq", "8000", "eqHiGain", "2", "eqMidFreq", "2500", "eqMidGain", "1.5", "outGain", "1.5", "strength", "1.0", "xHi", "2500", "xLo", "200", nullptr};
inline const char *const factory109[] = {"cHiRatio", "1.5", "cLoAtk", "10", "cLoMk", "3", "cLoRatio", "4", "cLoRel", "130", "cLoThr", "-18", "cMidAtk", "12", "cMidMk", "2", "cMidRatio", "3", "cMidRel", "130", "cMidThr", "-18", "eqHiFreq", "9000", "eqHiGain", "-2", "eqLoFreq", "80", "eqLoGain", "3", "eqMidFreq", "800", "eqMidGain", "2", "eqMidQ", "1.2", "limCeil", "-0.3", "outGain", "2.5", "strength", "1.0", "xHi", "1500", "xLo", "150", nullptr};
inline const char *const factory110[] = {"cHiRatio", "1.5", "cLoAtk", "8", "cLoMk", "3", "cLoRatio", "5", "cLoRel", "120", "cLoThr", "-16", "cMidMk", "2", "cMidRatio", "3", "cMidThr", "-18", "eqLoFreq", "70", "eqLoGain", "2", "eqMidFreq", "500", "eqMidGain", "2", "limCeil", "-0.3", "outGain", "2", "strength", "1.0", "xHi", "1200", "xLo", "140", nullptr};
inline const char *const factory111[] = {"cHiRatio", "2", "cLoMk", "2", "cLoRatio", "3", "cMidAtk", "6", "cMidMk", "2", "cMidRatio", "4", "cMidRel", "110", "cMidThr", "-18", "eqLoFreq", "90", "eqLoGain", "1", "eqMidFreq", "1200", "eqMidGain", "3", "eqMidQ", "1.5", "limCeil", "-0.4", "outGain", "2", "strength", "1.0", "xHi", "1800", "xLo", "160", nullptr};
inline const char *const factory112[] = {"cHiRatio", "1.2", "cLoAtk", "12", "cLoMk", "3", "cLoRatio", "6", "cLoRel", "150", "cLoThr", "-14", "cMidRatio", "2", "eqLoFreq", "55", "eqLoGain", "2", "eqMidFreq", "900", "eqMidGain", "-2", "limCeil", "-0.5", "outGain", "2", "strength", "0.9", "xHi", "2000", "xLo", "120", nullptr};
inline const char *const factory113[] = {"cHiRatio", "2", "cLoAtk", "6", "cLoMk", "2", "cLoRatio", "4", "cLoRel", "110", "cLoThr", "-18", "cMidMk", "1.5", "cMidRatio", "3", "cMidThr", "-18", "eqLoFreq", "90", "eqLoGain", "2", "eqMidFreq", "1000", "eqMidGain", "1.5", "limCeil", "-0.3", "outGain", "2", "strength", "1.0", "xHi", "2200", "xLo", "160", nullptr};
inline const char *const factory114[] = {"cHiRatio", "1.5", "cLoAtk", "10", "cLoMk", "3", "cLoRatio", "4", "cLoRel", "140", "cLoThr", "-18", "cMidMk", "1", "cMidRatio", "2.5", "eqHiFreq", "8000", "eqHiGain", "-2", "eqLoFreq", "75", "eqLoGain", "3", "eqMidFreq", "600", "eqMidGain", "-1", "limCeil", "-0.5", "outGain", "2", "strength", "0.9", "xHi", "1600", "xLo", "140", nullptr};
inline const char *const factory115[] = {"cHiRatio", "2", "cLoAtk", "10", "cLoMk", "2", "cLoRatio", "3", "cLoRel", "130", "cLoThr", "-20", "cMidMk", "1", "cMidRatio", "2.5", "eqHiFreq", "7000", "eqHiGain", "1", "eqLoFreq", "80", "eqLoGain", "2.5", "eqMidFreq", "900", "eqMidGain", "1", "limCeil", "-0.5", "outGain", "1.8", "strength", "1.0", "xHi", "2000", "xLo", "150", nullptr};
inline const char *const factory116[] = {"cHiMk", "1.5", "cHiRatio", "2", "cHiThr", "-22", "cLoRatio", "1.5", "cMidAtk", "12", "cMidMk", "1.5", "cMidRatio", "2.5", "cMidRel", "150", "cMidThr", "-20", "eqHiFreq", "9000", "eqHiGain", "4", "eqLoFreq", "200", "eqLoGain", "-1", "eqMidFreq", "2000", "eqMidGain", "1.5", "limCeil", "-0.5", "outGain", "2", "strength", "0.85", "xHi", "3000", "xLo", "300", nullptr};
inline const char *const factory117[] = {"cHiMk", "1", "cHiRatio", "2", "cLoRatio", "1.5", "cMidAtk", "8", "cMidMk", "2", "cMidRatio", "3", "cMidRel", "130", "cMidThr", "-18", "eqHiFreq", "8000", "eqHiGain", "2", "eqLoFreq", "200", "eqLoGain", "-2", "eqMidFreq", "3000", "eqMidGain", "3", "eqMidQ", "1.2", "limCeil", "-0.4", "outGain", "2", "strength", "1.0", "xHi", "3500", "xLo", "300", nullptr};
inline const char *const factory118[] = {"cHiRatio", "2", "cLoMk", "1", "cLoRatio", "2", "cMidAtk", "20", "cMidMk", "1", "cMidRatio", "2", "cMidRel", "200", "cMidThr", "-24", "eqHiFreq", "8000", "eqHiGain", "-2", "eqLoFreq", "150", "eqLoGain", "1", "eqMidFreq", "1000", "eqMidGain", "0.5", "limCeil", "-1", "outGain", "1", "strength", "0.7", "xHi", "2500", "xLo", "250", nullptr};
inline const char *const factory119[] = {"cMidAtk", "30", "cMidMk", "0.5", "cMidRatio", "1.8", "cMidRel", "250", "cMidThr", "-26", "eqHiFreq", "10000", "eqHiGain", "1", "eqLoFreq", "120", "eqLoGain", "1", "limCeil", "-1.5", "outGain", "0.5", "strength", "0.6", "xHi", "3000", "xLo", "300", nullptr};
inline const char *const factory120[] = {"cHiAtk", "2", "cHiMk", "1.5", "cHiRatio", "2.5", "cHiRel", "70", "cHiThr", "-22", "cLoRatio", "1.5", "cMidAtk", "3", "cMidMk", "1.5", "cMidRatio", "3", "cMidRel", "100", "cMidThr", "-18", "eqHiFreq", "9000", "eqHiGain", "3", "eqMidFreq", "2500", "eqMidGain", "2", "outGain", "1.5", "strength", "1.0", "xHi", "3000", "xLo", "300", nullptr};
inline const char *const factory121[] = {"cHiAtk", "4", "cHiMk", "1.5", "cHiRatio", "2.5", "cHiThr", "-24", "cMidMk", "1", "cMidRatio", "2", "eqHiFreq", "11000", "eqHiGain", "4", "eqMidFreq", "3000", "eqMidGain", "1", "limCeil", "-0.5", "outGain", "1.5", "strength", "0.8", "xHi", "4000", nullptr};
inline const char *const factory122[] = {"cHiMk", "1", "cHiRatio", "2", "cLoRatio", "1.2", "cMidMk", "2", "cMidRatio", "3", "cMidThr", "-18", "eqHiFreq", "8000", "eqHiGain", "2", "eqLoFreq", "150", "eqLoGain", "-3", "eqMidFreq", "2500", "eqMidGain", "2.5", "eqMidQ", "1.2", "limCeil", "-0.4", "outGain", "2", "strength", "1.0", "xHi", "3000", "xLo", "350", nullptr};
inline const char *const factory123[] = {"cHiAtk", "4", "cHiMk", "1", "cHiRatio", "2", "cMidAtk", "6", "cMidMk", "1", "cMidRatio", "2", "eqHiFreq", "10000", "eqHiGain", "3", "eqMidFreq", "1800", "eqMidGain", "1.5", "limCeil", "-0.5", "outGain", "1", "strength", "0.75", "xHi", "4000", nullptr};
inline const char *const factory124[] = {"cHiMk", "1", "cHiRatio", "2", "cLoRatio", "1.8", "cMidAtk", "10", "cMidMk", "1", "cMidRatio", "2.5", "cMidRel", "150", "cMidThr", "-22", "eqHiFreq", "9000", "eqHiGain", "2", "eqLoFreq", "200", "eqLoGain", "-1", "eqMidFreq", "2500", "eqMidGain", "1.5", "limCeil", "-0.5", "outGain", "1.5", "strength", "0.8", "xHi", "3000", "xLo", "250", nullptr};
inline const char *const factory125[] = {"cHiAtk", "15", "cHiMk", "1", "cHiRatio", "2", "cHiRel", "180", "cHiThr", "-22", "cLoAtk", "20", "cLoMk", "1", "cLoRatio", "2", "cLoRel", "200", "cLoThr", "-22", "cMidAtk", "25", "cMidMk", "1", "cMidRatio", "2", "cMidRel", "200", "cMidThr", "-22", "eqHiFreq", "10000", "eqHiGain", "1", "eqLoFreq", "100", "eqLoGain", "0.5", "limCeil", "-0.8", "outGain", "1", "strength", "0.7", "xHi", "2500", "xLo", "200", nullptr};
inline const char *const factory126[] = {"cHiMk", "2", "cHiRatio", "3", "cHiThr", "-20", "cLoMk", "2", "cLoRatio", "3", "cLoThr", "-20", "cMidMk", "2", "cMidRatio", "3", "cMidThr", "-18", "eqHiFreq", "9000", "eqHiGain", "2", "eqLoFreq", "90", "eqLoGain", "1", "limCeil", "-0.1", "limRel", "40", "outGain", "4", "strength", "1.0", "xHi", "2800", "xLo", "180", nullptr};
inline const FactoryPreset factoryPresets[] = {
{"AMBIENCE", "Abbey Road", factory0},
{"AMBIENCE", "Abbey Road 2", factory1},
{"AMBIENCE", "Capitol Studio A", factory2},
{"AMBIENCE", "Skywalker Sound", factory3},
{"AMBIENCE", "Carnegie Hall", factory4},
{"AMBIENCE", "Tokyo Opera City", factory5},
{"AMBIENCE", "Berlin Konzerthaus", factory6},
{"AMBIENCE", "Vienna Musikverein", factory7},
{"AMBIENCE", "Boston Symphony", factory8},
{"AMBIENCE", "Concertgebouw", factory9},
{"AMBIENCE", "EMT140 Vocal", factory10},
{"AMBIENCE", "EMT140 Snare", factory11},
{"AMBIENCE", "Dark Plate", factory12},
{"AMBIENCE", "Surf Guitar", factory13},
{"AMBIENCE", "Vintage Studio", factory14},
{"AMBIENCE", "Deep Tank", factory15},
{"AMBIENCE", "Gothic Cathedral", factory16},
{"AMBIENCE", "Stone Chamber", factory17},
{"AMBIENCE", "Infinite Space", factory18},
{"AMBIENCE", "Drums in a Box", factory19},
{"AMBIENCE", "Tracking Room", factory20},
{"NES_SYNTH", "NES Lead", factory21},
{"NES_SYNTH", "Square Bass", factory22},
{"NES_SYNTH", "Pulse Pluck", factory23},
{"NES_SYNTH", "Triangle Sub", factory24},
{"NES_SYNTH", "Detune Lead", factory25},
{"NES_SYNTH", "Noise Perc", factory26},
{"NES_SYNTH", "Vibrato Lead", factory27},
{"NES_SYNTH", "Wah Sweep", factory28},
{"NES_SYNTH", "Pluck Bass", factory29},
{"NES_SYNTH", "Acid Pluck", factory30},
{"NES_SYNTH", "Razor Lead", factory31},
{"NES_SYNTH", "Cold Lead", factory32},
{"NES_SYNTH", "Grit Sub", factory33},
{"NES_SYNTH", "Detune Wall", factory34},
{"MORPH_PAD", "Mist", factory35},
{"MORPH_PAD", "Cathedral", factory36},
{"MORPH_PAD", "Glacier", factory37},
{"MORPH_PAD", "Abyss", factory38},
{"MORPH_PAD", "Aurora", factory39},
{"MORPH_PAD", "Ember", factory40},
{"MORPH_PAD", "Tide", factory41},
{"MORPH_PAD", "Dust", factory42},
{"MORPH_PAD", "Wind", factory43},
{"MORPH_PAD", "Organ", factory44},
{"MORPH_PAD", "Hollow", factory45},
{"MORPH_PAD", "Vowel", factory46},
{"MORPH_PAD", "Shimmer", factory47},
{"MORPH_PAD", "Chanter", factory48},
{"MORPH_PAD", "Ensemble", factory49},
{"MORPH_PAD", "Bells", factory50},
{"MORPH_PAD", "Nocturne", factory51},
{"MORPH_PAD", "Haze", factory52},
{"MORPH_PAD", "Pulse", factory53},
{"MORPH_PAD", "Rime", factory54},
{"MORPH_PAD", "Deep", factory55},
{"MORPH_PAD", "Spectral", factory56},
{"MORPH_PAD", "Rust", factory57},
{"MORPH_PAD", "Still", factory58},
{"MORPH_PAD", "Velvet", factory59},
{"MORPH_PAD", "Chrome", factory60},
{"MORPH_PAD", "Swarm", factory61},
{"MORPH_PAD", "Foghorn", factory62},
{"MORPH_PAD", "Solar", factory63},
{"MORPH_PAD", "Cave", factory64},
{"MORPH_PAD", "Glass Harp", factory65},
{"MORPH_PAD", "Monk", factory66},
{"MORPH_PAD", "Static", factory67},
{"MORPH_PAD", "Lullaby", factory68},
{"MORPH_PAD", "Storm", factory69},
{"MORPH_PAD", "Prism", factory70},
{"GRAIN_CLOUD", "Felt Clouds", factory71},
{"GRAIN_CLOUD", "Glass Choir", factory72},
{"GRAIN_CLOUD", "Dust Lights", factory73},
{"GRAIN_CLOUD", "Warm Tide", factory74},
{"GRAIN_CLOUD", "Slow Tapes", factory75},
{"GRAIN_CLOUD", "Deep Water", factory76},
{"GRAIN_CLOUD", "Rain Cathedral", factory77},
{"GRAIN_CLOUD", "Kalimba Steps", factory78},
{"GRAIN_CLOUD", "Hymn", factory79},
{"GRAIN_CLOUD", "Breath Choir", factory80},
{"GRAIN_CLOUD", "Night Current", factory81},
{"GRAIN_CLOUD", "Glass Rain", factory82},
{"GRAIN_CLOUD", "Broken Stars", factory83},
{"GRAIN_CLOUD", "Far Broadcast", factory84},
{"WAVETABLE", "Morph Lead", factory85},
{"WAVETABLE", "Vowel Pad", factory86},
{"WAVETABLE", "PWM Strings", factory87},
{"WAVETABLE", "Sync Sweep", factory88},
{"WAVETABLE", "FM Bells", factory89},
{"WAVETABLE", "Glass Keys", factory90},
{"WAVETABLE", "Organ Drift", factory91},
{"WAVETABLE", "Fold Bass", factory92},
{"WAVETABLE", "Digital Grit", factory93},
{"WAVETABLE", "Comb Choir", factory94},
{"WAVETABLE", "Odd Even Pluck", factory95},
{"WAVETABLE", "Harmonic Rise", factory96},
{"MIX_TIGHTENER", "808 Crisp", factory97},
{"MIX_TIGHTENER", "Boom-Bap Kit", factory98},
{"MIX_TIGHTENER", "Trap Hats", factory99},
{"MIX_TIGHTENER", "Industrial Drums", factory100},
{"MIX_TIGHTENER", "Techno Kick", factory101},
{"MIX_TIGHTENER", "House Groove", factory102},
{"MIX_TIGHTENER", "DnB Breaks", factory103},
{"MIX_TIGHTENER", "Lo-Fi Kit", factory104},
{"MIX_TIGHTENER", "Snare Crack", factory105},
{"MIX_TIGHTENER", "Clap Snap", factory106},
{"MIX_TIGHTENER", "Cymbal Sheen", factory107},
{"MIX_TIGHTENER", "Percussion Tight", factory108},
{"MIX_TIGHTENER", "EBM Bass", factory109},
{"MIX_TIGHTENER", "Reese Bass", factory110},
{"MIX_TIGHTENER", "Acid 303", factory111},
{"MIX_TIGHTENER", "Sub Bass Tame", factory112},
{"MIX_TIGHTENER", "FM Bass Punch", factory113},
{"MIX_TIGHTENER", "Goth Bass", factory114},
{"MIX_TIGHTENER", "Synthwave Bass", factory115},
{"MIX_TIGHTENER", "Synthwave Lead", factory116},
{"MIX_TIGHTENER", "Cutting Lead", factory117},
{"MIX_TIGHTENER", "Darkwave Pad", factory118},
{"MIX_TIGHTENER", "Ambient Wash", factory119},
{"MIX_TIGHTENER", "Pluck Tight", factory120},
{"MIX_TIGHTENER", "Arp Sparkle", factory121},
{"MIX_TIGHTENER", "Chip Lead", factory122},
{"MIX_TIGHTENER", "Bell Clarity", factory123},
{"MIX_TIGHTENER", "Keys Clarity", factory124},
{"MIX_TIGHTENER", "Mix Glue", factory125},
{"MIX_TIGHTENER", "Loudness Max", factory126},
};
inline constexpr int factoryPresetCount = 127;
} // namespace sizzle::gen
+50
View File
@@ -0,0 +1,50 @@
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include <memory>
#include "sizzle/Params.hpp"
namespace sizzle {
namespace sampler { class SampleStore; }
/**
* One playable instrument: a pool of voices for a ToolboxType, the way AudioEngine
* plays one mixer channel's instrument (8 voices, a free voice first, else the
* round-robin one; synth voices are cut when stolen, sample voices declick).
* Used by the AUv3 instruments and the in-app host until the full engine is ported.
*
* Threads: construct and call update()/noteOn()/noteOff()/render() from the audio
* thread only (the AU wrapper hands parameter changes over itself). No allocation
* after construction.
*/
class Instrument {
public:
virtual ~Instrument() = default;
/** New settings (and tempo): rebuild the patch, and let held notes follow it
* where the Kotlin engine does (synth voices take the new patch). */
virtual void update(const Params &p, float tempoBpm) = 0;
virtual void noteOn(int midi, int velocity) = 0;
/** Release the held note(s) at [midi]. */
virtual void noteOff(int midi) = 0;
/** Release everything (MIDI all-notes-off, transport stop). */
virtual void allNotesOff() = 0;
/** Hard stop, no release tails. */
virtual void kill() = 0;
/** Before each render block of [frames]: advances the Morph Pad's shared clock
* and lets the sample store reclaim memory. */
virtual void blockStart(int frames) = 0;
/** One mono output sample. */
virtual float render() = 0;
static constexpr int POLYPHONY = 8;
/** The instrument for ToolboxType [type] (NES_SYNTH, MORPH_PAD, WAVETABLE,
* GRAIN_CLOUD, SAMPLER, SOUNDFONT), or nullptr. [store] supplies samples for
* the Sampler, SF2/XI loader and Grain Cloud custom sources (may be null:
* those then stay silent); it must outlive the instrument. */
static std::unique_ptr<Instrument> create(const char *type, int sampleRate, sampler::SampleStore *store);
};
} // namespace sizzle
+8
View File
@@ -29,6 +29,14 @@ struct DeviceSpec {
int paramCount;
};
/** A factory preset: the device it belongs to, its name, and the slot's full
* settings as nullptr-terminated key/value text pairs. */
struct FactoryPreset {
const char *type;
const char *name;
const char *const *values;
};
/** The device with ToolboxType name [type], or nullptr. */
const DeviceSpec *findDevice(const char *type);
+142
View File
@@ -0,0 +1,142 @@
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
// SPDX-License-Identifier: GPL-3.0-or-later
#include "sizzle/Instrument.hpp"
#include <cstring>
#include <string>
#include "echofield/GrainCloud.hpp"
#include "frasil/FrasilVoice.hpp"
#include "sampler/SampleStore.hpp"
#include "sampler/SampleVoice.hpp"
#include "synth/SynthPatch.hpp"
#include "synth/SynthVoice.hpp"
#include "echofield/GrainSources.hpp"
#include "wavetable/WaveTables.hpp"
#include "wavetable/WaveVoice.hpp"
namespace sizzle {
namespace {
constexpr int N = Instrument::POLYPHONY;
/** Synth, Morph Pad, Wavetable: SynthVoice pool with the engine's patch. */
class SynthInstrument final : public Instrument {
public:
enum Kind { SYNTH, PAD, WAVE };
private:
Kind kind;
int sr;
frasil::FrasilClock clock;
frasil::FrasilSeeds seeds;
std::unique_ptr<synth::SynthVoice> voices[N];
synth::SynthPatch patch = synth::SynthPatch::defaults();
int alloc = 0;
public:
SynthInstrument(Kind k, int sampleRate) : kind(k), sr(sampleRate) {
for (auto &v : voices) v = std::make_unique<synth::SynthVoice>(sr, clock, seeds.next());
}
void update(const Params &p, float tempo) override {
switch (kind) {
case PAD: patch = synth::SynthPatch::forPad(frasil::FrasilPatch::from(&p)); break;
case WAVE: patch = synth::SynthPatch::forWave(wavetable::WavePatch::from(&p, tempo)); break;
default: patch = synth::SynthPatch::from(&p, tempo); break;
}
for (auto &v : voices) if (v->isActive()) v->setPatch(patch);
}
void noteOn(int midi, int vel) override {
for (auto &v : voices) if (!v->isActive()) { v->noteOn(midi, vel, patch); return; }
auto &v = voices[alloc];
alloc = (alloc + 1) % N;
v->kill();
v->noteOn(midi, vel, patch);
}
void noteOff(int midi) override {
for (auto &v : voices) if (v->isGated() && v->pitch() == midi) v->noteOff();
}
void allNotesOff() override { for (auto &v : voices) v->noteOff(); }
void kill() override { for (auto &v : voices) v->kill(); }
void blockStart(int frames) override { clock.advance(frames, sr); }
float render() override {
float s = 0.f;
for (auto &v : voices) if (v->isActive()) s += v->render();
return s;
}
};
/** Sampler pads and the SF2/XI loader: SampleVoice pool. */
class SampleInstrument final : public Instrument {
std::string type;
sampler::SampleStore *store;
std::unique_ptr<sampler::SampleVoice> voices[N];
Params params;
int alloc = 0;
public:
SampleInstrument(const char *t, int sr, sampler::SampleStore *s) : type(t), store(s) {
for (auto &v : voices) v = std::make_unique<sampler::SampleVoice>(sr);
}
void update(const Params &p, float) override { params = p; }
void noteOn(int midi, int vel) override {
if (!store) return;
sampler::VoiceSample vs;
if (!sampler::voiceSample(type.c_str(), params, *store, midi, vs)) return;
for (auto &v : voices) if (!v->isActive()) { v->noteOn(vs, midi, vel); return; }
auto &v = voices[alloc];
alloc = (alloc + 1) % N;
v->noteOn(vs, midi, vel); // declicks the hand-off itself
}
void noteOff(int midi) override {
for (auto &v : voices) if (v->isGated() && v->pitch == midi) v->noteOff();
}
void allNotesOff() override { for (auto &v : voices) v->noteOff(); }
void kill() override { for (auto &v : voices) v->kill(); }
void blockStart(int) override { if (store) store->quiescent(); }
float render() override {
float s = 0.f;
for (auto &v : voices) if (v->isActive()) s += v->render();
return s;
}
};
/** Grain Cloud: one polyphonic cloud. */
class GrainInstrument final : public Instrument {
echofield::GrainCloud cloud;
sampler::SampleStore *store;
static const Sample *lookup(void *ctx, const char *id) {
auto *s = static_cast<sampler::SampleStore *>(ctx);
return s ? s->get(id) : nullptr;
}
public:
GrainInstrument(int sr, sampler::SampleStore *s) : cloud(sr, echofield::GrainSeeds{}.next()), store(s) {
cloud.setSampleLookup(&GrainInstrument::lookup, store);
}
void update(const Params &p, float tempo) override { cloud.setPatch(echofield::GrainPatch::from(&p, tempo)); }
void noteOn(int midi, int vel) override { cloud.noteOn(midi, vel, echofield::GrainCloud::OWNER_LIVE); }
void noteOff(int midi) override { cloud.noteOff(midi); }
void allNotesOff() override { cloud.releaseAll(); }
void kill() override { cloud.kill(); }
void blockStart(int) override { if (store) store->quiescent(); }
float render() override { return cloud.render(); }
};
} // namespace
std::unique_ptr<Instrument> Instrument::create(const char *type, int sr, sampler::SampleStore *store) {
auto is = [&](const char *t) { return std::strcmp(type, t) == 0; };
if (is("NES_SYNTH")) return std::make_unique<SynthInstrument>(SynthInstrument::SYNTH, sr);
if (is("MORPH_PAD")) return std::make_unique<SynthInstrument>(SynthInstrument::PAD, sr);
// Wavetables and grain sources are generated once, off the audio thread; until
// they're ready those oscillators / clouds are silent (as on Android, where the
// app starts this at launch). prewarm() returns at once.
if (is("WAVETABLE")) { wavetable::WaveTables::prewarm(); return std::make_unique<SynthInstrument>(SynthInstrument::WAVE, sr); }
if (is("GRAIN_CLOUD")) { echofield::GrainSources::prewarm(); return std::make_unique<GrainInstrument>(sr, store); }
if (is("SAMPLER") || is("SOUNDFONT")) return std::make_unique<SampleInstrument>(type, sr, store);
return nullptr;
}
} // namespace sizzle
+2 -2
View File
@@ -64,12 +64,12 @@ def main(src, plist_out, header_out):
"""
open(plist_out, "w").write(plist)
entries = ",\n".join(f' {{\'{sub}\', "{toolbox}", "{name}"}}' for _, sub, toolbox, name in rows)
entries = ",\n".join(f' {{\'{sub}\', \'{t}\', "{toolbox}", "{name}"}}' for t, sub, toolbox, name in rows)
header = f"""// GENERATED from components.txt by tools/gen_components.py. Do not edit.
#pragma once
#include <AudioToolbox/AudioToolbox.h>
typedef struct {{ OSType subtype; const char *toolboxType; const char *name; }} SizzleComponent;
typedef struct {{ OSType subtype; OSType type; const char *toolboxType; const char *name; }} SizzleComponent;
static const SizzleComponent kSizzleComponents[] = {{
{entries}