diff --git a/gtr.scd b/gtr.scd index 9694216..07c68bc 100644 --- a/gtr.scd +++ b/gtr.scd @@ -173,31 +173,71 @@ o = OSCdef(\test, { arg msg, time, addr, recvPort, rlow, rhigh; // ---------------------------------------------------- p = OSCdef(\keys, { arg msg, time, addr, recvPort; - - case - - // BUTTON 0 && 3 RESET/ZERO SENSORS [in firmware] - - // BUTTON 0 ----> RECORD TO BUFFER 0 - { msg[8] == 1 } { r.set( \t_trig, 1); msg.postln; } // + //msg.postln; // BUTTON 0 + 3 ----> ZERO EULER / MPU6050 + if (msg[9] == 1 && msg[10] == 1, + { " ===== EULER ZEROED! =====".postln }, + {}); + if (msg[9] == 1, + { r.set( \in, 0, \l, 0, \t_trig, 1); + " /////////// SAMPLING!".postln }, + {}); + + if (msg[10] == 1, + { + " /////////// SOOOOOOMMMEEETHIIIINNGGGG!".postln }, + {}); + + if (msg[11] == 1, + { + " /////////// ////////////////////////////!".postln }, + {}); + + if (msg[12] == 1, + { + "=========================================".postln }, + {}); + + // TOGGLE 1 ----> LOOP RECORDING MODE ON/OFF + +/* if (msg[13] == 1, + { r.set(\l, 1); "LOOPING ON".postln; }, + { r.set(\l, 0); "LOOPING OFF".postln; }); + + // TOGGLE 2 ----> OVERDUB RECORDING MODE ON/OFF + + if (msg[14] == 1, + { r.set(\overdub, 1); "OVERDUB ON".postln; }, + { r.set(\overdub, 0); "OVERDUB OFF".postln; }, + + );*/ + + +/* case + //{ msg[14] == 0} {"result".postln; msg.postln} + + // BUTTON 0 && 3 RESET/ZERO SENSORS [in firmware] + // BUTTON 0 ----> RECORD TO BUFFER 0 + { msg[9] == 1 } { r.set( \in, 0, \l, 0, \t_trig, 1); + msg.postln; msg[9].postln; "SAMPLING!".postln } + + // BUTTON 0 + 3 ----> ZERO EULER / MPU6050 // TOGGLE O ----> OVERDUB MODE ON/OFF - { msg[12] == 0 } { r.set(\overdub, 0); } - { msg[12] == 1 } { r.set(\overdub, 1); } + { msg[14] == 0 } { r.set(\overdub, 0); "OVERDUB OFF".postln; } + { msg[14] == 1 } { r.set(\overdub, 1); "OVERDUB ON".postln; } // TOGGLE 2 - { msg[14] == 0 } { ~granulator1.set(\positionmodeindex, 1 ); } - { msg[14] == 1 } { ~granulator1.set(\positionmodeindex, 2 ); } + //{ msg[13] == 0 } { ~granulator1.set(\positionmodeindex, 1 ); } + //{ msg[13] == 1 } { ~granulator1.set(\positionmodeindex, 2 ); } // TOGGLE 3 ----> LOOP RECORDING MODE ON/OFF - { msg[15] == 0 } { r.set(\l, 0); } - { msg[15] == 1 } { r.set(\l, 1); } + { msg[13] == 0 } { "LOOPING OFF".postln; r.set(\l, 0); msg[13].postln;} + { msg[13] == 1 } { "LOOPING ON! SAMPLING".postln; r.set(\l, 1); msg[13].postln; };*/ } , '/keys'); -//msg.postln; ); ); diff --git a/scratchboard/gtr-scratchboard-drawing-separatewires2.svg b/scratchboard/gtr-scratchboard-drawing-separatewires2.svg new file mode 100644 index 0000000..ec34b71 --- /dev/null +++ b/scratchboard/gtr-scratchboard-drawing-separatewires2.svg @@ -0,0 +1,191 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scratchboard/gtr-scratchboard-drawing.svg b/scratchboard/gtr-scratchboard-drawing.svg new file mode 100644 index 0000000..b18406e --- /dev/null +++ b/scratchboard/gtr-scratchboard-drawing.svg @@ -0,0 +1,154 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scratchboard/gtr-scratchboard-wires-r14.dxf b/scratchboard/gtr-scratchboard-wires-r14.dxf new file mode 100644 index 0000000..25711b6 --- /dev/null +++ b/scratchboard/gtr-scratchboard-wires-r14.dxf @@ -0,0 +1,930 @@ + 0 +SECTION + 2 +HEADER + 9 +$ACADVER + 1 +AC1014 + 9 +$HANDSEED + 5 +FFFF + 9 +$MEASUREMENT + 70 + 1 + 0 +ENDSEC + 0 +SECTION + 2 +TABLES + 0 +TABLE + 2 +VPORT + 5 +8 +330 +0 +100 +AcDbSymbolTable + 70 + 4 + 0 +VPORT + 5 +2E +330 +8 +100 +AcDbSymbolTableRecord +100 +AcDbViewportTableRecord + 2 +*ACTIVE + 70 + 0 + 10 +0.0 + 20 +0.0 + 11 +1.0 + 21 +1.0 + 12 +210.0 + 22 +148.5 + 13 +0.0 + 23 +0.0 + 14 +10.0 + 24 +10.0 + 15 +10.0 + 25 +10.0 + 16 +0.0 + 26 +0.0 + 36 +1.0 + 17 +0.0 + 27 +0.0 + 37 +0.0 + 40 +341.0 + 41 +1.24 + 42 +50.0 + 43 +0.0 + 44 +0.0 + 50 +0.0 + 51 +0.0 + 71 + 0 + 72 + 100 + 73 + 1 + 74 + 3 + 75 + 0 + 76 + 0 + 77 + 0 + 78 + 0 + 0 +ENDTAB + 0 +TABLE + 2 +LTYPE + 5 +5 +330 +0 +100 +AcDbSymbolTable + 70 + 1 + 0 +LTYPE + 5 +14 +330 +5 +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +BYBLOCK + 70 + 0 + 3 + + 72 + 65 + 73 + 0 + 40 +0.0 + 0 +LTYPE + 5 +15 +330 +5 +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +BYLAYER + 70 + 0 + 3 + + 72 + 65 + 73 + 0 + 40 +0.0 + 0 +LTYPE + 5 +16 +330 +5 +100 +AcDbSymbolTableRecord +100 +AcDbLinetypeTableRecord + 2 +CONTINUOUS + 70 + 0 + 3 +Solid line + 72 + 65 + 73 + 0 + 40 +0.0 + 0 +ENDTAB + 0 +TABLE + 2 +LAYER + 5 +2 +100 +AcDbSymbolTable + 70 +3 + 0 +LAYER + 5 +50 +100 +AcDbSymbolTableRecord +100 +AcDbLayerTableRecord + 2 +0 + 70 +0 + 6 +CONTINUOUS + 0 +LAYER + 5 +51 +100 +AcDbSymbolTableRecord +100 +AcDbLayerTableRecord + 2 +Plast_1 + 70 +0 + 6 +CONTINUOUS + 0 +LAYER + 5 +52 +100 +AcDbSymbolTableRecord +100 +AcDbLayerTableRecord + 2 +wires + 70 +0 + 6 +CONTINUOUS + 0 +ENDTAB + 0 +TABLE + 2 +STYLE + 5 +3 +330 +0 +100 +AcDbSymbolTable + 70 + 1 + 0 +STYLE + 5 +11 +330 +3 +100 +AcDbSymbolTableRecord +100 +AcDbTextStyleTableRecord + 2 +STANDARD + 70 + 0 + 40 +0.0 + 41 +1.0 + 50 +0.0 + 71 + 0 + 42 +2.5 + 3 +txt + 4 + + 0 +ENDTAB + 0 +TABLE + 2 +VIEW + 5 +6 +330 +0 +100 +AcDbSymbolTable + 70 + 0 + 0 +ENDTAB + 0 +TABLE + 2 +UCS + 5 +7 +330 +0 +100 +AcDbSymbolTable + 70 + 0 + 0 +ENDTAB + 0 +TABLE + 2 +APPID + 5 +9 +330 +0 +100 +AcDbSymbolTable + 70 + 2 + 0 +APPID + 5 +12 +330 +9 +100 +AcDbSymbolTableRecord +100 +AcDbRegAppTableRecord + 2 +ACAD + 70 + 0 + 0 +ENDTAB + 0 +TABLE + 2 +DIMSTYLE + 5 +A +330 +0 +100 +AcDbSymbolTable + 70 + 1 + 0 +DIMSTYLE +105 +27 +330 +A +100 +AcDbSymbolTableRecord +100 +AcDbDimStyleTableRecord + 2 +ISO-25 + 70 + 0 + 3 + + 4 + + 5 + + 6 + + 7 + + 40 +1.0 + 41 +2.5 + 42 +0.625 + 43 +3.75 + 44 +1.25 + 45 +0.0 + 46 +0.0 + 47 +0.0 + 48 +0.0 +140 +2.5 +141 +2.5 +142 +0.0 +143 +0.03937007874016 +144 +1.0 +145 +0.0 +146 +1.0 +147 +0.625 + 71 + 0 + 72 + 0 + 73 + 0 + 74 + 0 + 75 + 0 + 76 + 0 + 77 + 1 + 78 + 8 +170 + 0 +171 + 3 +172 + 1 +173 + 0 +174 + 0 +175 + 0 +176 + 0 +177 + 0 +178 + 0 +270 + 2 +271 + 2 +272 + 2 +273 + 2 +274 + 3 +340 +11 +275 + 0 +280 + 0 +281 + 0 +282 + 0 +283 + 0 +284 + 8 +285 + 0 +286 + 0 +287 + 3 +288 + 0 + 0 +ENDTAB + 0 +TABLE + 2 +BLOCK_RECORD + 5 +1 +330 +0 +100 +AcDbSymbolTable + 70 + 1 + 0 +BLOCK_RECORD + 5 +1F +330 +1 +100 +AcDbSymbolTableRecord +100 +AcDbBlockTableRecord + 2 +*MODEL_SPACE + 0 +BLOCK_RECORD + 5 +1B +330 +1 +100 +AcDbSymbolTableRecord +100 +AcDbBlockTableRecord + 2 +*PAPER_SPACE + 0 +ENDTAB + 0 +ENDSEC + 0 +SECTION + 2 +BLOCKS + 0 +BLOCK + 5 +20 +330 +1F +100 +AcDbEntity + 8 +0 +100 +AcDbBlockBegin + 2 +*MODEL_SPACE + 70 + 0 + 10 +0.0 + 20 +0.0 + 30 +0.0 + 3 +*MODEL_SPACE + 1 + + 0 +ENDBLK + 5 +21 +330 +1F +100 +AcDbEntity + 8 +0 +100 +AcDbBlockEnd + 0 +BLOCK + 5 +1C +330 +1B +100 +AcDbEntity + 67 + 1 + 8 +0 +100 +AcDbBlockBegin + 2 +*PAPER_SPACE + 1 + + 0 +ENDBLK + 5 +1D +330 +1B +100 +AcDbEntity + 67 + 1 + 8 +0 +100 +AcDbBlockEnd + 0 +ENDSEC + 0 +SECTION + 2 +ENTITIES + 0 +LWPOLYLINE + 5 +100 +100 +AcDbEntity + 8 +wires + 62 +7 +100 +AcDbPolyline + 90 +41 + 70 +1 + 10 +54.374975 + 20 +284.320154 + 30 +0.0 + 10 +25.775171 + 20 +260.886960 + 30 +0.0 + 10 +24.553023 + 20 +237.823769 + 30 +0.0 + 10 +24.376806 + 20 +260.361411 + 30 +0.0 + 10 +32.673975 + 20 +278.646598 + 30 +0.0 + 10 +31.490068 + 20 +279.183517 + 30 +0.0 + 10 +23.074043 + 20 +260.638914 + 30 +0.0 + 10 +23.248710 + 20 +238.446468 + 30 +0.0 + 10 +21.495845 + 20 +260.542793 + 30 +0.0 + 10 +11.322306 + 20 +281.054720 + 30 +0.0 + 10 +10.156486 + 20 +280.476461 + 30 +0.0 + 10 +20.220471 + 20 +260.191395 + 30 +0.0 + 10 +22.133016 + 20 +236.086922 + 30 +0.0 + 10 +10.757999 + 20 +255.140541 + 30 +0.0 + 10 +9.642822 + 20 +254.474432 + 30 +0.0 + 10 +21.164082 + 20 +235.173800 + 30 +0.0 + 10 +16.082222 + 20 +218.689536 + 30 +0.0 + 10 +6.686930 + 20 +212.159702 + 30 +0.0 + 10 +10.095508 + 20 +229.441335 + 30 +0.0 + 10 +8.820133 + 20 +229.693515 + 30 +0.0 + 10 +5.484420 + 20 +212.783436 + 30 +0.0 + 10 +-12.730489 + 20 +200.249835 + 30 +0.0 + 10 +-6.206856 + 20 +189.599837 + 30 +0.0 + 10 +7.241935 + 20 +199.355316 + 30 +0.0 + 10 +18.300692 + 20 +196.898617 + 30 +0.0 + 10 +18.581811 + 20 +198.167792 + 30 +0.0 + 10 +7.048665 + 20 +200.730943 + 30 +0.0 + 10 +36.552806 + 20 +221.978741 + 30 +0.0 + 10 +35.793164 + 20 +223.035008 + 30 +0.0 + 10 +23.457483 + 20 +214.150794 + 30 +0.0 + 10 +28.656131 + 20 +231.099629 + 30 +0.0 + 10 +40.517423 + 20 +249.001896 + 30 +0.0 + 10 +39.433769 + 20 +249.720716 + 30 +0.0 + 10 +27.679446 + 20 +231.978647 + 30 +0.0 + 10 +30.802770 + 20 +256.640708 + 30 +0.0 + 10 +51.044945 + 20 +264.773544 + 30 +0.0 + 10 +49.869306 + 20 +266.921733 + 30 +0.0 + 10 +28.476815 + 20 +258.419927 + 30 +0.0 + 10 +25.768453 + 20 +236.169604 + 30 +0.0 + 10 +27.042792 + 20 +260.244105 + 30 +0.0 + 10 +55.199213 + 20 +283.314531 + 30 +0.0 + 0 +ENDSEC + 0 +SECTION + 2 +OBJECTS + 0 +DICTIONARY + 5 +C +330 +0 +100 +AcDbDictionary + 3 +ACAD_GROUP +350 +D + 3 +ACAD_MLINESTYLE +350 +17 + 0 +DICTIONARY + 5 +D +330 +C +100 +AcDbDictionary + 0 +DICTIONARY + 5 +1A +330 +C +100 +AcDbDictionary + 0 +DICTIONARY + 5 +17 +330 +C +100 +AcDbDictionary + 3 +STANDARD +350 +18 + 0 +DICTIONARY + 5 +19 +330 +C +100 +AcDbDictionary + 0 +ENDSEC + 0 +EOF diff --git a/scratchboard/gtr-scratchboard.scad b/scratchboard/gtr-scratchboard.scad new file mode 100644 index 0000000..658a13e --- /dev/null +++ b/scratchboard/gtr-scratchboard.scad @@ -0,0 +1,53 @@ +$fs = 0.25; + +thickness = 3; + +wire = 1.1; + +coinh = 1.67; +coinr = 8.125; + +ledr = 2.5; + +d = 1; + +tol = 0.25; + +module coin() { + translate([0,0,thickness-1]) cylinder(h=coinh+d, r=coinr+tol); + translate([0,0,-d/2]) cylinder(h=thickness+d, r=coinr-3); +} + + + +difference() { +//translate([0,-110,0]) cube([70,110,thickness]); +scale([1,-1,1]) +linear_extrude(thickness) { + offset(r=10) { + offset(r=-10) { + polygon([[0,2],[31,8],[52,0],[64,1 + ],[68,14],[49,52],[47,81],[21,112],[7,105],[0,88]]); + } +} +} + +translate([0,-297,-1]) +linear_extrude(2.5) { +import("gtr-scratchboard-wires-r14.dxf",convexity=200); +} + +translate([10,-15,0]) coin(); +translate([10,-40,0]) coin(); +translate([10,-65,0]) coin(); + +translate([32,-19,0]) coin(); +translate([40,-48,0]) coin(); +translate([36,-75,0]) coin(); +translate([18,-99,0]) coin(); + +translate([55,-12,0]) coin(); + +translate([50,-31,-d/2]) cylinder(h=thickness+d, r=ledr+2*tol); + +} \ No newline at end of file diff --git a/scratchboard/gtr-scratchboard.stl b/scratchboard/gtr-scratchboard.stl new file mode 100644 index 0000000..c9b0cff Binary files /dev/null and b/scratchboard/gtr-scratchboard.stl differ diff --git a/wavey-wind/server.js b/wavey-wind/server.js index 7362be8..f7919bc 100644 --- a/wavey-wind/server.js +++ b/wavey-wind/server.js @@ -42,6 +42,7 @@ let switchHeld = [false, false, false, false] let switchValue = [false, false, false, false] + function openSerial() { console.log('opening ', tty, baudrate) @@ -194,21 +195,41 @@ const sendAll = (msg, info, oscWS, osclients) => { } } + var waiting = false; + + function waitFalse() { + waiting = false; + } + + + function wait4Second() { + waiting = true; + setTimeout(waitFalse, 1000); + + } + // LOGIC FOR MOMENTARY BUTTONS (0 - 3) - - for (let i = 0; i < 4; i++) { - // toggle button 2 state between 0 and 1 - if (msg.address == '/keys') { - if (msg.args[i] <= threshold ) { - buttonValue[i] = 1; - } else { - buttonValue[i] = 0; - } - msg.args.push(buttonValue[i] ? 1 : 0) - } - } + for (let i = 0; i < 4; i++) { + // momentary state between 0 and 1 console + if (msg.address == '/keys') { + buttonValue[i] = 0; + //if (waiting == false){ + if (msg.args[i] <= threshold ) { + if (buttonHeld[i] == false) { + buttonHeld[i] = true + buttonValue[i] = 1; + } + //wait4Second(); + } else if (msg.args[i] >= threshold+5) { + buttonHeld[i] = false; + } + msg.args.push(buttonValue[i] ? 1 : 0) + } + + } + // LOGIC FOR TOGGLE SWITCHES (4-7) @@ -221,6 +242,7 @@ const sendAll = (msg, info, oscWS, osclients) => { switchHeld[i-4] = true } } else { + if (switchHeld[i-4]) { switchHeld[i-4] = false } @@ -256,8 +278,10 @@ const sendAll = (msg, info, oscWS, osclients) => { }) if (scudp) { - console.log("SENDING UDP", msg) - scudp.send(msg) + console.log("SENDING UDP", msg) + scudp.send(msg) + //msg.slice(7,15); + //scudp.send(msg.slice(7,15)) } }