README update, supercollider test, parameter tweaking

rob
Jurij Podgoršek 2021-08-22 01:12:47 +02:00
parent 62b1a077a2
commit 48ec368264
4 changed files with 60 additions and 7 deletions

12
README.org 100644
View File

@ -0,0 +1,12 @@
#+TITLE: wavey wind
OSC controlled visual (used with motion controller)
Also see https://git.kompot.si/g1smo/pifcamp-2021
* older prototypes
- https://kreten.si/spin/
- https://kreten.si/spin-color/
- https://kreten.si/spin-upgrade/
- https://kreten.si/spin-space/
- https://vis.kreten.si/ / https://vis.kreten.si/ctl

10
anim.js
View File

@ -5,7 +5,7 @@ console.log("Hello, Sky!");
************/
// Odmik kamere
var odmik_kamere = 100;
var odmik_kamere = 80;
// Rotacija kamere
var cam_rot_offset = 1;
@ -17,7 +17,7 @@ var FOV = 90;
var width = 6;
// Limit stevila objektov
var obj_limit = 600;
var obj_limit = 1000;
// Prvotno prazno polje objektov. Lahko bi kak buffer to bil pozneje
var objekti = [];
@ -39,10 +39,10 @@ var rotacijaY = 0;
var rotacijaZ = 0;
// Premik obstojecih barv
var zamikBarve = 1;
var zamikBarve = 0.01;
// Zamik pri novem objektu
var barva_mod = 0.333;
var barva_mod = 0.003;
var saturacija = 1;
var svetlost = 0.4;
@ -210,7 +210,7 @@ oscCallbacks = {
if (keysPressed[1]) {
kameraX += gyro[0] - gx
FOV += (gyro[1] - gy) * 10
FOV *= 1 + (gy - gyro[1])
//kameraY += gyro[1] - gy
//kameraZ += gyro[2] - gz
}

28
scosc.scd 100644
View File

@ -0,0 +1,28 @@
s.boot();
~gX = 0;
(
SynthDef.new(\gen, {
var signal, env;
env=EnvGen.ar(
Env([0,1,0],[0.001,0.2],-1),
Dust.kr([0.75,1])
);
signal=SinOsc.ar(300 * ~gX,0,*0.6*env);
Out.ar(0,signal);
}).add;
)
Synth.new(\gen);
// Receiver function
(
o = OSCFunc({
arg msg, time, addr, recvPort;
//[msg, time, addr, recvPort].postln;
~gX = msg[1];
~gX.postln;
}, '/gyro/', n);
)
o.free
// Get port
NetAddr.langPort;

View File

@ -33,8 +33,8 @@ function openSerial() {
})
scon.open()
scon.on('open', e => {
console.log('scon opened', e)
console.log(scon)
console.log('serial connection opened')
//console.log(scon)
})
scon.on('error', e => {
console.error('tty error', e)
@ -94,6 +94,15 @@ server.listen(port, () => console.log('listening on *:' + port))
// Websocket init
const wss = new WebSocket.Server({ server })
const scudp = new osc.UDPPort({
remoteAddr: '127.0.0.1',
remotePort: 57120
})
scudp.on('open', () => {
console.log("UDP to OSC open")
})
scudp.open()
const sendAll = (msg, info, oscWS, osclients) => {
osclients.forEach( client => {
if (client && oscWS != client) {
@ -101,6 +110,10 @@ const sendAll = (msg, info, oscWS, osclients) => {
client.send(msg)
}
})
if (scudp) {
scudp.send(msg)
}
}
const osclients = []