This file contains 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
// http://cheapbotsdonequick.com/source/trymusicbotbot | |
// http://twitter.com/trymusicbotbot | |
{ | |
"origin": [ | |
"Have you ever tried #activity# while listening to #artist#?" | |
], | |
This file contains 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
// http://cheapbotsdonequick.com/source/musingbot | |
// http://twitter.com/musingbot | |
{ | |
"origin": ["#intro# the most #niceWord# #art# is #mod1# #description#", "#intro# my #bodyPart# is #tastyFood#", "is it wrong to want #art# to be more #description#?", "#intro# #existence# is just one big #foodStuff# after all"], | |
"intro": [ | |
"maybe", |
This file contains 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
// MIDI note conversion | |
// util adapted from | |
// https://github.com/sole/MIDIUtils/blob/master/src/MIDIUtils.js | |
var noteMap = {}; | |
var noteNumberMap = []; | |
var notes = [ "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" ]; | |
This file contains 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
// use webMIDI to send a pitch-bend message | |
// that oscillates like an LFO | |
// HTML code: | |
// | |
// <label for="outputSelector">select midi output</label><br> | |
// <select id="outputSelector" onchange="updatePort()"> | |
// <option value="null" selected>[none]</option> | |
// </select> | |
// <input type="button" value="play" onclick="playIt()" /> |
This file contains 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
// make a signal do what you want it to do | |
// | |
// LFO manipulation | |
// (assume the signal ranges from -1 to 1) | |
// make the value range 0-1 (no negative numbers, aka unsigned) | |
var destination = (signal + 1) / 2; | |
// adjust another number/value using the LFO signal |
This file contains 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
// snippets from @mohayonao's pure js implementation of web audio api | |
// https://github.com/mohayonao/web-audio-engine/ | |
// https://github.com/mohayonao/web-audio-engine/blob/master/build/web-audio-engine.js | |
// basic constructors | |
// audio scheduled source node | |
},{"../impl":126,"../utils":135}],31:[function(require,module,exports){ |
This file contains 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
// @mkontogiannis's euclidean rhythm calculator | |
// https://github.com/mkontogiannis/euclidean-rhythms | |
// | |
// specifically grok'd from this version: | |
// https://unpkg.com/[email protected]/dist/bundle.umd.js | |
// | |
// see also: | |
// http://cgm.cs.mcgill.ca/~godfried/publications/banff.pdf | |
// http://www.atonalmicroshores.com/2014/03/bjorklund-py/ | |
// |
This file contains 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
// | |
// choose an input, listen to it; (Chrome only; no iOS) | |
// | |
// | |
// HTML component: | |
//<label for="inputSelector">select midi input</label><br> | |
//<select id="inputSelector" onchange="updateInputPort()"> | |
// <option value="null" selected>[none]</option> | |
//</select> |
This file contains 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
// | |
// Chrome only; no iOS | |
// | |
// Initialize WebMidi; create dropdown selector for output port | |
// | |
// HTML component: | |
// <label for="outputSelector">select midi output</label><br> |
This file contains 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
// basic minimum initialization | |
window.AudioContext = window.AudioContext || window.webkitAudioContext; | |
var audioContext = new AudioContext(); | |
// set latency hint | |
if ("latencyHint" in audioContext) { | |
audioContext.latencyHint = "playback"; | |
}; |
NewerOlder