Browse Source

post graduation update of git repo. New javascript for unfinished game controller interface, some utilities, and a jack setup for gig.

master
suroh 2 years ago
parent
commit
937c8a4551
5 changed files with 1615 additions and 0 deletions
  1. +141
    -0
      jackPatchConf/VARIA.xml
  2. +91
    -0
      nodeJS/performer/public/js/Points.js
  3. +30
    -0
      nodeJS/performer/public/js/Sequr.js
  4. +1320
    -0
      pureData/GRAD_Improviser.pd
  5. +33
    -0
      pureData/speakerTest.pd

+ 141
- 0
jackPatchConf/VARIA.xml View File

@ -0,0 +1,141 @@
<!DOCTYPE patchbay>
<patchbay name="VARIA" version="0.5.2">
<output-sockets>
<socket name="system" exclusive="off" client="system" type="jack-audio">
<plug>capture_1</plug>
<plug>capture_2</plug>
<plug>capture_3</plug>
<plug>capture_4</plug>
<plug>capture_5</plug>
<plug>capture_6</plug>
<plug>capture_7</plug>
<plug>capture_8</plug>
<plug>capture_9</plug>
<plug>capture_10</plug>
<plug>capture_11</plug>
<plug>capture_12</plug>
<plug>capture_13</plug>
<plug>capture_14</plug>
<plug>capture_15</plug>
<plug>capture_16</plug>
<plug>capture_17</plug>
<plug>capture_18</plug>
<plug>capture_19</plug>
<plug>capture_20</plug>
<plug>capture_21</plug>
<plug>capture_22</plug>
<plug>capture_23</plug>
<plug>capture_24</plug>
</socket>
<socket name="pure_data" exclusive="off" client="pure_data" type="jack-audio">
<plug>output0</plug>
<plug>output1</plug>
<plug>output2</plug>
<plug>output3</plug>
<plug>output4</plug>
<plug>output5</plug>
<plug>output6</plug>
<plug>output7</plug>
<plug>output8</plug>
<plug>output9</plug>
</socket>
<socket name="system 2" exclusive="off" client="system" type="jack-audio">
<plug>capture_1</plug>
<plug>capture_5</plug>
<plug>capture_6</plug>
<plug>capture_7</plug>
<plug>capture_8</plug>
</socket>
<socket name="Midi Through" exclusive="off" client="Midi Through" type="alsa-midi">
<plug>Midi Through Port-0</plug>
</socket>
<socket name="Suovb" exclusive="off" client="Suovb" type="alsa-midi">
<plug>Suovb MIDI 1</plug>
</socket>
<socket name="CVpal" exclusive="off" client="CVpal" type="alsa-midi">
<plug>CVpal MIDI 1</plug>
</socket>
<socket name="OP-1 Midi Device" exclusive="off" client="OP-1 Midi Device" type="alsa-midi">
<plug>OP-1 Midi Device MIDI 1</plug>
</socket>
<socket name="Pure Data" exclusive="off" client="Pure Data" type="alsa-midi">
<plug>Pure Data Midi-Out 1</plug>
<plug>Pure Data Midi-Out 2</plug>
<plug>Pure Data Midi-Out 3</plug>
<plug>Pure Data Midi-Out 4</plug>
<plug>Pure Data Midi-Out 5</plug>
<plug>Pure Data Midi-Out 6</plug>
<plug>Pure Data Midi-Out 7</plug>
<plug>Pure Data Midi-Out 8</plug>
</socket>
<socket name="Pure Data 2" exclusive="off" client="Pure Data" type="alsa-midi">
<plug>Pure Data Midi-Out 2</plug>
</socket>
</output-sockets>
<input-sockets>
<socket name="system" exclusive="off" client="system" type="jack-audio">
<plug>playback_1</plug>
<plug>playback_2</plug>
<plug>playback_3</plug>
<plug>playback_4</plug>
<plug>playback_5</plug>
<plug>playback_6</plug>
<plug>playback_7</plug>
<plug>playback_8</plug>
<plug>playback_9</plug>
<plug>playback_10</plug>
<plug>playback_11</plug>
<plug>playback_12</plug>
<plug>playback_13</plug>
<plug>playback_14</plug>
<plug>playback_15</plug>
<plug>playback_16</plug>
<plug>playback_17</plug>
<plug>playback_18</plug>
<plug>playback_19</plug>
<plug>playback_20</plug>
<plug>playback_21</plug>
<plug>playback_22</plug>
<plug>playback_23</plug>
<plug>playback_24</plug>
</socket>
<socket name="pure_data" exclusive="off" client="pure_data" type="jack-audio">
<plug>input0</plug>
<plug>input1</plug>
<plug>input2</plug>
<plug>input3</plug>
<plug>input4</plug>
</socket>
<socket name="Midi Through" exclusive="off" client="Midi Through" type="alsa-midi">
<plug>Midi Through Port-0</plug>
</socket>
<socket name="Suovb" exclusive="off" client="Suovb" type="alsa-midi">
<plug>Suovb MIDI 1</plug>
</socket>
<socket name="CVpal" exclusive="off" client="CVpal" type="alsa-midi">
<plug>CVpal MIDI 1</plug>
</socket>
<socket name="OP-1 Midi Device" exclusive="off" client="OP-1 Midi Device" type="alsa-midi">
<plug>OP-1 Midi Device MIDI 1</plug>
</socket>
<socket name="Pure Data" exclusive="off" client="Pure Data" type="alsa-midi">
<plug>Pure Data Midi-In 1</plug>
<plug>Pure Data Midi-In 2</plug>
<plug>Pure Data Midi-In 3</plug>
<plug>Pure Data Midi-In 4</plug>
<plug>Pure Data Midi-In 5</plug>
<plug>Pure Data Midi-In 6</plug>
<plug>Pure Data Midi-In 7</plug>
<plug>Pure Data Midi-In 8</plug>
</socket>
</input-sockets>
<slots/>
<cables>
<cable output="pure_data" type="jack-audio" input="system"/>
<cable output="system 2" type="jack-audio" input="pure_data"/>
<cable output="Suovb" type="alsa-midi" input="Pure Data"/>
<cable output="Pure Data" type="alsa-midi" input="CVpal"/>
<cable output="Pure Data 2" type="alsa-midi" input="OP-1 Midi Device"/>
</cables>
</patchbay>

