text: (function(t){function e(e){for(var r,s,o=e[0],u=e[1],c=e[2],f=0,p=[];f<o.length;f++)s=o[f],Object.prototype.hasOwnProperty.call(a,s)&&a[s]&&p.push(a[s][0]),a[s]=0;for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(t[r]=u[r]);l&&l(e);while(p.length)p.shift()();return i.push.apply(i,c||[]),n()}function n(){for(var t,e=0;e<i.length;e++){for(var n=i[e],r=!0,o=1;o<n.length;o++){var u=n[o];0!==a[u]&&(r=!1)}r&&(i.splice(e--,1),t=s(s.s=n[0]))}return t}var r={},a={app:0},i=[];function s(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.m=t,s.c=r,s.d=function(t,e,n){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},s.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)s.d(n,r,function(e){return t[e]}.bind(null,r));return n},s.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="/";var o=window["webpackJsonp"]=window["webpackJsonp"]||[],u=o.push.bind(o);o.push=e,o=o.slice();for(var c=0;c<o.length;c++)e(o[c]);var l=u;i.push([0,"chunk-vendors"]),n()})({0:function(t,e,n){t.exports=n("56d7")},"0d5b":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"sequencer"},[n("div",{staticClass:"controls"},[n("div",[n("label",[t._v("Steps:")]),n("input",{directives:[{name:"model",rawName:"v-model.number",value:t.steps,expression:"steps",modifiers:{number:!0}}],attrs:{type:"text"},domProps:{value:t.steps},on:{input:function(e){e.target.composing||(t.steps=t._n(e.target.value))},blur:function(e){return t.$forceUpdate()}}})]),n("div",[n("label",[t._v("Measures:")]),n("input",{directives:[{name:"model",rawName:"v-model.number",value:t.measures,expression:"measures",modifiers:{number:!0}}],attrs:{type:"text"},domProps:{value:t.measures},on:{input:function(e){e.target.composing||(t.measures=t._n(e.target.value))},blur:function(e){return t.$forceUpdate()}}})]),n("div",[n("label",[t._v("Transpose (semitones):")]),n("input",{directives:[{name:"model",rawName:"v-model.number",value:t.transpose,expression:"transpose",modifiers:{number:!0}}],attrs:{type:"text"},domProps:{value:t.transpose},on:{input:function(e){e.target.composing||(t.transpose=t._n(e.target.value))},blur:function(e){return t.$forceUpdate()}}})]),n("div",[n("label",[t._v("Velocity (%):")]),n("input",{directives:[{name:"model",rawName:"v-model.number",value:t.volume,expression:"volume",modifiers:{number:!0}}],attrs:{type:"text"},domProps:{value:t.volume},on:{input:function(e){e.target.composing||(t.volume=t._n(e.target.value))},blur:function(e){return t.$forceUpdate()}}})]),n("div",[n("label",[t._v("Synth type:")]),n("select",{directives:[{name:"model",rawName:"v-model",value:t.synth,expression:"synth"}],on:{change:function(e){var n=Array.prototype.filter.call(e.target.options,function(t){return t.selected}).map(function(t){var e="_value"in t?t._value:t.value;return e});t.synth=e.target.multiple?n:n[0]}}},[n("option",[t._v("sine")]),n("option",[t._v("sawtooth")]),n("option",[t._v("square")]),n("option",[t._v("triangle")])])]),n("div",[n("label",[t._v("Attack (seconds):")]),n("input",{directives:[{name:"model",rawName:"v-model.number",value:t.attack,expression:"attack",modifiers:{number:!0}}],attrs:{type:"text"},domProps:{value:t.attack},on:{input:function(e){e.target.composing||(t.attack=t._n(e.target.value))},blur:function(e){return t.$forceUpdate()}}})]),n("div",[n("label",[t._v("Decay (seconds):")]),n("input",{directives:[{name:"model",rawName:"v-model.number",value:t.decay,expression:"decay",modifiers:{number:!0}}],attrs:{type:"text"},domProps:{value:t.decay},on:{input:function(e){e.target.composing||(t.decay=t._n(e.target.value))},blur:function(e){return t.$forceUpdate()}}})]),n("div",[n("label",[t._v("Filter cutoff (hz):")]),n("input",{directives:[{name:"model",rawName:"v-model.number",value:t.filterCutoff,expression:"filterCutoff",modifiers:{number:!0}}],attrs:{type:"text"},domProps:{value:t.filterCutoff},on:{input:function(e){e.target.composing||(t.filterCutoff=t._n(e.target.value))},blur:function(e){return t.$forceUpdate()}}})])]),n("div",{staticClass:"boxes"},t._l(t.notes,function(e,r){return n("myLine-c",{attrs:{beats:t.steps,"current-note":t.currentStep,pitch:r,"on-notes":e},on:{"toggle-box":t.handleToggleBox}})}),1)]),n("hr")])},a=[];n.d(e,"a",function(){return r}),n.d(e,"b",function(){return a})},1544:function(t,e,n){var r,a,i=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(e in this&&this[e]===t)return e;return-1};r=n("4360").default,a=n("8cc4"),t.exports={name:"sequencer",components:{MyLineC:r},props:["time","res"],data:function(){return{notes:{C5:[],B4:[],A4:[],G4:[],F4:[],E4:[],D4:[],C4:[]},steps:16,measures:4,synth:"sine",transpose:0,filterCutoff:3e3,volume:100,attack:.01,decay:2}},computed:{currentStep:function(){var t;return t=this.measures*this.res/this.steps,Math.floor(this.time/t)%this.steps}},watch:{currentStep:function(){return this.playNextStep()},steps:function(){var t,e;for(t in e=[],this.notes)e.push(this.notes[t]=[]);return e},synth:function(t){return this.player.set({oscillator:{type:t}})},transpose:function(t){return isNaN(parseInt(t))&&(t=0),this.player.set({oscillator:{detune:100*t}})},filterCutoff:function(t){if(!isNaN(parseInt(t)))return this.filter.set({frequency:t})},volume:function(t){if(!isNaN(parseInt(t)))return this.player.set({volume:t/100})},attack:function(t){if(!isNaN(parseInt(t)))return this.player.set({envelope:{attack:t}})},decay:function(t){if(!isNaN(parseInt(t)))return this.player.set({envelope:{decay:t,release:t}})}},methods:{playNextStep:function(){var t,e,n,r,a;for(e in this,n=this.notes,a=[],n)t=n[e],r=this.currentStep,i.call(t,r)>=0?a.push(this.player.triggerAttackRelease(e,"8n","+0",this.volume/100)):a.push(void 0);return a},handleToggleBox:function(t,e){var n;return i.call(this.notes[t],e)>=0?(n=this.notes[t].indexOf(e),-1!==n?this.notes[t].splice(n,1):void 0):(this.notes[t].push(e),this.player.triggerAttackRelease(t,"8n","+0",this.volume/100))}},created:function(){var t,e;return e=new a.PolySynth(4,a.OmniSynth),e.set({oscillator:{type:this.synth,detune:100*this.transpose}}),t={envelope:{attack:this.attack,decay:this.decay,sustain:0,release:this.decay}},e.set(t),this.filter=new a.Filter(this.filterCutoff,"lowpass"),this.synthPlayer=e,e.connect(this.filter),this.filter.connect(a.Master),this.player=e,this.player.set({volume:this.volume/100})}}},"15fe":function(t,e,n){"use strict";n.r(e);var r=n("1544"),a=n.n(r);for(var i in r)"default"!==i&&function(t){n.d(e,t,function(){return r[t]})}(i);e["default"]=a.a},"255d":function(t,e,n){},"262c":function(t,e,n){"use strict";var r=n("743d"),a=n("b279"),i=(n("725c"),n("2877")),s=Object(i["a"])(a["default"],r["a"],r["b"],!1,null,null,null);e["default"]=s.exports},3296:function(t,e,n){var r,a;a=n("4360").default,r=n("810c").default,t.exports={name:"buttons",components:{MyLine:a,Sequencer:r},data:function(){return{time:-1,res:16,isPlaying:!1,sequencers:1,bpm:120}},methods:{nextTick:function(){var t,e;if(this.isPlaying)return e=6e4/(this.bpm*this.res),this.time=this.time+1,t=this,setTimeout(function(){return t.nextTick()},e);this.time=-1},togglePlay:function(){return-1===this.time?(this.isPlaying=!0,this.nextTick()):(this.time,this.isPlaying=!1)}}}},3401:function(t,e,n){"use strict";var r=n("255d"),a=n.n(r);a.a},"349c":function(t,e,n){"use strict";n.r(e);var r=n("4a63"),a=n.n(r);for(var i in r)"default"!==i&&function(t){n.d(e,t,function(){return r[t]})}(i);e["default"]=a.a},4360:function(t,e,n){"use strict";n.r(e);var r=n("6928"),a=n("349c");for(var i in a)"default"!==i&&function(t){n.d(e,t,function(){return a[t]})}(i);n("3401");var s=n("2877"),o=Object(s["a"])(a["default"],r["a"],r["b"],!1,null,null,null);e["default"]=o.exports},"4a63":function(t,e){t.exports={name:"myLine",props:["beats","currentNote","onNotes","pitch"],computed:{beatsArray:function(){var t,e,n,r,a;for(e=new Array(this.beats),a=this.onNotes,t=0,n=a.length;t<n;t++)r=a[t],r<this.beats&&(e[r]=!0);return e}},methods:{handleClick:function(t){return this.$emit("toggle-box",this.pitch,t)}}}},"56d7":function(t,e,n){"use strict";n.r(e);var r=n("2b0e"),a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-app",[n("v-app-bar",{attrs:{app:""}},[n("v-toolbar-title",{staticClass:"headline text-uppercase"},[n("span",[t._v("VueJS Sequencer")]),n("span",{staticClass:"font-weight-light",staticStyle:{padding:"100px"}},[t._v("GABBAY | SABLON | DIABI")])]),n("v-spacer"),n("v-btn",{attrs:{text:"",href:"https://github.com/raphaelgabbay/VueJS_Sequencer",target:"_blank"}},[n("span",{staticClass:"mr-2"},[t._v("Github repo")])])],1),n("v-content",[n("Buttons")],1)],1)},i=[],s=n("810c"),o=n("4360"),u=n("262c"),c={name:"App",components:{Buttons:u["default"],Sequencer:s["default"],MyLine:o["default"]},data:()=>({})},l=c,f=n("2877"),p=n("6544"),d=n.n(p),v=n("7496"),m=n("40dc"),h=n("8336"),b=n("a75b"),y=n("2fa4"),g=n("2a7f"),_=Object(f["a"])(l,a,i,!1,null,null,null),x=_.exports;d()(_,{VApp:v["a"],VAppBar:m["a"],VBtn:h["a"],VContent:b["a"],VSpacer:y["a"],VToolbarTitle:g["a"]});var w=n("f309");r["a"].use(w["a"]);var S=new w["a"]({icons:{iconfont:"mdi"}}),N=n("bc3a"),P=n.n(N),k=n("a7fe"),C=n.n(k);r["a"].config.productionTip=!1,P.a.defaults.withCredentials=!0,r["a"].use(C.a,P.a),new r["a"]({vuetify:S,render:t=>t(x)}).$mount("#app")},"5d8f":function(t,e,n){"use strict";var r=n("f6b8"),a=n.n(r);a.a},6928:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"box-container"},t._l(t.beatsArray,function(e,r){return n("div",{staticClass:"box",class:{active:e,played:r==t.currentNote},on:{click:function(e){return t.handleClick(r)}}})}),0)},a=[];n.d(e,"a",function(){return r}),n.d(e,"b",function(){return a})},"725c":function(t,e,n){"use strict";var r=n("ff63"),a=n.n(r);a.a},"743d":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"app"}},[n("h1",[t._v("Sequenc'ESIEA")]),n("div",[n("button",{on:{click:t.togglePlay}},[t._v("Play / Stop")])]),n("div",[n("button",{on:{click:function(e){t.sequencers++}}},[t._v("Add Instrument")])]),n("label",[t._v("BPM:")]),n("input",{directives:[{name:"model",rawName:"v-model.number",value:t.bpm,expression:"bpm",modifiers:{number:!0}}],attrs:{type:"text"},domProps:{value:t.bpm},on:{input:function(e){e.target.composing||(t.bpm=t._n(e.target.value))},blur:function(e){return t.$forceUpdate()}}}),n("hr"),t._l(t.sequencers,function(e){return n("sequencer",{attrs:{res:t.res,time:t.time}})})],2)},a=[];n.d(e,"a",function(){return r}),n.d(e,"b",function(){return a})},"810c":function(t,e,n){"use strict";n.r(e);var r=n("0d5b"),a=n("15fe");for(var i in a)"default"!==i&&function(t){n.d(e,t,function(){return a[t]})}(i);n("5d8f");var s=n("2877"),o=Object(s["a"])(a["default"],r["a"],r["b"],!1,null,null,null);e["default"]=o.exports},b279:function(t,e,n){"use strict";var r=n("3296"),a=n.n(r);e["default"]=a.a},f6b8:function(t,e,n){},ff63:function(t,e,n){}});
  //# sourceMappingURL=app.749c1ea9.js.map