Skip to content

Instantly share code, notes, and snippets.

View jahpd's full-sized avatar

Guilherme M Lunhani jahpd

View GitHub Profile
[
{
ciphers: " CM M Cmaj",
set: [0,4,7]
},
{
ciphers: "Cm C- Cmin",
set: [0,3,7]
},
{
service =
Login: (appIdentifier, user) ->
$q (resolve, reject) ->
success = (response) ->
console.log $http.defaults.headers
resolve response
error = (e) ->
console.log $http.defaults.headers
reject e
headers = $http.defaults.headers.common
# A global variable
sound = {}
# Like processing
# we can setup the things
@setup = ->
sound.freq = [Math.random() * 22, 22+Math.random() * 220]
sound.offset = [Math.random(), Math.random()]
# tau ant t are preloaded variables,
max = 880
min = 16
senos = []
@setup = ->
senos.push({c:min+(Math.random()*max),a:Math.random(),m: Math.random()*1000}) for i in [0..3]
@dsp = ->
modL = sin senos[1].m, senos[1].a
modR = sin senos[3].m, senos[3].a
class Mbezier
constructor: ->
this['points'] = {x:{val:[]},y:{val:[]}}
this['colors'] = {r:{val:0},g:{val:0},b:{val:0},a:{val:0}}
n = 100;
o = [];
@setup = ->
@createCanvas 480, 360
_pos = []
@setup = ->
@createCanvas 480, 360
@frameRate 0.5
_pos = if i is 0 then @random 480 else @random 255 for i in [0,1]
@draw = ->
for i in [0..19]
colors = @random 255 for i in [0..3]
n = 19
a = {x:[],y:[]} for i in [0..n-1]
update = (a, fn) ->
for _n in [0..a.length-1]
for key,val of a[_n]
fn(_n,key,val)
@text a[_n], 10, (_n+1)*(n/@width)
callback = (n, k, v) ->
class Mbezier
constructor: ->
update: (fn) ->
for param in ['points', 'colors']
if not this[param] then this[param] = {}
if param is 'points' then k = 'xy'
if param is 'colors' then k = 'rgba'
for c in k.split('')
this[param][c] = fn(param, c)