Browse Source

Fix template cable IDs.

tags/v2.0.0
Andrew Belt 5 years ago
parent
commit
6c9afbec7a
2 changed files with 109 additions and 95 deletions
  1. +9
    -6
      src/app/RackWidget.cpp
  2. +100
    -89
      template.vcv

+ 9
- 6
src/app/RackWidget.cpp View File

@@ -171,7 +171,8 @@ void RackWidget::mergeJson(json_t* rootJ) {


// modules // modules
json_t* modulesJ = json_object_get(rootJ, "modules"); json_t* modulesJ = json_object_get(rootJ, "modules");
assert(modulesJ);
if (!modulesJ)
return;
size_t moduleIndex; size_t moduleIndex;
json_t* moduleJ; json_t* moduleJ;
json_array_foreach(modulesJ, moduleIndex, moduleJ) { json_array_foreach(modulesJ, moduleIndex, moduleJ) {
@@ -182,7 +183,8 @@ void RackWidget::mergeJson(json_t* rootJ) {
int id = json_integer_value(idJ); int id = json_integer_value(idJ);
// TODO Legacy v0.6? // TODO Legacy v0.6?
ModuleWidget* moduleWidget = getModule(id); ModuleWidget* moduleWidget = getModule(id);
assert(moduleWidget);
if (!moduleWidget)
continue;


// pos // pos
math::Vec pos = moduleWidget->box.pos.minus(moduleOffset); math::Vec pos = moduleWidget->box.pos.minus(moduleOffset);
@@ -193,7 +195,8 @@ void RackWidget::mergeJson(json_t* rootJ) {


// cables // cables
json_t* cablesJ = json_object_get(rootJ, "cables"); json_t* cablesJ = json_object_get(rootJ, "cables");
assert(cablesJ);
if (!cablesJ)
return;
size_t cableIndex; size_t cableIndex;
json_t* cableJ; json_t* cableJ;
json_array_foreach(cablesJ, cableIndex, cableJ) { json_array_foreach(cablesJ, cableIndex, cableJ) {
@@ -203,7 +206,8 @@ void RackWidget::mergeJson(json_t* rootJ) {
continue; continue;
int id = json_integer_value(idJ); int id = json_integer_value(idJ);
CableWidget* cw = getCable(id); CableWidget* cw = getCable(id);
assert(cw);
if (!cw)
continue;


json_t* cwJ = cw->toJson(); json_t* cwJ = cw->toJson();
// Merge cable JSON object // Merge cable JSON object
@@ -215,8 +219,7 @@ void RackWidget::mergeJson(json_t* rootJ) {
void RackWidget::fromJson(json_t* rootJ) { void RackWidget::fromJson(json_t* rootJ) {
// modules // modules
json_t* modulesJ = json_object_get(rootJ, "modules"); json_t* modulesJ = json_object_get(rootJ, "modules");
if (!modulesJ)
return;
assert(modulesJ);
size_t moduleIndex; size_t moduleIndex;
json_t* moduleJ; json_t* moduleJ;
json_array_foreach(modulesJ, moduleIndex, moduleJ) { json_array_foreach(modulesJ, moduleIndex, moduleJ) {


+ 100
- 89
template.vcv View File

@@ -1,11 +1,14 @@
{ {
"version": "1.dev.82b817e",
"version": "2.dev.bfce9cc",
"modules": [ "modules": [
{ {
"id": 1,
"plugin": "Core", "plugin": "Core",
"version": "1.0.0",
"version": "2.0.0",
"model": "AudioInterface", "model": "AudioInterface",
"params": [], "params": [],
"leftModuleId": 2,
"rightModuleId": 8,
"data": { "data": {
"audio": { "audio": {
"driver": 1, "driver": 1,
@@ -15,129 +18,128 @@
"blockSize": 256 "blockSize": 256
} }
}, },
"leftModuleId": 2,
"rightModuleId": 8,
"id": 1,
"pos": [ "pos": [
57, 57,
0 0
] ]
}, },
{ {
"id": 2,
"plugin": "Fundamental", "plugin": "Fundamental",
"version": "1.0.0",
"version": "2.0.0",
"model": "VCMixer", "model": "VCMixer",
"params": [ "params": [
{ {
"id": 0,
"value": 1.0
"value": 1.0,
"id": 0
}, },
{ {
"id": 1,
"value": 1.0
"value": 1.0,
"id": 1
}, },
{ {
"id": 2,
"value": 1.0
"value": 1.0,
"id": 2
}, },
{ {
"id": 3,
"value": 1.0
"value": 1.0,
"id": 3
}, },
{ {
"id": 4,
"value": 1.0
"value": 1.0,
"id": 4
} }
], ],
"leftModuleId": 7, "leftModuleId": 7,
"rightModuleId": 1, "rightModuleId": 1,
"id": 2,
"pos": [ "pos": [
47, 47,
0 0
] ]
}, },
{ {
"id": 3,
"plugin": "Fundamental", "plugin": "Fundamental",
"version": "1.0.0",
"version": "2.0.0",
"model": "VCO", "model": "VCO",
"params": [ "params": [
{ {
"id": 0,
"value": 1.0
"value": 1.0,
"id": 0
}, },
{ {
"id": 1,
"value": 1.0
"value": 1.0,
"id": 1
}, },
{ {
"id": 2,
"value": 0.0
"value": 0.0,
"id": 2
}, },
{ {
"id": 3,
"value": 0.0
"value": 0.0,
"id": 3
}, },
{ {
"id": 4,
"value": 0.0
"value": 0.0,
"id": 4
}, },
{ {
"id": 5,
"value": 0.5
"value": 0.5,
"id": 5
}, },
{ {
"id": 6,
"value": 0.0
"value": 0.0,
"id": 6
} }
], ],
"leftModuleId": 5, "leftModuleId": 5,
"rightModuleId": 4, "rightModuleId": 4,
"id": 3,
"pos": [ "pos": [
8, 8,
0 0
] ]
}, },
{ {
"id": 4,
"plugin": "Fundamental", "plugin": "Fundamental",
"version": "1.0.0",
"version": "2.0.0",
"model": "VCF", "model": "VCF",
"params": [ "params": [
{ {
"id": 0,
"value": 0.0
"value": 0.0,
"id": 0
}, },
{ {
"id": 1,
"value": 0.5
"value": 0.5,
"id": 1
}, },
{ {
"id": 2,
"value": 0.234000027
"value": 0.234000027,
"id": 2
}, },
{ {
"id": 3,
"value": 1.0
"value": 1.0,
"id": 3
}, },
{ {
"id": 4,
"value": 0.0
"value": 0.0,
"id": 4
} }
], ],
"leftModuleId": 3, "leftModuleId": 3,
"rightModuleId": 6, "rightModuleId": 6,
"id": 4,
"pos": [ "pos": [
18, 18,
0 0
] ]
}, },
{ {
"id": 5,
"plugin": "Core", "plugin": "Core",
"version": "1.0.0",
"version": "2.0.0",
"model": "MIDIToCVInterface", "model": "MIDIToCVInterface",
"params": [], "params": [],
"rightModuleId": 3,
"data": { "data": {
"channels": 1, "channels": 1,
"polyMode": 0, "polyMode": 0,
@@ -150,117 +152,118 @@
"channel": -1 "channel": -1
} }
}, },
"rightModuleId": 3,
"id": 5,
"pos": [ "pos": [
0, 0,
0 0
] ]
}, },
{ {
"id": 6,
"plugin": "Fundamental", "plugin": "Fundamental",
"version": "1.0.0",
"version": "2.0.0",
"model": "ADSR", "model": "ADSR",
"params": [ "params": [
{ {
"id": 0,
"value": 0.258000046
"value": 0.258000046,
"id": 0
}, },
{ {
"id": 1,
"value": 0.743000448
"value": 0.743000448,
"id": 1
}, },
{ {
"id": 2,
"value": 0.5
"value": 0.5,
"id": 2
}, },
{ {
"id": 3,
"value": 0.576500058
"value": 0.576500058,
"id": 3
} }
], ],
"leftModuleId": 4, "leftModuleId": 4,
"rightModuleId": 7, "rightModuleId": 7,
"id": 6,
"pos": [ "pos": [
26, 26,
0 0
] ]
}, },
{ {
"id": 7,
"plugin": "Fundamental", "plugin": "Fundamental",
"version": "1.0.0",
"version": "2.0.0",
"model": "Scope", "model": "Scope",
"params": [ "params": [
{ {
"id": 0,
"value": 0.0
"value": 0.0,
"id": 0
}, },
{ {
"id": 1,
"value": 0.0
"value": 0.0,
"id": 1
}, },
{ {
"id": 2,
"value": 0.0
"value": 0.0,
"id": 2
}, },
{ {
"id": 3,
"value": 0.0
"value": 0.0,
"id": 3
}, },
{ {
"id": 4,
"value": 14.0
"value": 14.0,
"id": 4
}, },
{ {
"id": 5,
"value": 0.0
"value": 0.0,
"id": 5
}, },
{ {
"id": 6,
"value": 0.0
"value": 0.0,
"id": 6
}, },
{ {
"id": 7,
"value": 0.0
"value": 0.0,
"id": 7
} }
], ],
"leftModuleId": 6,
"rightModuleId": 2,
"data": { "data": {
"lissajous": 0, "lissajous": 0,
"external": 0 "external": 0
}, },
"leftModuleId": 6,
"rightModuleId": 2,
"id": 7,
"pos": [ "pos": [
34, 34,
0 0
] ]
}, },
{ {
"id": 8,
"plugin": "Core", "plugin": "Core",
"version": "1.0.0",
"version": "2.0.0",
"model": "Notes", "model": "Notes",
"params": [], "params": [],
"leftModuleId": 1, "leftModuleId": 1,
"text": "Demo patch instructions:\n\n1. Choose an audio driver and device in the AUDIO-8 module.\n\n2. Use the QWERTY and ZXCVB rows of your keyboard to generate MIDI notes, which are converted to 1V/oct and GATE signals.\n\n3. Drag knobs up/down. Hold Ctrl (Cmd on Mac) while dragging to fine-tune. Right-click knobs to edit, or double-click to initialize.\n\n4. Drag ports to create and move cables. Stack multiple cables on outputs by holding Ctrl (Cmd on Mac) and dragging from an output.\n\n5. Right-click on an empty rack space to add new modules.",
"id": 8,
"data": {
"text": "Demo patch instructions:\n\n1. Choose an audio driver and device in the AUDIO-8 module.\n\n2. Use the QWERTY and ZXCVB rows of your keyboard to generate MIDI notes, which are converted to 1V/oct and GATE signals.\n\n3. Drag knobs up/down. Hold Ctrl (Cmd on Mac) while dragging to fine-tune. Right-click knobs to edit, or double-click to initialize.\n\n4. Drag ports to create and move cables. Stack multiple cables on outputs by holding Ctrl (Cmd on Mac) and dragging from an output.\n\n5. Right-click on an empty rack space to add new modules."
},
"pos": [ "pos": [
67, 67,
0 0
] ]
} }
], ],
"id": 29,
"cables": [ "cables": [
{ {
"id": 0,
"outputModuleId": 5, "outputModuleId": 5,
"outputId": 0, "outputId": 0,
"inputModuleId": 3, "inputModuleId": 3,
"inputId": 0, "inputId": 0,
"color": "#c91847"
"color": "#c9b70e"
}, },
{ {
"id": 1,
"outputModuleId": 3, "outputModuleId": 3,
"outputId": 2, "outputId": 2,
"inputModuleId": 4, "inputModuleId": 4,
@@ -268,41 +271,47 @@
"color": "#0c8e15" "color": "#0c8e15"
}, },
{ {
"id": 2,
"outputModuleId": 2, "outputModuleId": 2,
"outputId": 0, "outputId": 0,
"inputModuleId": 1, "inputModuleId": 1,
"inputId": 0, "inputId": 0,
"color": "#0986ad"
"color": "#c91847"
}, },
{ {
"id": 3,
"outputModuleId": 2, "outputModuleId": 2,
"outputId": 0, "outputId": 0,
"inputModuleId": 1, "inputModuleId": 1,
"inputId": 1, "inputId": 1,
"color": "#c9b70e"
"color": "#0986ad"
}, },
{ {
"id": 4,
"outputModuleId": 6, "outputModuleId": 6,
"outputId": 0, "outputId": 0,
"inputModuleId": 4, "inputModuleId": 4,
"inputId": 0, "inputId": 0,
"color": "#c91847"
"color": "#c9b70e"
}, },
{ {
"id": 5,
"outputModuleId": 5, "outputModuleId": 5,
"outputId": 1, "outputId": 1,
"inputModuleId": 6, "inputModuleId": 6,
"inputId": 4, "inputId": 4,
"color": "#c9b70e"
"color": "#0c8e15"
}, },
{ {
"id": 6,
"outputModuleId": 6, "outputModuleId": 6,
"outputId": 0, "outputId": 0,
"inputModuleId": 2, "inputModuleId": 2,
"inputId": 5, "inputId": 5,
"color": "#0c8e15"
"color": "#c91847"
}, },
{ {
"id": 7,
"outputModuleId": 4, "outputModuleId": 4,
"outputId": 0, "outputId": 0,
"inputModuleId": 2, "inputModuleId": 2,
@@ -310,6 +319,7 @@
"color": "#0986ad" "color": "#0986ad"
}, },
{ {
"id": 8,
"outputModuleId": 2, "outputModuleId": 2,
"outputId": 1, "outputId": 1,
"inputModuleId": 7, "inputModuleId": 7,
@@ -317,11 +327,12 @@
"color": "#c9b70e" "color": "#c9b70e"
}, },
{ {
"id": 9,
"outputModuleId": 5, "outputModuleId": 5,
"outputId": 6, "outputId": 6,
"inputModuleId": 6, "inputModuleId": 6,
"inputId": 5, "inputId": 5,
"color": "#c91847"
"color": "#0c8e15"
} }
] ]
} }

Loading…
Cancel
Save