+ 91
- 0
nodeJS/performer/public/js/Points.js View File

@ -0,0 +1,91 @@
class Points {
constructor(_ctx, _x, _y, _v, _cr, _cg, _cb, _ca) {
// canvas Context
this.ctx = _ctx
// points
this.x = _x
this.y = _y
this.target = { x: this.x, y: this.y }
// colour
this.cr = _cr
this.cg = _cg
this.cb = _cb
this.ca = _ca
this.distance = (a, b) => {
const dx = a.x - b.x
const dy = a.y - b.y
return { dist: Math.hypot(dx, dy), x: dx, y: dy }
}
}
// static distance function
static distance(a, b) {
const dx = a.x - b.x
const dy = a.y - b.y
return Math.hypot(dx, dy)
}
static closest(m, points) {
let distArray = []
for (let p in points) {
distArray[p] = this.distance(m, points[p]).dist
}
let index = 0
let value = distArray[0]
for (let d in distArray) {
if (distArray[d] < value) {
value = distArray[d]
index = d
}
}
return index
}
// Static draw lines between points
static drawLines(ctx, points) {
if (points.length > 1) {
ctx.beginPath()
for (p in points) {
if (p == 0){
ctx.lineTo(points[p].x, points[p].y)
} else {
ctx.lineTo(points[p].x, points[p].y)
}
}
ctx.closePath()
ctx.lineWidth = 1
ctx.stroke()
ctx.fill()
}
}
// Draw points on screen
draw() {
this.ctx.fillStyle = this.color
this.ctx.fillRect(this.x - 2.5, this.y - 2.5, 5, 5)
this.ctx.save()
}
// Updates points to new location
update() {
if (this.target.x != this.x || this.target.y != this.y) {
var dist = this.distance(this.target, { x: this.x, y: this.y })
var easing = 0.05
if(Math.abs(dist.x) > 1) {
this.x += dist.x * easing
}
if(Math.abs(dist.y) > 1) {
this.y += dist.y * easing
}
}
}
}

+ 30
- 0
nodeJS/performer/public/js/Sequr.js View File

@ -0,0 +1,30 @@
class Sequr extends Points {
constructor(_ctx, _x, _y, _v, _cr, _cg, _cb, _ca) {
super(_ctx, _x, _y, _v, _cr, _cg, _cb, _ca)
this.note = new Synth(this.ctx, this.x, this.y)
}
update() {
super.update()
if (this.target.x != this.note.x || this.target.y != this.note.y) {
var dist = this.distance(this.target, { x: this.note.x, y: this.note.y })
var easing = 0.05
if(Math.abs(dist.x) > 1) {
this.note.x += dist.x * easing
}
if(Math.abs(dist.y) > 1) {
this.note.y += dist.y * easing
}
}
}
draw() {
super.draw()
this.note.update()
}
stop() {
this.note.stop()
}
}

+ 1320
- 0
pureData/GRAD_Improviser.pd
File diff suppressed because it is too large
View File


+ 33
- 0
pureData/speakerTest.pd View File

@ -0,0 +1,33 @@
#N canvas 657 244 680 570 10;
#X obj 256 375 dac~ 1 2 5 6;
#X obj 256 236 noise~;
#X obj 320 144 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 320 92 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X obj 320 120 metro 3000;
#X obj 320 233 sel 0 1 2 3;
#X obj 347 164 + 1;
#X obj 320 164 f;
#X obj 320 186 mod 4;
#X floatatom 320 208 5 0 0 0 - - -, f 5;
#X obj 320 263 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 339 263 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 358 263 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 377 263 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X connect 2 0 7 0;
#X connect 3 0 4 0;
#X connect 4 0 2 0;
#X connect 5 0 10 0;
#X connect 5 1 11 0;
#X connect 5 2 12 0;
#X connect 5 3 13 0;
#X connect 6 0 7 1;
#X connect 7 0 6 0;
#X connect 7 0 8 0;
#X connect 8 0 9 0;
#X connect 9 0 5 0;

Loading…
Cancel
Save