From a4b63c865762ad29cc4e0ac916e9ff2260dc00be Mon Sep 17 00:00:00 2001 From: fillotassi Date: Sun, 9 Sep 2018 23:59:01 +0200 Subject: [PATCH] Improve model view and add BPM --- assets/img/gadgety-favicon.png | Bin 0 -> 472 bytes assets/img/gadgety-favicon.svg | 10449 ++++++++++++++++++++++++++++++ assets/js/moduleData.json | 2 + assets/js/moduleDataPUVIO.json | 44 + components/beat.vue | 37 +- components/beatInfiniteLoop.vue | 101 + components/sendButton.vue | 18 + components/sequencer.vue | 44 +- components/sequencerDivided.vue | 2 +- espify.sh | 52 + gadgetyClement.tar | Bin 225280 -> 0 bytes nuxt.config.js | 9 +- pages/index.vue | 61 +- static/favicon.ico | Bin 1150 -> 1150 bytes 14 files changed, 10762 insertions(+), 57 deletions(-) create mode 100644 assets/img/gadgety-favicon.png create mode 100644 assets/img/gadgety-favicon.svg create mode 100644 assets/js/moduleData.json create mode 100644 assets/js/moduleDataPUVIO.json create mode 100644 components/beatInfiniteLoop.vue create mode 100644 components/sendButton.vue create mode 100755 espify.sh delete mode 100644 gadgetyClement.tar diff --git a/assets/img/gadgety-favicon.png b/assets/img/gadgety-favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..fb568ad1ce8ae8fe481f5195cf54e950bf1b1bd2 GIT binary patch literal 472 zcmV;}0Vn>6P)^J}b>^K2&E6O+k000McNliru;t2^02O;P^RH^^~0cA-< zK~y-)m6I_~!cY{2zgJmQ0-@T%T3FDyIS?loV%+TJA5aq=oF&eNpJ2pa;8qg{V_X~^ zT!lr-Xj@Z)DRxonK-v_o1!op^1%5DM$1Z0COe&bv#cm}jT-9O>7u8<>_mJp)Ow7T(l5b|}?u=p8$eGfA+Pnn8%|TJ2Zr zw~vovYKQ>cr)Dthf3R3sh_sNG*BfG{HHL?W{f`Mg(>pjiG7<~_(kCpnJvT6H6M)_R zU8G+XwgAvojg_n{5*swTPk~`~v5k9%otN + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/js/moduleData.json b/assets/js/moduleData.json new file mode 100644 index 0000000..2c63c08 --- /dev/null +++ b/assets/js/moduleData.json @@ -0,0 +1,2 @@ +{ +} diff --git a/assets/js/moduleDataPUVIO.json b/assets/js/moduleDataPUVIO.json new file mode 100644 index 0000000..1102925 --- /dev/null +++ b/assets/js/moduleDataPUVIO.json @@ -0,0 +1,44 @@ +{ + "lines": [ + { + "lines_1": [ + { + "beats": [ + { + "beats_1": [ + { + "subdivisions": [ + { + "name": "suddivisions_1", + "offset": "12345" + }, + { + "name": "suddivisions_2", + "offset": "6789" + } + ] + } + ] + }, + { + "beats_2": [ + { + "subdivisions": [ + { + "name": "suddivisions_1", + "offset": "12345" + }, + { + "name": "suddivisions_2", + "offset": "6789" + } + ] + } + ] + } + ] + } + ] + } + ] +} diff --git a/components/beat.vue b/components/beat.vue index da6ee87..3a0c6e2 100644 --- a/components/beat.vue +++ b/components/beat.vue @@ -3,12 +3,10 @@
-
-
{{randomColori()}}
-
+
+
-
diff --git a/components/sendButton.vue b/components/sendButton.vue new file mode 100644 index 0000000..c5a0789 --- /dev/null +++ b/components/sendButton.vue @@ -0,0 +1,18 @@ + + + diff --git a/components/sequencer.vue b/components/sequencer.vue index d532631..ea948f2 100644 --- a/components/sequencer.vue +++ b/components/sequencer.vue @@ -1,26 +1,18 @@ @@ -32,13 +24,17 @@ import beat from '~/components/beat.vue' export default { + props: [ 'line' ], data() { - return{ - slotSlider: 16, - pulseSlider: 3, - euclideanList:[], - controlIsDisplayed:false - } + // return { + // id: line.id, + // slotSlider: line.slotSlider, + // pulseSlider: line.pulseSlider, + // euclideanList: line.euclideanList, + // controlIsDisplayed: line.controlIsDisplayed + // }; + this.line.euclideanList = this.bjorklund(this.line.slotSlider, this.line.pulseSlider); + return this.line; }, components: { RangeSlider, @@ -86,7 +82,6 @@ return pattern.reverse();}, assignEuclidean: function (a,b) { this.euclideanList = this.bjorklund(a,b); - console.log(this.euclideanList); } } } @@ -140,6 +135,13 @@ display:flex !important; } +.sequencerLine{ + display:flex; + height:3em; + width:auto; + background-color:firebrick; +} + .slot-wrapper{ display:flex; height:3em; diff --git a/components/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PLES`;R*F4?k4)S3f^|vt4`h$Lgy|(WyVPXc?jkF$i?Q z-T!9b%mbfDXlLi;_U~_ZcFLE|=cGiyrqyeso{=i1e7wB+RJ4p2R=~9Ad}Cb7KS~Ue zm=E5{B6MP;4joV=>Mw@-jCS&)p5`(ze{VoP;$QwF{d~tM|3|v`mMebpKK@Mq?E&n6 gG5+P}>pxfE=L-B>fuAeza|M2`z|R%<-?jq(AArf+oB#j- diff --git a/nuxt.config.js b/nuxt.config.js index b6d4972..b847ae1 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -21,6 +21,14 @@ module.exports = { ** Build configuration */ build: { + filenames: { + css: 'common.css', + manifest: 'manifest.js', + vendor: 'common.js', + app: 'app.js', + chunk: '[name].js' + }, + /* ** Run ESLint on save */ @@ -36,4 +44,3 @@ module.exports = { } } } - diff --git a/pages/index.vue b/pages/index.vue index 95a2553..55e546c 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -1,12 +1,18 @@ @@ -31,16 +35,55 @@ import sequencer from '~/components/sequencer.vue' import sequencerDivided from '~/components/sequencerDivided.vue' import beatMenu from '~/components/beatMenu.vue' +import moduleData from '~/assets/js/moduleData.json' export default { + data() { + return { + lines: [] + // https://stackoverflow.com/questions/44869287/set-object-in-data-from-a-method-in-vue-js#44869373 + // creata object in data vue + } + }, components: { sequencer, sequencerDivided, beatMenu + }, + methods: + { + addLine: function (){ + this.lines.push({ + id: this.lines.length, + slotSlider: 16, + pulseSlider: 3, + euclideanList: [], + controlIsDisplayed: false }); + }, + getSequencerData: function(){ + var modelEsp = { + 'millis_per_slot': 500, // bpm = 60000 / millis_per_slot + 'lines': this.lines.map(function(line) { + return line.euclideanList.reduce(function(acc, x) { return acc + x.toString(); }, ''); + }) + }; + + var xhr = new XMLHttpRequest(); + xhr.open('POST', '/play.ws'); + + xhr.onreadystatechange = function () { + if(xhr.readyState === 4 && xhr.status === 200) { + //self.commits = JSON.parse(xhr.responseText); + console.log("Recv", xhr.responseText); + } + }; + + xhr.setRequestHeader('Content-Type', 'application/json'); + xhr.send(JSON.stringify(modelEsp)); + } } } -