From e6733ec036102d67f87f34c553597ce49e3a9518 Mon Sep 17 00:00:00 2001 From: "Robin E. R. Davies" Date: Fri, 5 Sep 2025 06:31:51 -0400 Subject: [PATCH] Patch Properties in Plugin Settings --- default_presets/presets/Default+Bank.bank | 3328 ++++++++++++--------- src/AtomConverter.cpp | 5 + src/AtomConverter.hpp | 1 + src/PiPedalModel.cpp | 45 +- src/PluginHost.cpp | 226 +- src/PluginHost.hpp | 1 + src/PluginPreset.cpp | 1 + src/PluginPreset.hpp | 1 + src/Storage.cpp | 40 +- src/Storage.hpp | 11 +- 10 files changed, 2145 insertions(+), 1514 deletions(-) diff --git a/default_presets/presets/Default+Bank.bank b/default_presets/presets/Default+Bank.bank index 322eb90..d4e6a1a 100644 --- a/default_presets/presets/Default+Bank.bank +++ b/default_presets/presets/Default+Bank.bank @@ -1,1487 +1,1849 @@ { - "name": "", - "nextInstanceId": 21, - "selectedPreset": 15, - "presets": [ - { - "instanceId": 13, - "preset": { - "name": "Jazz", - "input_volume_db": 0, - "output_volume_db": 0, - "items": [ - { - "instanceId": 16, - "uri": "http://two-play.com/plugins/toob-tuner", - "isEnabled": true, - "controlValues": [ - { - "key": "REFFREQ", - "value": 440 - }, - { - "key": "THRESHOLD", - "value": -49.1093903 - }, - { - "key": "MUTE", - "value": 0 - } - ], - "pluginName": "TooB Tuner", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { + "name": "", + "nextInstanceId": 21, + "selectedPreset": 19, + "presets": [ + { + "instanceId": 19, + "preset": { + "name": "Heavy", + "input_volume_db": 0, + "output_volume_db": 0, + "items": [ + { + "instanceId": 16, + "uri": "http://two-play.com/plugins/toob-tuner", + "isEnabled": true, + "controlValues": [ + { + "key": "REFFREQ", + "value": 440 + }, + { + "key": "THRESHOLD", + "value": -23.1093884 + }, + { + "key": "MUTE", + "value": 0 + } + ], + "pluginName": "TooB Tuner", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + false, + {} + ], + "lilvPresetUri": "", + "pathProperties": {}, + "title": "", + "useModUi": false + }, + { + "instanceId": 49, + "uri": "http://two-play.com/plugins/toob-noise-gate", + "isEnabled": true, + "controlValues": [ + { + "key": "threshold", + "value": -60 + }, + { + "key": "hysteresis", + "value": -6 + }, + { + "key": "trigger_led", + "value": 0 + }, + { + "key": "reduction", + "value": -60 + }, + { + "key": "attack", + "value": 1 + }, + { + "key": "hold", + "value": 100 + }, + { + "key": "release", + "value": 330 + }, + { + "key": "gate_level", + "value": -60 + } + ], + "pluginName": "TooB Noise Gate", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + false, + {} + ], + "lilvPresetUri": "", + "pathProperties": {}, + "title": "", + "useModUi": false + }, + { + "instanceId": 42, + "uri": "http://two-play.com/plugins/toob-chorus", + "isEnabled": false, + "controlValues": [ + { + "key": "rate", + "value": 0.291666657 + }, + { + "key": "depth", + "value": 0.375 + }, + { + "key": "dryWet", + "value": 1 + } + ], + "pluginName": "TooB CE-2 Chorus", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + false, + {} + ], + "lilvPresetUri": "", + "pathProperties": {}, + "title": "", + "useModUi": false + }, + { + "instanceId": 41, + "uri": "http://two-play.com/plugins/toob-delay", + "isEnabled": false, + "controlValues": [ + { + "key": "delay", + "value": 340 + }, + { + "key": "level", + "value": 27 + }, + { + "key": "feedback", + "value": 39.1666679 + } + ], + "pluginName": "TooB Delay", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + false, + {} + ], + "lilvPresetUri": "", + "pathProperties": {}, + "title": "", + "useModUi": false + }, + { + "instanceId": 39, + "uri": "http://two-play.com/plugins/toob-ml", + "isEnabled": true, + "controlValues": [ + { + "key": "trim", + "value": 1 + }, + { + "key": "bass", + "value": 0.5 + }, + { + "key": "mid", + "value": 0.5 + }, + { + "key": "treble", + "value": 0.5 + }, + { + "key": "model", + "value": 18 + }, + { + "key": "gain", + "value": 2.41666675 + }, + { + "key": "master", + "value": -4.5 + }, + { + "key": "sag", + "value": 0 + }, + { + "key": "sagd", + "value": 0 + }, + { + "key": "sagf", + "value": 13 + } + ], + "pluginName": "TooB ML Amplifier", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 2, + "lv2State": [ + true, + { + "http://two-play.com/plugins/toob-ml#modelFile": { + "flags": 3, + "atomType": "http://lv2plug.in/ns/ext/atom#Path", + "value": "ToobMlModels/HT40_Overdrive.json" + }, + "http://two-play.com/plugins/toob-ml#version": { + "flags": 3, + "atomType": "http://lv2plug.in/ns/ext/atom#Float", + "value": 1 + } + } + ], + "lilvPresetUri": "", + "pathProperties": { + "http://two-play.com/plugins/toob-ml#modelFile": "{\"otype_\": \"Path\",\"value\": \"/var/pipedal/audio_uploads/ToobMlModels/HT40_Overdrive.json\"}" + }, + "title": "", + "useModUi": false + }, + { + "instanceId": 31, + "uri": "http://two-play.com/plugins/toob-freeverb", + "isEnabled": true, + "controlValues": [ + { + "key": "dryWet", + "value": 0.25 + }, + { + "key": "roomSize", + "value": 0.733333349 + }, + { + "key": "damping", + "value": 0.574999988 + }, + { + "key": "bypass", + "value": 1 + }, + { + "key": "tails", + "value": 1 + } + ], + "pluginName": "TooB Freeverb", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + false, + {} + ], + "lilvPresetUri": "", + "pathProperties": {}, + "title": "", + "useModUi": false + }, + { + "instanceId": 51, + "uri": "http://two-play.com/plugins/toob-parametric-eq", + "isEnabled": true, + "controlValues": [ + { + "key": "loCut", + "value": 50.7010994 + }, + { + "key": "hiCut", + "value": 21 + }, + { + "key": "lfLevel", + "value": 0 + }, + { + "key": "lfC", + "value": 120 + }, + { + "key": "lmfLevel", + "value": 0 + }, + { + "key": "lmfC", + "value": 400 + }, + { + "key": "lmfQ", + "value": 1.5 + }, + { + "key": "hmfLevel", + "value": 0 + }, + { + "key": "hmfC", + "value": 2 + }, + { + "key": "hmfQ", + "value": 1.5 + }, + { + "key": "hfLevel", + "value": -3.25 + }, + { + "key": "hfC", + "value": 3.875 + }, + { + "key": "gain", + "value": 0 + } + ], + "pluginName": "TooB Parametric EQ", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + false, + {} + ], + "lilvPresetUri": "", + "pathProperties": {}, + "title": "", + "useModUi": false + } + ], + "nextInstanceId": 51, + "snapshots": [], + "selectedSnapshot": -1, + "selectedPlugin": 16 + } + }, + { "instanceId": 17, - "uri": "http://two-play.com/plugins/toob-input_stage", - "isEnabled": true, - "controlValues": [ - { - "key": "trim", - "value": 0 - }, - { - "key": "locut", - "value": 120 - }, - { - "key": "bright", - "value": 0 - }, - { - "key": "brightf", - "value": 1300 - }, - { - "key": "hicut", - "value": 6000 - }, - { - "key": "gate_t", - "value": -80 - }, - { - "key": "boost", - "value": 0 - } - ], - "pluginName": "TooB Input Stage", - "midiBindings": [ - { - "channel": -1, - "symbol": "__bypass", - "bindingType": 2, - "note": 72, - "control": 4, - "minValue": 0, - "maxValue": 1, - "rotaryScale": 1, - "linearControlType": 0, - "switchControlType": 0 - } - ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 18, - "uri": "http://two-play.com/plugins/toob-tone-stack", - "isEnabled": true, - "controlValues": [ - { - "key": "bass", - "value": 0.11666666 - }, - { - "key": "mid", - "value": 0.5 - }, - { - "key": "treble", - "value": 0.283333331 - }, - { - "key": "ampmodel", - "value": 1 - } - ], - "pluginName": "TooB Tone Stack", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 30, - "uri": "http://two-play.com/plugins/toob-power-stage-2", - "isEnabled": true, - "controlValues": [ - { - "key": "trim1", - "value": 0 - }, - { - "key": "locut1", - "value": 30 - }, - { - "key": "hicut1", - "value": 19000 - }, - { - "key": "shape1", - "value": 0 - }, - { - "key": "gain1", - "value": 0.458333343 - }, - { - "key": "bias1", - "value": 0 - }, - { - "key": "trim2", - "value": 0 - }, - { - "key": "locut2", - "value": 30 - }, - { - "key": "hicut2", - "value": 19000 - }, - { - "key": "shape2", - "value": 0 - }, - { - "key": "gain2", - "value": 0.383333325 - }, - { - "key": "bias2", - "value": 0 - }, - { - "key": "gain2_enable", - "value": 1 - }, - { - "key": "trim3", - "value": 0 - }, - { - "key": "locut3", - "value": 30 - }, - { - "key": "hicut3", - "value": 19000 - }, - { - "key": "shape3", - "value": 0 - }, - { - "key": "gain3", - "value": 0 - }, - { - "key": "bias3", - "value": 0 - }, - { - "key": "gain3_enable", - "value": 1 - }, - { - "key": "sag", - "value": 0.316666663 - }, - { - "key": "sagd", - "value": 0.325000018 - }, - { - "key": "master", - "value": -12.75 - }, - { - "key": "sagf", - "value": 13 - } - ], - "pluginName": "TooB Power Stage", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { + "preset": { + "name": "Sparkling Clean", + "input_volume_db": 0, + "output_volume_db": 0, + "items": [ + { + "instanceId": 16, + "uri": "http://two-play.com/plugins/toob-tuner", + "isEnabled": true, + "controlValues": [ + { + "key": "REFFREQ", + "value": 440 + }, + { + "key": "THRESHOLD", + "value": -23.1093884 + }, + { + "key": "MUTE", + "value": 0 + } + ], + "pluginName": "TooB Tuner", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + false, + {} + ], + "lilvPresetUri": "", + "pathProperties": {}, + "title": "", + "useModUi": false + }, + { + "instanceId": 55, + "uri": "http://two-play.com/plugins/toob-noise-gate", + "isEnabled": true, + "controlValues": [ + { + "key": "threshold", + "value": -65 + }, + { + "key": "hysteresis", + "value": -6 + }, + { + "key": "trigger_led", + "value": 0 + }, + { + "key": "reduction", + "value": -60 + }, + { + "key": "attack", + "value": 1 + }, + { + "key": "hold", + "value": 100 + }, + { + "key": "release", + "value": 330 + }, + { + "key": "gate_level", + "value": -60 + } + ], + "pluginName": "TooB Noise Gate", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + false, + {} + ], + "lilvPresetUri": "", + "pathProperties": {}, + "title": "", + "useModUi": false + }, + { + "instanceId": 53, + "uri": "http://two-play.com/plugins/toob-phaser", + "isEnabled": true, + "controlValues": [ + { + "key": "rate", + "value": 0.424131542 + }, + { + "key": "dryWet", + "value": 0.400000006 + } + ], + "pluginName": "TooB Phaser", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + false, + {} + ], + "lilvPresetUri": "", + "pathProperties": {}, + "title": "", + "useModUi": false + }, + { + "instanceId": 41, + "uri": "http://two-play.com/plugins/toob-delay", + "isEnabled": false, + "controlValues": [ + { + "key": "delay", + "value": 340 + }, + { + "key": "level", + "value": 36.6666679 + }, + { + "key": "feedback", + "value": 33.1666679 + } + ], + "pluginName": "TooB Delay", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + false, + {} + ], + "lilvPresetUri": "", + "pathProperties": {}, + "title": "", + "useModUi": false + }, + { + "instanceId": 39, + "uri": "http://two-play.com/plugins/toob-ml", + "isEnabled": true, + "controlValues": [ + { + "key": "trim", + "value": -2.5 + }, + { + "key": "bass", + "value": 0.5 + }, + { + "key": "mid", + "value": 0.625 + }, + { + "key": "treble", + "value": 0.5 + }, + { + "key": "model", + "value": 19 + }, + { + "key": "gain", + "value": 0 + }, + { + "key": "master", + "value": 0.5 + }, + { + "key": "sag", + "value": 0 + }, + { + "key": "sagd", + "value": 0 + }, + { + "key": "sagf", + "value": 13 + } + ], + "pluginName": "TooB ML Amplifier", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + true, + { + "http://two-play.com/plugins/toob-ml#modelFile": { + "flags": 3, + "atomType": "http://lv2plug.in/ns/ext/atom#Path", + "value": "ToobMlModels/MesaBoogie_Studio22_Clean.json" + }, + "http://two-play.com/plugins/toob-ml#version": { + "flags": 3, + "atomType": "http://lv2plug.in/ns/ext/atom#Float", + "value": 1 + } + } + ], + "lilvPresetUri": "", + "pathProperties": { + "http://two-play.com/plugins/toob-ml#modelFile": "{\"otype_\": \"Path\",\"value\": \"/var/pipedal/audio_uploads/ToobMlModels/MesaBoogie_Studio22_Clean.json\"}" + }, + "title": "", + "useModUi": false + }, + { + "instanceId": 51, + "uri": "http://two-play.com/plugins/toob-convolution-reverb-stereo", + "isEnabled": true, + "controlValues": [ + { + "key": "bypass", + "value": 1 + }, + { + "key": "time", + "value": 30 + }, + { + "key": "direct_mix", + "value": -6 + }, + { + "key": "reverb_mix", + "value": -4 + }, + { + "key": "width", + "value": 1 + }, + { + "key": "pan", + "value": 0 + }, + { + "key": "predelay", + "value": -1 + }, + { + "key": "predelay_new", + "value": 1 + }, + { + "key": "stretch", + "value": 1 + }, + { + "key": "decay", + "value": 0 + }, + { + "key": "tails", + "value": 1 + }, + { + "key": "loading_state", + "value": 0 + } + ], + "pluginName": "TooB Convolution Reverb (Stereo)", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + true, + { + "http://two-play.com/plugins/toob-impulse#impulseFile": { + "flags": 3, + "atomType": "http://lv2plug.in/ns/ext/atom#Path", + "value": "ReverbImpulseFiles/Genesis 6 Studio Live Room.wav" + } + } + ], + "lilvPresetUri": "", + "pathProperties": { + "http://two-play.com/plugins/toob-impulse#impulseFile": "{\"otype_\": \"Path\",\"value\": \"/var/pipedal/audio_uploads/ReverbImpulseFiles/Genesis 6 Studio Live Room.wav\"}" + }, + "title": "", + "useModUi": false + } + ], + "nextInstanceId": 55, + "snapshots": [], + "selectedSnapshot": -1, + "selectedPlugin": 16 + } + }, + { "instanceId": 20, - "uri": "http://two-play.com/plugins/toob-cab-sim", - "isEnabled": true, - "controlValues": [ - { - "key": "locut", - "value": 120 - }, - { - "key": "bright", - "value": 0 - }, - { - "key": "brightf", - "value": 1300 - }, - { - "key": "hicut", - "value": 6000 - }, - { - "key": "comb", - "value": 0 - }, - { - "key": "combf", - "value": 2000 - }, - { - "key": "trim", - "value": 0 - } - ], - "pluginName": "TooB Cab Simulator", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 33, - "uri": "http://two-play.com/plugins/toob-delay", - "isEnabled": true, - "controlValues": [ - { - "key": "delay", - "value": 340 - }, - { - "key": "level", - "value": 12 - }, - { - "key": "feedback", - "value": 39 - } - ], - "pluginName": "TooB Delay", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 31, - "uri": "http://two-play.com/plugins/toob-freeverb", - "isEnabled": false, - "controlValues": [ - { - "key": "dryWet", - "value": 0.300000012 - }, - { - "key": "roomSize", - "value": 0.625 - }, - { - "key": "damping", - "value": 0.491666675 - } - ], - "pluginName": "TooB Freeverb", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - } - ], - "nextInstanceId": 33 - } - }, - { - "instanceId": 15, - "preset": { - "name": "Jazz ML", - "input_volume_db": 0, - "output_volume_db": 0, - "items": [ - { - "instanceId": 16, - "uri": "http://two-play.com/plugins/toob-tuner", - "isEnabled": true, - "controlValues": [ - { - "key": "REFFREQ", - "value": 440 - }, - { - "key": "THRESHOLD", - "value": -23.1093884 - }, - { - "key": "MUTE", - "value": 0 - } - ], - "pluginName": "TooB Tuner", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 17, - "uri": "http://two-play.com/plugins/toob-input_stage", - "isEnabled": true, - "controlValues": [ - { - "key": "trim", - "value": 0 - }, - { - "key": "locut", - "value": 120 - }, - { - "key": "bright", - "value": 0 - }, - { - "key": "brightf", - "value": 1300 - }, - { - "key": "hicut", - "value": 6000 - }, - { - "key": "gate_t", - "value": -80 - }, - { - "key": "boost", - "value": 0 - } - ], - "pluginName": "TooB Input Stage", - "midiBindings": [ - { - "channel": -1, - "symbol": "__bypass", - "bindingType": 2, - "note": 72, - "control": 4, - "minValue": 0, - "maxValue": 1, - "rotaryScale": 1, - "linearControlType": 0, - "switchControlType": 0 - } - ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 41, - "uri": "http://two-play.com/plugins/toob-chorus", - "isEnabled": false, - "controlValues": [ - { - "key": "rate", - "value": 0.5 - }, - { - "key": "depth", - "value": 0.5 - } - ], - "pluginName": "TooB CE-2 Chorus", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 39, - "uri": "http://two-play.com/plugins/toob-ml", - "isEnabled": true, - "controlValues": [ - { - "key": "trim", - "value": 0 - }, - { - "key": "bass", - "value": 0.5 - }, - { - "key": "mid", - "value": 0.5 - }, - { - "key": "treble", - "value": 0.5 - }, - { - "key": "model", - "value": 0 - }, - { - "key": "gain", - "value": 3 - }, - { - "key": "master", - "value": 0 - }, - { - "key": "sag", - "value": 0 - }, - { - "key": "sagd", - "value": 0 - }, - { - "key": "sagf", - "value": 13 - } - ], - "pluginName": "TooB ML Amplifier", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 31, - "uri": "http://two-play.com/plugins/toob-freeverb", - "isEnabled": true, - "controlValues": [ - { - "key": "dryWet", - "value": 0.150000006 - }, - { - "key": "roomSize", - "value": 0.625 - }, - { - "key": "damping", - "value": 0.574999988 - } - ], - "pluginName": "TooB Freeverb", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - } - ], - "nextInstanceId": 41 - } - }, - { - "instanceId": 17, - "preset": { - "name": "Sparkling Clean", - "input_volume_db": 0, - "output_volume_db": 0, - "items": [ - { - "instanceId": 16, - "uri": "http://two-play.com/plugins/toob-tuner", - "isEnabled": true, - "controlValues": [ - { - "key": "REFFREQ", - "value": 440 - }, - { - "key": "THRESHOLD", - "value": -23.1093884 - }, - { - "key": "MUTE", - "value": 0 - } - ], - "pluginName": "TooB Tuner", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 17, - "uri": "http://two-play.com/plugins/toob-input_stage", - "isEnabled": true, - "controlValues": [ - { - "key": "trim", - "value": 0 - }, - { - "key": "locut", - "value": 120 - }, - { - "key": "bright", - "value": 0 - }, - { - "key": "brightf", - "value": 1300 - }, - { - "key": "hicut", - "value": 6000 - }, - { - "key": "gate_t", - "value": -80 - }, - { - "key": "boost", - "value": 0 - } - ], - "pluginName": "TooB Input Stage", - "midiBindings": [ - { - "channel": -1, - "symbol": "__bypass", - "bindingType": 2, - "note": 72, - "control": 4, - "minValue": 0, - "maxValue": 1, - "rotaryScale": 1, - "linearControlType": 0, - "switchControlType": 0 - } - ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 42, - "uri": "http://two-play.com/plugins/toob-chorus", - "isEnabled": false, - "controlValues": [ - { - "key": "rate", - "value": 0.291666657 - }, - { - "key": "depth", - "value": 0.375 - } - ], - "pluginName": "TooB CE-2 Chorus", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 41, - "uri": "http://two-play.com/plugins/toob-delay", - "isEnabled": true, - "controlValues": [ - { - "key": "delay", - "value": 340 - }, - { - "key": "level", - "value": 27 - }, - { - "key": "feedback", - "value": 39 - } - ], - "pluginName": "TooB Delay", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 39, - "uri": "http://two-play.com/plugins/toob-ml", - "isEnabled": true, - "controlValues": [ - { - "key": "trim", - "value": -3 - }, - { - "key": "bass", - "value": 0.650000036 - }, - { - "key": "mid", - "value": 0.5 - }, - { - "key": "treble", - "value": 0.550000012 - }, - { - "key": "model", - "value": 19 - }, - { - "key": "gain", - "value": 0 - }, - { - "key": "master", - "value": 1.5 - } - ], - "pluginName": "TooB ML Amplifier", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 31, - "uri": "http://two-play.com/plugins/toob-freeverb", - "isEnabled": true, - "controlValues": [ - { - "key": "dryWet", - "value": 0.150000006 - }, - { - "key": "roomSize", - "value": 0.625 - }, - { - "key": "damping", - "value": 0.574999988 - } - ], - "pluginName": "TooB Freeverb", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - } - ], - "nextInstanceId": 45 - } - }, - { - "instanceId": 18, - "preset": { - "name": "Light Crunch", - "input_volume_db": 0, - "output_volume_db": 0, - "items": [ - { - "instanceId": 16, - "uri": "http://two-play.com/plugins/toob-tuner", - "isEnabled": true, - "controlValues": [ - { - "key": "REFFREQ", - "value": 440 - }, - { - "key": "THRESHOLD", - "value": -23.1093884 - }, - { - "key": "MUTE", - "value": 0 - } - ], - "pluginName": "TooB Tuner", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 17, - "uri": "http://two-play.com/plugins/toob-input_stage", - "isEnabled": true, - "controlValues": [ - { - "key": "trim", - "value": 0 - }, - { - "key": "locut", - "value": 120 - }, - { - "key": "bright", - "value": 0 - }, - { - "key": "brightf", - "value": 1300 - }, - { - "key": "hicut", - "value": 6000 - }, - { - "key": "gate_t", - "value": -80 - }, - { - "key": "boost", - "value": 0 - } - ], - "pluginName": "TooB Input Stage", - "midiBindings": [ - { - "channel": -1, - "symbol": "__bypass", - "bindingType": 2, - "note": 72, - "control": 4, - "minValue": 0, - "maxValue": 1, - "rotaryScale": 1, - "linearControlType": 0, - "switchControlType": 0 - } - ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 42, - "uri": "http://two-play.com/plugins/toob-chorus", - "isEnabled": false, - "controlValues": [ - { - "key": "rate", - "value": 0.291666657 - }, - { - "key": "depth", - "value": 0.375 - } - ], - "pluginName": "TooB CE-2 Chorus", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 41, - "uri": "http://two-play.com/plugins/toob-delay", - "isEnabled": true, - "controlValues": [ - { - "key": "delay", - "value": 340 - }, - { - "key": "level", - "value": 27 - }, - { - "key": "feedback", - "value": 39 - } - ], - "pluginName": "TooB Delay", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 39, - "uri": "http://two-play.com/plugins/toob-ml", - "isEnabled": true, - "controlValues": [ - { - "key": "trim", - "value": 2.5 - }, - { - "key": "bass", - "value": 0.650000036 - }, - { - "key": "mid", - "value": 0.5 - }, - { - "key": "treble", - "value": 0.266666681 - }, - { - "key": "model", - "value": 17 - }, - { - "key": "gain", - "value": 0 - }, - { - "key": "master", - "value": 2 - } - ], - "pluginName": "TooB ML Amplifier", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 31, - "uri": "http://two-play.com/plugins/toob-freeverb", - "isEnabled": true, - "controlValues": [ - { - "key": "dryWet", - "value": 0.150000006 - }, - { - "key": "roomSize", - "value": 0.625 - }, - { - "key": "damping", - "value": 0.574999988 - } - ], - "pluginName": "TooB Freeverb", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - } - ], - "nextInstanceId": 45 - } - }, - { - "instanceId": 19, - "preset": { - "name": "Heavy", - "input_volume_db": 0, - "output_volume_db": 0, - "items": [ - { - "instanceId": 16, - "uri": "http://two-play.com/plugins/toob-tuner", - "isEnabled": true, - "controlValues": [ - { - "key": "REFFREQ", - "value": 440 - }, - { - "key": "THRESHOLD", - "value": -23.1093884 - }, - { - "key": "MUTE", - "value": 0 - } - ], - "pluginName": "TooB Tuner", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 17, - "uri": "http://two-play.com/plugins/toob-input_stage", - "isEnabled": true, - "controlValues": [ - { - "key": "trim", - "value": 0 - }, - { - "key": "locut", - "value": 120 - }, - { - "key": "bright", - "value": 0 - }, - { - "key": "brightf", - "value": 1300 - }, - { - "key": "hicut", - "value": 6000 - }, - { - "key": "gate_t", - "value": -65.5 - }, - { - "key": "boost", - "value": 0 - } - ], - "pluginName": "TooB Input Stage", - "midiBindings": [ - { - "channel": -1, - "symbol": "__bypass", - "bindingType": 2, - "note": 72, - "control": 4, - "minValue": 0, - "maxValue": 1, - "rotaryScale": 1, - "linearControlType": 0, - "switchControlType": 0 - } - ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 42, - "uri": "http://two-play.com/plugins/toob-chorus", - "isEnabled": false, - "controlValues": [ - { - "key": "rate", - "value": 0.291666657 - }, - { - "key": "depth", - "value": 0.375 - } - ], - "pluginName": "TooB CE-2 Chorus", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 41, - "uri": "http://two-play.com/plugins/toob-delay", - "isEnabled": true, - "controlValues": [ - { - "key": "delay", - "value": 340 - }, - { - "key": "level", - "value": 27 - }, - { - "key": "feedback", - "value": 39.1666679 - } - ], - "pluginName": "TooB Delay", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 39, - "uri": "http://two-play.com/plugins/toob-ml", - "isEnabled": true, - "controlValues": [ - { - "key": "trim", - "value": 2.5 - }, - { - "key": "bass", - "value": 0 - }, - { - "key": "mid", - "value": 0.5 - }, - { - "key": "treble", - "value": 0.266666681 - }, - { - "key": "model", - "value": 18 - }, - { - "key": "gain", - "value": 0 - }, - { - "key": "master", - "value": -10 - }, - { - "key": "sag", - "value": 0 - }, - { - "key": "sagd", - "value": 0 - }, - { - "key": "sagf", - "value": 13 - } - ], - "pluginName": "TooB ML Amplifier", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 31, - "uri": "http://two-play.com/plugins/toob-freeverb", - "isEnabled": true, - "controlValues": [ - { - "key": "dryWet", - "value": 0.150000006 - }, - { - "key": "roomSize", - "value": 0.625 - }, - { - "key": "damping", - "value": 0.574999988 - } - ], - "pluginName": "TooB Freeverb", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - } - ], - "nextInstanceId": 45 - } - }, - { - "instanceId": 20, - "preset": { - "name": "Scream", - "input_volume_db": 0, - "output_volume_db": 0, - "items": [ - { - "instanceId": 16, - "uri": "http://two-play.com/plugins/toob-tuner", - "isEnabled": true, - "controlValues": [ - { - "key": "REFFREQ", - "value": 440 - }, - { - "key": "THRESHOLD", - "value": -54 - }, - { - "key": "MUTE", - "value": 0 - } - ], - "pluginName": "TooB Tuner", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 17, - "uri": "http://two-play.com/plugins/toob-input_stage", - "isEnabled": true, - "controlValues": [ - { - "key": "trim", - "value": -15.75 - }, - { - "key": "locut", - "value": 120 - }, - { - "key": "bright", - "value": 0 - }, - { - "key": "brightf", - "value": 1300 - }, - { - "key": "hicut", - "value": 6000 - }, - { - "key": "gate_t", - "value": -64.5 - }, - { - "key": "boost", - "value": 0 - } - ], - "pluginName": "TooB Input Stage", - "midiBindings": [ - { - "channel": -1, - "symbol": "__bypass", - "bindingType": 2, - "note": 72, - "control": 4, - "minValue": 0, - "maxValue": 1, - "rotaryScale": 1, - "linearControlType": 0, - "switchControlType": 0 - } - ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 47, - "uri": "http://two-play.com/plugins/toob-ml", - "isEnabled": true, - "controlValues": [ - { - "key": "trim", - "value": 12.5 - }, - { - "key": "model", - "value": 29 - }, - { - "key": "gain", - "value": 3 - }, - { - "key": "master", - "value": 6.5 - }, - { - "key": "bass", - "value": 0.5 - }, - { - "key": "mid", - "value": 0.5 - }, - { - "key": "treble", - "value": 0.5 - } - ], - "pluginName": "TooB ML Amplifier", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 42, - "uri": "http://two-play.com/plugins/toob-chorus", - "isEnabled": false, - "controlValues": [ - { - "key": "rate", - "value": 0.291666657 - }, - { - "key": "depth", - "value": 0.375 - } - ], - "pluginName": "TooB CE-2 Chorus", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 41, - "uri": "http://two-play.com/plugins/toob-delay", - "isEnabled": true, - "controlValues": [ - { - "key": "delay", - "value": 340 - }, - { - "key": "level", - "value": 10.333333 - }, - { - "key": "feedback", - "value": 39.1666679 - } - ], - "pluginName": "TooB Delay", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 39, - "uri": "http://two-play.com/plugins/toob-ml", - "isEnabled": true, - "controlValues": [ - { - "key": "trim", - "value": 2.5 - }, - { - "key": "bass", - "value": 0.5 - }, - { - "key": "mid", - "value": 0.5 - }, - { - "key": "treble", - "value": 0.5 - }, - { - "key": "model", - "value": 12 - }, - { - "key": "gain", - "value": 10 - }, - { - "key": "master", - "value": -10 - } - ], - "pluginName": "TooB ML Amplifier", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - }, - { - "instanceId": 31, - "uri": "http://two-play.com/plugins/toob-freeverb", - "isEnabled": true, - "controlValues": [ - { - "key": "dryWet", - "value": 0.0416666716 - }, - { - "key": "roomSize", - "value": 0.625 - }, - { - "key": "damping", - "value": 0.574999988 - } - ], - "pluginName": "TooB Freeverb", - "midiBindings": [ ], - "stateUpdateCount": 0, - "lv2State": [ -false,{ - - } ] -, - "lilvPresetUri": "" - } - ], - "nextInstanceId": 47 - } - } - ] + "preset": { + "name": "Screaming Lead", + "input_volume_db": 0, + "output_volume_db": 0, + "items": [ + { + "instanceId": 16, + "uri": "http://two-play.com/plugins/toob-tuner", + "isEnabled": true, + "controlValues": [ + { + "key": "REFFREQ", + "value": 440 + }, + { + "key": "THRESHOLD", + "value": -54 + }, + { + "key": "MUTE", + "value": 0 + } + ], + "pluginName": "TooB Tuner", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + false, + {} + ], + "lilvPresetUri": "", + "pathProperties": {}, + "title": "", + "useModUi": false + }, + { + "instanceId": 17, + "uri": "http://two-play.com/plugins/toob-input_stage", + "isEnabled": true, + "controlValues": [ + { + "key": "trim", + "value": -15.75 + }, + { + "key": "locut", + "value": 196.5 + }, + { + "key": "bright", + "value": 0 + }, + { + "key": "brightf", + "value": 1300 + }, + { + "key": "hicut", + "value": 13000 + }, + { + "key": "gate_t", + "value": -66.5 + }, + { + "key": "boost", + "value": 0 + } + ], + "pluginName": "TooB Input Stage", + "midiBindings": [ + { + "channel": -1, + "symbol": "__bypass", + "bindingType": 2, + "note": 72, + "control": 4, + "minControlValue": 0, + "maxControlValue": 127, + "minValue": 0, + "maxValue": 1, + "rotaryScale": 1, + "linearControlType": 0, + "switchControlType": 0 + } + ], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + false, + {} + ], + "lilvPresetUri": "", + "pathProperties": {}, + "title": "", + "useModUi": false + }, + { + "instanceId": 41, + "uri": "http://two-play.com/plugins/toob-delay", + "isEnabled": true, + "controlValues": [ + { + "key": "delay", + "value": 340 + }, + { + "key": "level", + "value": 18.666666 + }, + { + "key": "feedback", + "value": 13.3333349 + } + ], + "pluginName": "TooB Delay", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + false, + {} + ], + "lilvPresetUri": "", + "pathProperties": {}, + "title": "", + "useModUi": false + }, + { + "instanceId": 42, + "uri": "http://two-play.com/plugins/toob-chorus", + "isEnabled": false, + "controlValues": [ + { + "key": "rate", + "value": 0.291666657 + }, + { + "key": "depth", + "value": 0.375 + }, + { + "key": "dryWet", + "value": 1 + } + ], + "pluginName": "TooB CE-2 Chorus", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + false, + {} + ], + "lilvPresetUri": "", + "pathProperties": {}, + "title": "", + "useModUi": false + }, + { + "instanceId": 47, + "uri": "http://two-play.com/plugins/toob-ml", + "isEnabled": true, + "controlValues": [ + { + "key": "trim", + "value": 12.5 + }, + { + "key": "model", + "value": 29 + }, + { + "key": "gain", + "value": 3 + }, + { + "key": "master", + "value": -0.5 + }, + { + "key": "bass", + "value": 0.5 + }, + { + "key": "mid", + "value": 0.5 + }, + { + "key": "treble", + "value": 0.5 + }, + { + "key": "sag", + "value": 0 + }, + { + "key": "sagd", + "value": 0 + }, + { + "key": "sagf", + "value": 13 + } + ], + "pluginName": "TooB ML Amplifier", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + true, + { + "http://two-play.com/plugins/toob-ml#modelFile": { + "flags": 3, + "atomType": "http://lv2plug.in/ns/ext/atom#Path", + "value": "ToobMlModels/TS9_FullD.json" + }, + "http://two-play.com/plugins/toob-ml#version": { + "flags": 3, + "atomType": "http://lv2plug.in/ns/ext/atom#Float", + "value": 1 + } + } + ], + "lilvPresetUri": "", + "pathProperties": { + "http://two-play.com/plugins/toob-ml#modelFile": "{\"otype_\": \"Path\",\"value\": \"/var/pipedal/audio_uploads/ToobMlModels/TS9_FullD.json\"}" + }, + "title": "", + "useModUi": false + }, + { + "instanceId": 39, + "uri": "http://two-play.com/plugins/toob-ml", + "isEnabled": true, + "controlValues": [ + { + "key": "trim", + "value": -4 + }, + { + "key": "bass", + "value": 0.5 + }, + { + "key": "mid", + "value": 0.5 + }, + { + "key": "treble", + "value": 0.5 + }, + { + "key": "model", + "value": 12 + }, + { + "key": "gain", + "value": 10 + }, + { + "key": "master", + "value": -5 + }, + { + "key": "sag", + "value": 0 + }, + { + "key": "sagd", + "value": 0 + }, + { + "key": "sagf", + "value": 13 + } + ], + "pluginName": "TooB ML Amplifier", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + true, + { + "http://two-play.com/plugins/toob-ml#modelFile": { + "flags": 3, + "atomType": "http://lv2plug.in/ns/ext/atom#Path", + "value": "ToobMlModels/HT40_Overdrive.json" + }, + "http://two-play.com/plugins/toob-ml#version": { + "flags": 3, + "atomType": "http://lv2plug.in/ns/ext/atom#Float", + "value": 1 + } + } + ], + "lilvPresetUri": "", + "pathProperties": { + "http://two-play.com/plugins/toob-ml#modelFile": "{\"otype_\": \"Path\",\"value\": \"/var/pipedal/audio_uploads/ToobMlModels/HT40_Overdrive.json\"}" + }, + "title": "", + "useModUi": false + }, + { + "instanceId": 51, + "uri": "http://two-play.com/plugins/toob-flanger-stereo", + "isEnabled": true, + "controlValues": [ + { + "key": "manual", + "value": 0.5 + }, + { + "key": "depth", + "value": 0.5 + }, + { + "key": "rate", + "value": 0.5 + }, + { + "key": "lfo", + "value": 0 + }, + { + "key": "res", + "value": 0.5 + }, + { + "key": "dryWet", + "value": 0.508333325 + } + ], + "pluginName": "TooB BF-2 Stereo Flanger", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + false, + {} + ], + "lilvPresetUri": "", + "pathProperties": {}, + "title": "", + "useModUi": false + }, + { + "instanceId": 53, + "uri": "http://two-play.com/plugins/toob-freeverb", + "isEnabled": true, + "controlValues": [ + { + "key": "bypass", + "value": 1 + }, + { + "key": "dryWet", + "value": 0.150000006 + }, + { + "key": "roomSize", + "value": 0.649999976 + }, + { + "key": "damping", + "value": 0 + }, + { + "key": "tails", + "value": 1 + } + ], + "pluginName": "TooB Freeverb", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + false, + {} + ], + "lilvPresetUri": "", + "pathProperties": {}, + "title": "", + "useModUi": false + } + ], + "nextInstanceId": 53, + "snapshots": [], + "selectedSnapshot": -1, + "selectedPlugin": 16 + } + }, + { + "instanceId": 18, + "preset": { + "name": "Light Crunch", + "input_volume_db": 0, + "output_volume_db": 0, + "items": [ + { + "instanceId": 16, + "uri": "http://two-play.com/plugins/toob-tuner", + "isEnabled": true, + "controlValues": [ + { + "key": "REFFREQ", + "value": 440 + }, + { + "key": "THRESHOLD", + "value": -23.1093884 + }, + { + "key": "MUTE", + "value": 0 + } + ], + "pluginName": "TooB Tuner", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + false, + {} + ], + "lilvPresetUri": "", + "pathProperties": {}, + "title": "", + "useModUi": false + }, + { + "instanceId": 49, + "uri": "http://two-play.com/plugins/toob-noise-gate", + "isEnabled": true, + "controlValues": [ + { + "key": "threshold", + "value": -102 + }, + { + "key": "hysteresis", + "value": -6 + }, + { + "key": "trigger_led", + "value": 0 + }, + { + "key": "reduction", + "value": -60 + }, + { + "key": "attack", + "value": 1 + }, + { + "key": "hold", + "value": 100 + }, + { + "key": "release", + "value": 330 + }, + { + "key": "gate_level", + "value": -60 + } + ], + "pluginName": "TooB Noise Gate", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + false, + {} + ], + "lilvPresetUri": "", + "pathProperties": {}, + "title": "", + "useModUi": false + }, + { + "instanceId": 42, + "uri": "http://two-play.com/plugins/toob-chorus", + "isEnabled": false, + "controlValues": [ + { + "key": "rate", + "value": 0.291666657 + }, + { + "key": "depth", + "value": 0.375 + }, + { + "key": "dryWet", + "value": 1 + } + ], + "pluginName": "TooB CE-2 Chorus", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + false, + {} + ], + "lilvPresetUri": "", + "pathProperties": {}, + "title": "", + "useModUi": false + }, + { + "instanceId": 41, + "uri": "http://two-play.com/plugins/toob-delay", + "isEnabled": true, + "controlValues": [ + { + "key": "delay", + "value": 340 + }, + { + "key": "level", + "value": 27 + }, + { + "key": "feedback", + "value": 39 + } + ], + "pluginName": "TooB Delay", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + false, + {} + ], + "lilvPresetUri": "", + "pathProperties": {}, + "title": "", + "useModUi": false + }, + { + "instanceId": 39, + "uri": "http://two-play.com/plugins/toob-ml", + "isEnabled": true, + "controlValues": [ + { + "key": "trim", + "value": -0.5 + }, + { + "key": "bass", + "value": 0.650000036 + }, + { + "key": "mid", + "value": 0.5 + }, + { + "key": "treble", + "value": 0.266666681 + }, + { + "key": "model", + "value": 17 + }, + { + "key": "gain", + "value": 7.75 + }, + { + "key": "master", + "value": -4 + }, + { + "key": "sag", + "value": 0 + }, + { + "key": "sagd", + "value": 0 + }, + { + "key": "sagf", + "value": 13 + } + ], + "pluginName": "TooB ML Amplifier", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 1, + "lv2State": [ + true, + { + "http://two-play.com/plugins/toob-ml#modelFile": { + "flags": 3, + "atomType": "http://lv2plug.in/ns/ext/atom#Path", + "value": "ToobMlModels/ProCoRat.json" + }, + "http://two-play.com/plugins/toob-ml#version": { + "flags": 3, + "atomType": "http://lv2plug.in/ns/ext/atom#Float", + "value": 1 + } + } + ], + "lilvPresetUri": "", + "pathProperties": { + "http://two-play.com/plugins/toob-ml#modelFile": "{\"otype_\": \"Path\",\"value\": \"/var/pipedal/audio_uploads/ToobMlModels/ProCoRat.json\"}" + }, + "title": "", + "useModUi": false + }, + { + "instanceId": 51, + "uri": "http://two-play.com/plugins/toob-ml", + "isEnabled": true, + "controlValues": [ + { + "key": "trim", + "value": -3 + }, + { + "key": "trimOut", + "value": -35 + }, + { + "key": "model", + "value": -1 + }, + { + "key": "gain", + "value": 3 + }, + { + "key": "master", + "value": -6 + }, + { + "key": "bass", + "value": 0.5 + }, + { + "key": "mid", + "value": 0.5 + }, + { + "key": "treble", + "value": 0.5 + }, + { + "key": "sag", + "value": 0 + }, + { + "key": "sagd", + "value": 0 + }, + { + "key": "sagf", + "value": 13 + }, + { + "key": "gainEnable", + "value": 0 + } + ], + "pluginName": "TooB ML Amplifier", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + true, + { + "http://two-play.com/plugins/toob-ml#modelFile": { + "flags": 3, + "atomType": "http://lv2plug.in/ns/ext/atom#Path", + "value": "ToobMlModels/FenderPrinceton_highLevel.json" + }, + "http://two-play.com/plugins/toob-ml#version": { + "flags": 3, + "atomType": "http://lv2plug.in/ns/ext/atom#Float", + "value": 1 + } + } + ], + "lilvPresetUri": "", + "pathProperties": { + "http://two-play.com/plugins/toob-ml#modelFile": "{\"otype_\": \"Path\",\"value\": \"/var/pipedal/audio_uploads/ToobMlModels/FenderPrinceton_highLevel.json\"}" + }, + "title": "", + "useModUi": false + }, + { + "instanceId": 58, + "uri": "http://two-play.com/plugins/toob-nam", + "isEnabled": true, + "controlValues": [ + { + "key": "inputGain", + "value": -12.666667 + }, + { + "key": "inputGainOut", + "value": -35 + }, + { + "key": "outputGain", + "value": 0 + }, + { + "key": "gate", + "value": -120 + }, + { + "key": "gateOut", + "value": 0 + }, + { + "key": "buffer", + "value": 0 + }, + { + "key": "toneStack", + "value": 3 + }, + { + "key": "bass", + "value": 5 + }, + { + "key": "mid", + "value": 5 + }, + { + "key": "treble", + "value": 5 + }, + { + "key": "inputCalibrationMode", + "value": 1 + }, + { + "key": "calibration", + "value": -6 + }, + { + "key": "outputCalibration", + "value": 0 + }, + { + "key": "version", + "value": 1 + } + ], + "pluginName": "TooB Neural Amp Modeler", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 1, + "lv2State": [ + true, + {} + ], + "lilvPresetUri": "", + "pathProperties": { + "http://two-play.com/plugins/toob-nam#modelFile": "{\"otype_\": \"Path\",\"value\": \"\"}" + }, + "title": "", + "useModUi": false + }, + { + "instanceId": 53, + "uri": "http://two-play.com/plugins/toob-parametric-eq", + "isEnabled": true, + "controlValues": [ + { + "key": "loCut", + "value": 27.2704601 + }, + { + "key": "hiCut", + "value": 21 + }, + { + "key": "lfLevel", + "value": 0 + }, + { + "key": "lfC", + "value": 120 + }, + { + "key": "lmfLevel", + "value": -6.5 + }, + { + "key": "lmfC", + "value": 551.471313 + }, + { + "key": "lmfQ", + "value": 0.850504637 + }, + { + "key": "hmfLevel", + "value": -7.5 + }, + { + "key": "hmfC", + "value": 2.5746665 + }, + { + "key": "hmfQ", + "value": 1.5 + }, + { + "key": "hfLevel", + "value": -6.5 + }, + { + "key": "hfC", + "value": 2.25 + }, + { + "key": "gain", + "value": 0 + } + ], + "pluginName": "TooB Parametric EQ", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + false, + {} + ], + "lilvPresetUri": "", + "pathProperties": {}, + "title": "", + "useModUi": false + }, + { + "instanceId": 31, + "uri": "http://two-play.com/plugins/toob-freeverb", + "isEnabled": true, + "controlValues": [ + { + "key": "dryWet", + "value": 0.416666687 + }, + { + "key": "roomSize", + "value": 0.625 + }, + { + "key": "damping", + "value": 0.574999988 + }, + { + "key": "bypass", + "value": 1 + }, + { + "key": "tails", + "value": 1 + } + ], + "pluginName": "TooB Freeverb", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + false, + {} + ], + "lilvPresetUri": "", + "pathProperties": {}, + "title": "", + "useModUi": false + } + ], + "nextInstanceId": 58, + "snapshots": [], + "selectedSnapshot": -1, + "selectedPlugin": 16 + } + }, + { + "instanceId": 15, + "preset": { + "name": "Jazz ML", + "input_volume_db": 0, + "output_volume_db": 0, + "items": [ + { + "instanceId": 16, + "uri": "http://two-play.com/plugins/toob-tuner", + "isEnabled": true, + "controlValues": [ + { + "key": "REFFREQ", + "value": 440 + }, + { + "key": "THRESHOLD", + "value": -23.1093884 + }, + { + "key": "MUTE", + "value": 0 + } + ], + "pluginName": "TooB Tuner", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + false, + {} + ], + "lilvPresetUri": "", + "pathProperties": {}, + "title": "", + "useModUi": false + }, + { + "instanceId": 45, + "uri": "http://two-play.com/plugins/toob-noise-gate", + "isEnabled": true, + "controlValues": [ + { + "key": "threshold", + "value": -53 + }, + { + "key": "hysteresis", + "value": -6 + }, + { + "key": "trigger_led", + "value": 0 + }, + { + "key": "reduction", + "value": -60 + }, + { + "key": "attack", + "value": 1 + }, + { + "key": "hold", + "value": 100 + }, + { + "key": "release", + "value": 330 + }, + { + "key": "gate_level", + "value": -60 + } + ], + "pluginName": "TooB Noise Gate", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + false, + {} + ], + "lilvPresetUri": "", + "pathProperties": {}, + "title": "", + "useModUi": false + }, + { + "instanceId": 41, + "uri": "http://two-play.com/plugins/toob-chorus", + "isEnabled": false, + "controlValues": [ + { + "key": "rate", + "value": 0.208333328 + }, + { + "key": "depth", + "value": 0.5 + }, + { + "key": "dryWet", + "value": 1 + } + ], + "pluginName": "TooB CE-2 Chorus", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + false, + {} + ], + "lilvPresetUri": "", + "pathProperties": {}, + "title": "", + "useModUi": false + }, + { + "instanceId": 47, + "uri": "http://two-play.com/plugins/toob-parametric-eq", + "isEnabled": true, + "controlValues": [ + { + "key": "loCut", + "value": 41.8936462 + }, + { + "key": "hiCut", + "value": 21 + }, + { + "key": "lfLevel", + "value": 0 + }, + { + "key": "lfC", + "value": 120 + }, + { + "key": "lmfLevel", + "value": -5.5 + }, + { + "key": "lmfC", + "value": 238.107834 + }, + { + "key": "lmfQ", + "value": 0.837899804 + }, + { + "key": "hmfLevel", + "value": 0 + }, + { + "key": "hmfC", + "value": 2 + }, + { + "key": "hmfQ", + "value": 1.5 + }, + { + "key": "hfLevel", + "value": -12 + }, + { + "key": "hfC", + "value": 1 + }, + { + "key": "gain", + "value": 5.83333349 + } + ], + "pluginName": "TooB Parametric EQ", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + false, + {} + ], + "lilvPresetUri": "", + "pathProperties": {}, + "title": "", + "useModUi": false + }, + { + "instanceId": 39, + "uri": "http://two-play.com/plugins/toob-ml", + "isEnabled": true, + "controlValues": [ + { + "key": "trim", + "value": -13 + }, + { + "key": "bass", + "value": 0.5 + }, + { + "key": "mid", + "value": 0.5 + }, + { + "key": "treble", + "value": 0.5 + }, + { + "key": "model", + "value": 0 + }, + { + "key": "gain", + "value": 4.66666651 + }, + { + "key": "master", + "value": 5 + }, + { + "key": "sag", + "value": 0.550000012 + }, + { + "key": "sagd", + "value": 0.900000036 + }, + { + "key": "sagf", + "value": 13 + } + ], + "pluginName": "TooB ML Amplifier", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 2, + "lv2State": [ + true, + { + "http://two-play.com/plugins/toob-ml#modelFile": { + "flags": 3, + "atomType": "http://lv2plug.in/ns/ext/atom#Path", + "value": "ToobMlModels/FenderPrinceton_clean.json" + }, + "http://two-play.com/plugins/toob-ml#version": { + "flags": 3, + "atomType": "http://lv2plug.in/ns/ext/atom#Float", + "value": 1 + } + } + ], + "lilvPresetUri": "", + "pathProperties": { + "http://two-play.com/plugins/toob-ml#modelFile": "{\"otype_\": \"Path\",\"value\": \"/var/pipedal/audio_uploads/ToobMlModels/FenderPrinceton_clean.json\"}" + }, + "title": "", + "useModUi": false + }, + { + "instanceId": 31, + "uri": "http://two-play.com/plugins/toob-freeverb", + "isEnabled": true, + "controlValues": [ + { + "key": "dryWet", + "value": 0.416666657 + }, + { + "key": "roomSize", + "value": 0.625 + }, + { + "key": "damping", + "value": 0.574999988 + }, + { + "key": "bypass", + "value": 1 + }, + { + "key": "tails", + "value": 1 + } + ], + "pluginName": "TooB Freeverb", + "midiBindings": [], + "midiChannelBinding": null, + "stateUpdateCount": 0, + "lv2State": [ + false, + {} + ], + "lilvPresetUri": "", + "pathProperties": {}, + "title": "", + "useModUi": false + } + ], + "nextInstanceId": 48, + "snapshots": [], + "selectedSnapshot": -1, + "selectedPlugin": 16 + } + } + ] } \ No newline at end of file diff --git a/src/AtomConverter.cpp b/src/AtomConverter.cpp index 3e23fcb..59c61e1 100644 --- a/src/AtomConverter.cpp +++ b/src/AtomConverter.cpp @@ -140,6 +140,11 @@ json_variant AtomConverter::AbstractPath(const json_variant&json, const std::str } +json_variant AtomConverter::MakePathVariant(const std::string&pathString) +{ + return TypedProperty(SHORT_ATOM__Path,pathString); +} + LV2_Atom*AtomConverter::ToAtom(const json_variant&json) { diff --git a/src/AtomConverter.hpp b/src/AtomConverter.hpp index 5000531..d64094f 100644 --- a/src/AtomConverter.hpp +++ b/src/AtomConverter.hpp @@ -156,6 +156,7 @@ namespace pipedal static json_variant MapPath(const json_variant&json, const std::string &pluginStoragePath); static json_variant AbstractPath(const json_variant&json, const std::string &pluginStoragePath); + static json_variant MakePathVariant(const std::string&pathString); static std::string EmptyPathstring(); static const json_variant& EmptyPath() { return gEmptyPath; } diff --git a/src/PiPedalModel.cpp b/src/PiPedalModel.cpp index cc1fcbd..e3f0525 100644 --- a/src/PiPedalModel.cpp +++ b/src/PiPedalModel.cpp @@ -248,6 +248,8 @@ void PiPedalModel::LoadLv2PluginInfo() // Copy all presets out of Lilv data to json files // so that we can close lilv while we're actually // running. + + uint64_t pluginPresetIndexVersion = storage.GetPluginPresetIndexVersion(); for (const auto &plugin : pluginHost.GetPlugins()) { if (plugin->has_factory_presets()) @@ -256,9 +258,26 @@ void PiPedalModel::LoadLv2PluginInfo() { PluginPresets pluginPresets = pluginHost.GetFactoryPluginPresets(plugin->uri()); storage.SavePluginPresets(plugin->uri(), pluginPresets); + } else { + if (pluginPresetIndexVersion == 0) + { + if (plugin->uri() == "http://two-play.com/plugins/toob-convolution-reverb" || plugin->uri() == "http://two-play.com/plugins/toob-convolution-reverb-stereo") + { + // overwrite previous factory presets! + PluginPresets pluginPresets = pluginHost.GetFactoryPluginPresets(plugin->uri()); + for (auto & pluginPreset: pluginPresets.presets_) + { + storage.SavePluginPreset( + plugin->uri(), + pluginPreset); + } + + } + } } } } + storage.SetPluginPresetIndexVersion(1); } void PiPedalModel::Load() @@ -1734,7 +1753,7 @@ void PiPedalModel::SendSetPatchProperty( pedalboardItem->pathProperties_[propertyUri] = atomString; } this->SetPresetChanged(clientId, true); -} + } LV2_Atom *atomValue = atomConverter.ToAtom(value); std::function onRequestComplete{ @@ -1828,11 +1847,13 @@ void PiPedalModel::SendGetPatchProperty( bool foundValue = false; std::lock_guard lock(mutex); auto pedalboardItem = this->pedalboard.GetItem(pParameter->instanceId); - if (pedalboardItem) { + if (pedalboardItem) + { if (pedalboardItem->pathProperties_.contains(pParameter->uri)) { pParameter->jsonResponse = pedalboardItem->pathProperties_[pParameter->uri]; - if (pParameter->onSuccess) { + if (pParameter->onSuccess) + { foundValue = true; pParameter->onSuccess(pParameter->jsonResponse); } @@ -2085,9 +2106,12 @@ void PiPedalModel::UpdateDefaults(PedalboardItem *pedalboardItem, std::unordered } for (auto i = pedalboardItem->pathProperties_.begin(); i != pedalboardItem->pathProperties_.end(); /**/) { - if (!validFileProperties.contains(i->first)) { + if (!validFileProperties.contains(i->first)) + { i = pedalboardItem->pathProperties_.erase(i); - } else { + } + else + { ++i; } } @@ -2414,8 +2438,10 @@ void PiPedalModel::MonitorPatchProperty(int64_t clientId, int64_t clientHandle, if (map.contains(propertyUri)) { const auto &value = map.at(propertyUri); - if (value != "null") { - try { + if (value != "null") + { + try + { std::string json = storage.FromAbstractPathJson(value); for (auto &subscriber : this->subscribers) @@ -2425,8 +2451,9 @@ void PiPedalModel::MonitorPatchProperty(int64_t clientId, int64_t clientHandle, subscriber->OnNotifyPatchProperty(clientHandle, instanceId, propertyUri, json); } } - } catch (const std::exception& ignored) { - + } + catch (const std::exception &ignored) + { } } } diff --git a/src/PluginHost.cpp b/src/PluginHost.cpp index d744454..2fd40fd 100644 --- a/src/PluginHost.cpp +++ b/src/PluginHost.cpp @@ -19,6 +19,7 @@ #include "pch.h" #include "AtomConverter.hpp" +#include "HtmlHelper.hpp" #include "PluginHost.hpp" #include #include @@ -1590,6 +1591,210 @@ void PluginHost::PortValueCallback(const char *symbol, void *user_data, const vo pState->failed = true; } } + +static bool lineStartsWith(const std::string &line, const char*text) { + for (char c: line) { + if (c == ' ' || c == '\t') { + continue; + } + if (c != *text) { + return false; + } + ++text; + if (*text == '\0') + { + return true; + } + } + return false; +} + +static void skipWhitespace(std::istream &s) { + while (true) + { + auto c = s.peek(); + if (c == ' ' || c == '\t') { + s.get(); + } else { + return; + } + } +} + +static bool parseTtlUrl(std::istream &s, std::string *result) +{ + if (s.peek() != '<') { + return false; + } + s.get(); + std::ostringstream o; + while (s.peek() != '>') + { + + int c = s.get(); + if (c == EOF) + { + return false; + + } + o << (char)c; + } + s.get(); + + *result = o.str(); + return true; +} + +static uint32_t readTtlUnicodeEscape(std::istream&s, size_t nChars) +{ + uint32_t result = 0; + + for (size_t i = 0; i < nChars; ++i) + { + int c = s.peek(); + if (c >= '0' && c <= '9') + { + result = result*16 + (uint32_t)(c-'0'); + } else if (c >= 'a' && c <= 'f') { + result = result*16 + (uint32_t)(c-'a'+10); + } else if (c >= 'A' && c <= 'F') { + result = result*16 + (uint32_t)(c-'A'+10); + } + s.get(); + } + return result; +} +static bool parseTtlString(std::istream&s, std::string *result) +{ + if (s.peek() != '"') { + return false; + } + s.get(); // consume opening quote + std::ostringstream o; + while (s.peek() != '"') { + int c = s.get(); + if (c == EOF) { + return false; + } + if (c == '\\') { + // Handle escape sequences + int next = s.get(); + if (next == EOF) { + return false; + } + switch (next) { + case 'n': + o << '\n'; + break; + case 't': + o << '\t'; + break; + case 'r': + o << '\r'; + break; + case '\\': + o << '\\'; + break; + case '"': + o << '"'; + break; + case 'u': + { + uint32_t cc = readTtlUnicodeEscape(s,4); + HtmlHelper::utf32_to_utf8_stream(o,cc); + break; + } + case 'U': + { + uint32_t cc = readTtlUnicodeEscape(s,8); + HtmlHelper::utf32_to_utf8_stream(o,cc); + break; + } + default: + o << (char)next; + break; + } + } else { + o << (char)c; + } + } + s.get(); // consume closing quote + *result = o.str(); + return true; +} +static bool parseStateProperty(const std::string &line, std::string *property, std::string *value) { + std::istringstream s { line}; + + skipWhitespace(s); + if (!parseTtlUrl(s,property)) { + return false; + } + skipWhitespace(s); + if (!parseTtlString(s,value)) + { + return false; + } + return true; +} +static std::map ExtractPathPropertiesFromLilvState( + Lv2PluginInfo *pluginInfo, + const std::string lilvPresetText +) +{ + // + // a pset:Preset ; + // ... + // state:state [ + // "ReverbImpulseFiles/Arthur Sykes Rymer Auditorium.wav" + // ] . + + std::map result; + std::istringstream s{lilvPresetText}; + std::string line; + + bool foundState = false; + for (std::string line; std::getline(s, line);) { + if (lineStartsWith(line,"state:state")) + { + foundState = true; + break; + } + } + + if (foundState) + { + for (std::string line; std::getline(s, line);) { + if (lineStartsWith(line,"]")) + { + break; + } + std::string property, value; + if (parseStateProperty(line,&property,&value)) { + if (pluginInfo->IsPathProperty(property)) + { result[property] = AtomConverter::MakePathVariant(value).to_string(); + } + } + } + } + return result; + +} + + +bool Lv2PluginInfo::IsPathProperty(const std::string &uri) const { + if (!piPedalUI_) { + + } + for (const UiFileProperty::ptr& fileProperty: this->piPedalUI_->fileProperties()) + { + if (fileProperty->patchProperty() == uri) + { + return true; + } + } + return false; +} + PluginPresets PluginHost::GetFactoryPluginPresets(const std::string &pluginUri) { const LilvPlugins *plugins = lilv_world_get_all_plugins(this->pWorld); @@ -1616,7 +1821,6 @@ PluginPresets PluginHost::GetFactoryPluginPresets(const std::string &pluginUri) LilvState *state = lilv_state_new_from_world(pWorld, this->mapFeature.GetMap(), preset); if (state != nullptr) { - const char *t = this->mapFeature.UridToString(14); const char *tLabel = lilv_state_get_label(state); if (tLabel != nullptr) { @@ -1629,6 +1833,8 @@ PluginPresets PluginHost::GetFactoryPluginPresets(const std::string &pluginUri) // can't handle std:state part of preset. if (numProperties == 0) { + + if (!cbData.failed) { result.presets_.push_back( @@ -1642,7 +1848,23 @@ PluginPresets PluginHost::GetFactoryPluginPresets(const std::string &pluginUri) } else { - result.presets_.push_back(PluginPreset::MakeLilvPreset(result.nextInstanceId_++, strLabel, controlValues, lilv_node_as_uri(preset))); + + std::string stateString = lilv_state_to_string( + pWorld,mapFeature.GetMap(),mapFeature.GetUnmap(), + state, + "urn:xxx", + nullptr); + (void)stateString; + + std::shared_ptr pluginInfo = GetPluginInfo(pluginUri); + + PluginPreset pluginPreset = PluginPreset::MakeLilvPreset(result.nextInstanceId_++, strLabel, controlValues, lilv_node_as_uri(preset)); + + pluginPreset.pathProperties_ = ExtractPathPropertiesFromLilvState( + pluginInfo.get(), + stateString + ); + result.presets_.push_back(pluginPreset); } lilv_state_free(state); } diff --git a/src/PluginHost.hpp b/src/PluginHost.hpp index 59ad1c2..a1a46c5 100644 --- a/src/PluginHost.hpp +++ b/src/PluginHost.hpp @@ -512,6 +512,7 @@ namespace pipedal } } } + bool IsPathProperty(const std::string &uri) const; public: virtual ~Lv2PluginInfo(); diff --git a/src/PluginPreset.cpp b/src/PluginPreset.cpp index e13727b..01cb673 100644 --- a/src/PluginPreset.cpp +++ b/src/PluginPreset.cpp @@ -90,6 +90,7 @@ JSON_MAP_END() JSON_MAP_BEGIN(PluginPresetIndex) JSON_MAP_REFERENCE(PluginPresetIndex,entries) + JSON_MAP_REFERENCE(PluginPresetIndex,version) JSON_MAP_REFERENCE(PluginPresetIndex,nextInstanceId) JSON_MAP_END() diff --git a/src/PluginPreset.hpp b/src/PluginPreset.hpp index 5daea14..944282c 100644 --- a/src/PluginPreset.hpp +++ b/src/PluginPreset.hpp @@ -65,6 +65,7 @@ class PluginPresetIndex { public: std::vector entries_; uint64_t nextInstanceId_ = 1; + uint64_t version_ = 0; DECLARE_JSON_MAP(PluginPresetIndex); }; diff --git a/src/Storage.cpp b/src/Storage.cpp index 7db950a..8e81a04 100644 --- a/src/Storage.cpp +++ b/src/Storage.cpp @@ -404,6 +404,7 @@ void Storage::SavePluginPresetIndex() } } + void Storage::SaveBankIndex() { pipedal::ofstream_synced os; @@ -1234,6 +1235,22 @@ bool Storage::RestoreCurrentPreset(CurrentPreset *pResult) return false; } } + +uint64_t Storage::GetPluginPresetIndexVersion() +{ + return pluginPresetIndex.version_; +} +void Storage::SetPluginPresetIndexVersion(uint64_t version) +{ + if (this->pluginPresetIndex.version_ != version) + { + this->pluginPresetIndexChanged = true; + this->pluginPresetIndex.version_ = version; + SavePluginPresetIndex(); + } + +} + bool Storage::HasPluginPresets(const std::string &pluginUri) const { for (const auto &entry : this->pluginPresetIndex.entries_) @@ -1486,10 +1503,8 @@ uint64_t Storage::SavePluginPreset( uint64_t Storage::SavePluginPreset( const std::string &pluginUri, - const std::string &name, - const std::map &values, - const std::map &pathProperties, - const Lv2PluginState &lv2State) + PluginPreset &pluginPreset +) { auto presets = GetPluginPresets(pluginUri); uint64_t result = -1; @@ -1497,13 +1512,12 @@ uint64_t Storage::SavePluginPreset( for (size_t i = 0; i < presets.presets_.size(); ++i) { auto &preset = presets.presets_[i]; - if (preset.label_ == name) + if (preset.label_ == pluginPreset.label_) { existing = true; - preset.controlValues_ = values; - preset.pathProperties_ = pathProperties; - preset.state_ = lv2State; - + auto t = preset.instanceId_; + preset = pluginPreset; + preset.instanceId_ = t; result = preset.instanceId_; break; } @@ -1511,13 +1525,9 @@ uint64_t Storage::SavePluginPreset( if (!existing) { result = presets.nextInstanceId_++; + pluginPreset.instanceId_ = result; presets.presets_.push_back( - PluginPreset( - result, - name, - values, - pathProperties, - lv2State)); + pluginPreset); } this->SavePluginPresets(pluginUri, presets); return result; diff --git a/src/Storage.hpp b/src/Storage.hpp index db6cbc4..796a23a 100644 --- a/src/Storage.hpp +++ b/src/Storage.hpp @@ -153,6 +153,7 @@ public: void SaveCurrentPreset(const Pedalboard&pedalboard); int64_t SaveCurrentPresetAs(const Pedalboard&pedalboard, const std::string&namne,int64_t saveAfterInstanceId = -1); int64_t GetCurrentPresetId() const; + void GetPresetIndex(PresetIndex*pResult); void SetPresetIndex(const PresetIndex &presetIndex); Pedalboard GetPreset(int64_t instanceId) const; @@ -213,6 +214,7 @@ private: void LoadPluginPresetIndex(); void SavePluginPresetIndex(); + std::filesystem::path GetPluginPresetPath(const std::string &pluginUri) const; bool IsValidSampleFileName(const std::filesystem::path&fileName); std::filesystem::path MakeUserFilePath(const std::string &directory, const std::string&filename); @@ -220,6 +222,9 @@ private: void FromAbstractPaths(PluginPreset&pluginPreset); public: + uint64_t GetPluginPresetIndexVersion(); + void SetPluginPresetIndexVersion(uint64_t version); + bool HasPluginPresets(const std::string&pluginUri) const; void SavePluginPresets(const std::string&pluginUri, const PluginPresets&presets); void MergePluginPresets(const std::string&pluginUri, const PluginPresets&presets); @@ -233,13 +238,9 @@ public: const std::string&name, const PedalboardItem&pedalboardEntry ); - uint64_t SavePluginPreset( const std::string &pluginUri, - const std::string &name, - const std::map &values, - const std::map&pathProperties, - const Lv2PluginState& lv2State); + PluginPreset& preset); void UpdatePluginPresets(const PluginUiPresets &pluginPresets); uint64_t CopyPluginPreset(const std::string&pluginUri,uint64_t presetId);