Skip to content

Commit

Permalink
fix for seed.versio.json
Browse files Browse the repository at this point in the history
  • Loading branch information
grrrwaaa committed Jul 26, 2021
1 parent f13a0cf commit f61cd21
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 4 deletions.
4 changes: 2 additions & 2 deletions source/oopsy.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ const component_defs = {
Switch3: {
typename: "daisy::Switch3",
pin: "a,b",
updaterate: "${name}.SetUpdateRate(seed.AudioCallbackRate());",
mapping: [
{ name: "${name}", get: "(hardware.${name}.Read()*0.5f+0.5f)", range: [0, 2] }
]
Expand Down Expand Up @@ -333,7 +332,8 @@ struct Daisy {
${e.name}.Init(seed.GetPin(${e.pin.a}), seed.GetPin(${e.pin.b}));`
).join("")}
${components.filter((e) => e.typename == "daisy::GateIn").map((e, i) => `
${e.name}.Init(seed.GetPin(${e.pin}));`
dsy_gpio_pin ${e.name}_pin = seed.GetPin(${e.pin});
${e.name}.Init(&${e.name}_pin);`
).join("")}
${components.filter((e) => e.typename == "daisy::Encoder").map((e, i) => `
${e.name}.Init(seed.GetPin(${e.pin.a}), seed.GetPin(${e.pin.b}), seed.GetPin(${e.pin.click}), seed.AudioCallbackRate());`
Expand Down
98 changes: 98 additions & 0 deletions source/seed.versio.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"name":"versio",
"defines": {},
"components": {
"knob1": {
"component": "AnalogControl",
"pin": 21
},
"knob2": {
"component": "AnalogControl",
"pin": 22
},
"knob3": {
"component": "AnalogControl",
"pin": 28
},
"knob4": {
"component": "AnalogControl",
"pin": 23
},
"knob5": {
"component": "AnalogControl",
"pin": 16
},
"knob6": {
"component": "AnalogControl",
"pin": 17
},
"knob7": {
"component": "AnalogControl",
"pin": 19
},

"button1": {
"component": "Switch",
"pin": 30
},
"gate1": {
"component": "GateIn",
"pin": 24
},
"sw1": {
"component": "Switch3",
"pin": {"a":6, "b":5 }
},
"sw2": {
"component": "Switch3",
"pin": {"a":1, "b":0 }
},
"led1": {
"component": "RgbLed",
"pin": {"r":10, "g":3, "b":4 }
},
"led2": {
"component": "RgbLed",
"pin": {"r":12, "g":13, "b":11 }
},
"led3": {
"component": "RgbLed",
"pin": {"r":25, "g":26, "b":14 }
},
"led4": {
"component": "RgbLed",
"pin": {"r":29, "g":27, "b":15 }
}
},
"aliases": {
"switch1": "sw1",
"switch2": "sw2",

"ctrl1": "knob1",
"ctrl2": "knob2",
"ctrl3": "knob3",
"ctrl4": "knob4",
"ctrl5": "knob5",
"ctrl6": "knob6",
"ctrl7": "knob7",
"cv1": "knob1",
"cv2": "knob2",
"cv3": "knob3",
"cv4": "knob4",
"cv5": "knob5",
"cv6": "knob6",
"cv7": "knob7",

"ctrl": "knob1",
"cv": "knob1",
"led": "led1",
"gate": "gate1",
"switch": "sw1",
"knob": "knob1",
"button": "button1",
"tap": "button1",
"fsu": "button1",
"abc": "sw1",
"xyz": "sw2"
}
}
4 changes: 2 additions & 2 deletions source/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ node oopsy.js writejson ../templates/oopsy_field.cpp field && \
node oopsy.js writejson ../templates/oopsy_petal.cpp petal && \
node oopsy.js writejson ../templates/oopsy_pod.cpp pod && \
node oopsy.js writejson ../templates/oopsy_versio.cpp versio && \
node oopsy.js writejson ../templates/oopsy_pod.cpp seed.pod.json \
echo OK
node oopsy.js writejson ../templates/oopsy_pod.cpp seed.pod.json && \
node oopsy.js writejson ../templates/oopsy_versio.cpp seed.versio.json

0 comments on commit f61cd21

Please sign in to comment.