multiplayer animation expressions in a grid
color and sound of each squr is computed by its assigned expression
valid values are between -1 and 1
-
git clone https://github.com/domjancik/squrs.git && cd squrs
- create a firebase app
- copy the provided config into
src/firebaseConfig.ts
(seesrc/firebaseConfig.ts.md
for reference) -
yarn install yarn start
t
- running time in seconds, aliases time
i
- index of squr (starting from 1, row by row)
x
- position of current squr x axis (starting from 1)
y
- position of current squr y axis (starting from 1)
all expressions are normlized (input 0-1, output 0-1)
x 0-1 for full cycle, output between 0-1
sin(x)
- ~ sine
'tri(x)` - /\ triangle
sqr(x, [phase])
- ┌┐ square
stp(x, ...steps)
sin(t*0.01)
- run a sine wave based on the running time multiplied by a float to control rate
sqr(stp(t/4, sin(t/2), t*2))
- a square wave with changing speeds
you can set the following parameters as part of the URL in the form of query parameters:
http://localhost:3000/squrs?store=local&resolution=1&room=squrland
store
-firebase
orlocal
, where to persist squr state. Will default tofirebase
on unknown values.room
- which "room" to store in, think of it as different save filesresolution
- how many squrs per column and row
some parameters can be set at runtime via the JavaScript developer console by running the following functions:
squrListScales()
- show available musical scalessqurSetScale(index: number)
- change the musical scale used