Skip to content

Instantly share code, notes, and snippets.

View charlieroberts's full-sized avatar

charlie roberts charlieroberts

View GitHub Profile
@charlieroberts
charlieroberts / intro.js
Created February 26, 2012 20:34
Intro code snippet for Gibber
d = Drums("xoxo", _4); // x = kick, o = snare, quarter note (_4) gets the beat
s = Synth(); // create an oscillator accepting note messages
s.fx.add( Reverb() ); // add Reverb to our synth
s.note("A#4"); // test synth by telling it to play a note
a = Arp("C2m7", _4); // arpeggiate a C minor 7 chord with quarter notes
a.slave(s); // control the synth with our arpeggiator
@charlieroberts
charlieroberts / intro2.js
Created February 26, 2012 20:47
new intro for Gibber
d = Drums("xoxo", _4); // x = kick, o = snare, quarter note (_4) gets the beat
s = Synth(); // create an oscillator accepting note messages
s.fx.add( Reverb() ); // add Reverb to our synth
s.note("A#4"); // test synth by telling it to play a note
a = Arp("C2m7", _4); // arpeggiate a C minor 7 chord with quarter notes
a.slave(s); // control the synth with our arpeggiator
@charlieroberts
charlieroberts / seq.js
Created February 26, 2012 23:16
Using the Seq object in Gibber
s = Synth(); // create a synth
// sequence a four note phrase
seq = Seq(["A4", "B4", "C4", "C#4"], _4);
// tell the sequencer to control the synth. Using introspection,
// the sequencer knows it should call the note method of the
// synth
seq.slave(s);
@charlieroberts
charlieroberts / gibber_vibrato.js
Created February 27, 2012 01:05
Gibber variable rate vibrato example
s = Sine(440, .2);
lfo = LFO(8,10);
s.mod("freq", lfo, "+");
lfo.mod("mix", LFO(.05, 10), "*");
@charlieroberts
charlieroberts / gibber_fx.js
Created February 27, 2012 02:44
Effects in Gibber
s = Synth();
seq = Seq(["A4", "D4", "E4", "B4"], _4);
seq.slave(s);
// add one or many fx at the same time
s.fx.add( Trunc(5) );
s.fx.add( Delay(_16), Reverb() );
// remove a named effect
s.fx.remove("Trunc");
@charlieroberts
charlieroberts / jscsConfig.js
Created June 27, 2015 21:01
style rules for use with jscs
{
"esnext": true,
"maximumLineLength": null,
"disallowTrailingWhitespace": null,
"requireSpacesInsideParentheses": {
"all": true,
"except": [ "{", "}" ]
},
"disallowSemicolons": true,
"validateQuoteMarks": { "mark": "'", "escape": true },
let a = d => d * 4
const test13 = 'TESTING ! 2 3'
let e = [1,2,3]
let f = e.map( v => v * 2 )
let test = {
a : 'me',
window.max.outlet( 1 )
<html>
<body></body>
<script>window.max.outlet( 1 )</script>
</html>
<!--
This file demonstrates how to create an audiocontext and AudioWorklet node to use with genish.js.
If AudioWorklet is unavailable (for example, in Safari) a ScriptProcessor node will be used.
Most of the code consists of setup; the synthesis (a FM synthesized gong) is only six lines of code.
-->
<!doctype html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<title>genish.js AudioWorklet FM demo</title>