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
| include('http://eerojohannes.com/midi/js/teoria.js') | |
| var l = console.log.bind(console) | |
| var keyboardPiano=["q","2","w","3","e","r","5","t","6","y","7","u"] | |
| var intervals=["m2","M2","m3","M3","P4","A4","P5","m6","M6","m7","M7"] | |
| l() | |
| function getNote(nr){ |
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
| Number.prototype.mod = function(n) {return ((this%n)+n)%n;}; | |
| project.currentStyle={strokeWidth:10,strokeColor:"black"}; | |
| function getCenterPt(path){ | |
| var xC=[]; | |
| var yC=[]; | |
| for(var i=0;i<path.segments.length;i++){ | |
| xC.push(path.segments[i].point.x); | |
| yC.push(path.segments[i].point.y); |
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
| include('http://eerojohannes.com/js/Tone.min.js') | |
| include('http://eerojohannes.com/js/FileSaver.min.js') | |
| //tone.js offline rendering example | |
| //load the buffer for use in the convolver | |
| var buffer = new Tone.Buffer("https://googlechrome.github.io/web-audio-samples/samples/audio/impulse-responses/chorus-feedback.wav"); | |
| Tone.loaded().then(function(){ | |
| return Tone.Offline(function(Transport){ | |
| var reverb = new Tone.Convolver(buffer).toMaster(); |
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
| /* | |
| * Easing Functions - inspired from http://gizma.com/easing/ | |
| * only considering the t value for the range [0, 1] => [0, 1] | |
| */ | |
| EasingFunctions = { | |
| // no easing, no acceleration | |
| linear: function (t) { return t }, | |
| // accelerating from zero velocity | |
| easeInSin: function (t) {return 1 + Math.sin(Math.PI / 2 * t - Math.PI / 2)}, | |
| easeOutSin : function (t) {return Math.sin(Math.PI / 2 * t)}, |
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 root="#root" | |
| var oscillatorTypes=["sine","triangle","square","sawtooth"] | |
| Nexus.Sequencer.prototype.noteScale=[] | |
| Nexus.Dial.prototype.plug=function(target){ | |
| this.on('change',function(v){ | |
| if(target._sourceType=="Oscillator"){ | |
| target.type=oscillatorTypes[Math.min(Math.max(0,Math.floor(v)),3)] |
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
| include('https://cdnjs.cloudflare.com/ajax/libs/svg.js/2.6.3/svg.min.js'); | |
| include('http://eerojohannes.com/js/svg.draggable.min.js') | |
| include('http://eerojohannes.com/js/NexusUI.js') | |
| include('https://cdnjs.cloudflare.com/ajax/libs/tone/0.12.7/Tone.min.js') | |
| $('.right_panel').prepend('<div id="root"></div>') | |
| $('<style>svg text{user-select:none;cursor:initial}.node{cursor:move}.inlet, .outlet { fill: #eee; } .inlet:hover, .outlet:hover { fill: #bbb; cursor:pointer }</style>').appendTo('body'); | |
| const letWidth=10 | |
| const letHeight=20 |
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
| //SVG.JS NEXUS UI TONE.JS WEBMIDI.JS | |
| include('https://cdnjs.cloudflare.com/ajax/libs/svg.js/2.6.3/svg.min.js'); | |
| include('http://eerojohannes.com/js/NexusUI.js') | |
| include('http://eerojohannes.com/js/svg.panzoom.min.js') | |
| include('https://cdnjs.cloudflare.com/ajax/libs/tone/0.12.7/Tone.min.js') | |
| include('http://eerojohannes.com/js/webmidi.min.js') | |
| $('.right_panel').prepend('<div id="root"></div>') | |
| $('<style>svg text{user-select:none;pointer-events:none;cursor:initial}.node{cursor:move}.inlet, .outlet { fill: #eee; } .inlet:hover, .outlet:hover { fill: #bbb; cursor:e-resize }</style>').appendTo('body'); |
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
| //SVG.JS NEXUS UI TONE.JS WEBMIDI.JS | |
| include('https://cdnjs.cloudflare.com/ajax/libs/svg.js/2.6.3/svg.min.js'); | |
| include('http://eerojohannes.com/js/NexusUI.js') | |
| include('http://eerojohannes.com/js/svg.panzoom.min.js') | |
| include('https://cdnjs.cloudflare.com/ajax/libs/tone/0.12.7/Tone.min.js') | |
| include('http://eerojohannes.com/js/webmidi.min.js') | |
| $('.right_panel').prepend('<div id="root"></div>') | |
| $('<style>svg text{user-select:none;pointer-events:none;cursor:initial}.node{cursor:move}.inlet, .outlet { opacity:0.7 } .inlet:hover, .outlet:hover { opacity:1.0; cursor:e-resize }</style>').appendTo('body'); | |
| var nodeColors={'audio':"#777777",'control':"#CCCCCC",} |
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
| const DEBUG=true; | |
| function log(item){if(typeof console != "undefined" && console.log && DEBUG){var props=[];for(var a in arguments){props.push(arguments[a])}console.log(props.join(","));}} |
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
| steps=128 | |
| radius=160 | |
| var wheel=new Group() | |
| for(var i=0;i<steps;i++){ | |
| var seg=new Path(); | |
| var circum=radius*2*Math.PI | |
| var step=circum/steps | |
| seg.add([0,0],[radius,-step/2-0.5],[radius,step/2+0.5]) |