This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require('cheatcode') | |
| specialX = function(t){ | |
| t *= 72 / 60 / 2 / 2 | |
| t = t * 10 % 12 % t | |
| var a = amod(.25, .125, t, 1/6) | |
| return 0 | |
| + oz.sine(t, 120 + oz.triangle(t, amod(0, .1, t, 1/2) * oz.triangle(t, 2))) * a | |
| + oz.sine(t, 360 + (amod(0, .1, t, 1/3) * oz.triangle(t, 3))) * a | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require('cheatcode') | |
| specialX = function(t){ | |
| t *= 72 / 60 / 2 / 2 | |
| t = t * 10 % 12 % t | |
| var a = amod(.25, .25, t, -1/12) | |
| return 0 | |
| + oz.sine(t, 120 + oz.triangle(t, amod(0, .1, t, 1/2) * oz.triangle(t, 2))) * a | |
| + oz.sine(t, 360 + (amod(0, .1, t, 1/3) * oz.triangle(t, 3))) * a | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require('cheatcode') | |
| bpm = 74 | |
| timer=sync(bpm, master.sampleRate) | |
| t2 = timer.beat(1/4, [,1,,1,], function(_t, b){ | |
| var attack = [[0,0], [0,1], [0,0], [0,1], [1,.667]] | |
| var release = [[0,.667], [-3,0], [1, 0]] | |
| var y = b % 2 == 1 ? 2 : 1/2 | |
| var durations = [60 / bpm / 56, bpm / 60 * 1/8]//, bpm / 60 * y ] | |
| var opts = {} | |
| opts.c = Math.sqrt(2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require('cheatcode') | |
| bpm = 74 | |
| timer = sync(bpm, master.sampleRate) | |
| t2 = timer.beat(1/2, [,1,,1], function(_t, b){ | |
| var attack = [[0,0], [0,1], [0,0], [0,1], [1,.667]] | |
| var release = [[0,.667], [2,0], [1, 0]] | |
| var y = b % 2 == 1 ? 2 : 1/2 | |
| var durations = [60 / bpm / 6, bpm / 60 * 1/8] | |
| var opts = {} | |
| opts.c = Math.sqrt(2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| allDiffs = store.getAll() | |
| aDiffs = store.get('1427230082405_diffs') | |
| console.log(aDiffs, getDiffByIndex(aDiffs.length - 1)) | |
| function getDiffByIndex(index){ | |
| var str = ''; | |
| for(var x = 0; x < index; x++) { | |
| str = diff.applyPatch(str, aDiffs[x].diff) | |
| } | |
| return str | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require('cheatcode') | |
| _sync = require('jsynth-sync') | |
| //synth.connect(master.destination) | |
| notes = teoria.note('f#6').scale('mixolydian').notes() | |
| bpm = 36 | |
| timer = _sync(bpm, master.sampleRate) | |
| // uncomment after first edit, to stop previous | |
| //t0.emit('stop') | |
| t0 = timer.on(1/12, function(ti, b, off, swing){ | |
| if(b % 2 === 0){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var asynth = require('../'); | |
| var jynth = require('jynth'); | |
| var synth = jynth(); | |
| var recording = true; | |
| var playing = true; | |
| var samples = []; | |
| process.stdin.setRawMode(true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Buffer = require('buffer').Buffer | |
| var str = 'a string is the thing' | |
| var x = Buffer(str) | |
| document.body.innerText += (x.toString() + '\n') | |
| var ab = x.toArrayBuffer() | |
| var y = Buffer._augment(new Uint8Array(ab)) | |
| document.body.innerText += (y.toString()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| master = new AudioContext | |
| jsynth = require('jsynth') | |
| nvelope = require('nvelope') | |
| jigger = require('jigger') | |
| generator = new jigger() | |
| oscillators = require('oscillators'); | |
| sync = require('jsynth-zerone') // jsynth-zerone | |
| bpm = 72 | |
| f = 399 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var master = new webkitAudioContext(); | |
| var jsynth = require('jsynth') | |
| , tau = Math.PI * 2 | |
| , frequency = 555 | |
| ; | |
| var sineGenerator = function (time, index, input){ | |
| return Math.sin(time * tau * frequency) | |
| } |