Compare commits

...

11 Commits

Author SHA1 Message Date
Kay Thomas
0bb814e763 Merge pull request #37 from kaythomas0/v0.6.5
v0.6.5
2022-09-23 11:22:41 -07:00
Kay Thomas
621576db14 Bump vuetify from 2.6.6 to 2.6.10
Bumps [vuetify](https://github.com/vuetifyjs/vuetify/tree/HEAD/packages/vuetify) from 2.6.6 to 2.6.10.
- [Release notes](https://github.com/vuetifyjs/vuetify/releases)
- [Commits](https://github.com/vuetifyjs/vuetify/commits/v2.6.10/packages/vuetify)

---
updated-dependencies:
- dependency-name: vuetify
  dependency-type: direct:production
...
2022-09-21 22:58:38 -07:00
Kay Thomas
80969ca029 Merge pull request #35 from kaythomas0/v0.6.4
v0.6.4
2022-09-12 22:29:59 -07:00
Kevin Thomas
26fc54054f Fix bug that causes editing a sample to discard unsaved work 2022-09-11 21:17:45 -07:00
Kay Thomas
8a1fc99fb5 Merge pull request #34 from kaythomas0/v0.6.3
v0.6.3
2022-09-11 17:38:08 -07:00
Kevin Thomas
e6cc5b36c5 Fix typo 2022-09-11 15:11:17 -07:00
Kevin Thomas
6c4c24c166 Fix unwanted display of unsaved work dialog 2022-09-06 02:36:36 -07:00
Kevin Thomas
9466ed692b Use strict sameSite cookies 2022-09-06 02:36:19 -07:00
Kevin Thomas
5ace3d9996 Update package*.json 2022-09-06 02:35:54 -07:00
Kay Thomas
c4642df353 Merge pull request #33 from kaythomas0/v0.6.2
v0.6.2
2022-09-04 20:41:54 -07:00
Kevin Thomas
aca7fbd1e0 Fix sporadic playback with timer 2022-09-04 19:46:31 -07:00
5 changed files with 101 additions and 88 deletions

96
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{ {
"name": "noisedash", "name": "noisedash",
"version": "0.6.0", "version": "0.6.5",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@@ -3183,6 +3183,38 @@
"strip-ansi": "^6.0.0" "strip-ansi": "^6.0.0"
} }
}, },
"@vue/vue-loader-v15": {
"version": "npm:vue-loader@15.10.0",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.10.0.tgz",
"integrity": "sha512-VU6tuO8eKajrFeBzMssFUP9SvakEeeSi1BxdTH5o3+1yUyrldp8IERkSdXlMI2t4kxF2sqYUDsQY+WJBxzBmZg==",
"dev": true,
"requires": {
"@vue/component-compiler-utils": "^3.1.0",
"hash-sum": "^1.0.2",
"loader-utils": "^1.1.0",
"vue-hot-reload-api": "^2.3.0",
"vue-style-loader": "^4.1.0"
},
"dependencies": {
"hash-sum": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz",
"integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
"dev": true
},
"loader-utils": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz",
"integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==",
"dev": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^1.0.1"
}
}
}
},
"@webassemblyjs/ast": { "@webassemblyjs/ast": {
"version": "1.11.1", "version": "1.11.1",
"resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz",
@@ -3495,6 +3527,15 @@
"is-docker": "^2.0.0" "is-docker": "^2.0.0"
} }
}, },
"json5": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
"dev": true,
"requires": {
"minimist": "^1.2.0"
}
},
"jsonfile": { "jsonfile": {
"version": "6.1.0", "version": "6.1.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
@@ -3943,47 +3984,6 @@
"eslint-import-resolver-webpack": "^0.13.1" "eslint-import-resolver-webpack": "^0.13.1"
} }
}, },
"@vue/vue-loader-v15": {
"version": "npm:vue-loader@15.10.0",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.10.0.tgz",
"integrity": "sha512-VU6tuO8eKajrFeBzMssFUP9SvakEeeSi1BxdTH5o3+1yUyrldp8IERkSdXlMI2t4kxF2sqYUDsQY+WJBxzBmZg==",
"dev": true,
"requires": {
"@vue/component-compiler-utils": "^3.1.0",
"hash-sum": "^1.0.2",
"loader-utils": "^1.1.0",
"vue-hot-reload-api": "^2.3.0",
"vue-style-loader": "^4.1.0"
},
"dependencies": {
"hash-sum": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz",
"integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
"dev": true
},
"json5": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
"dev": true,
"requires": {
"minimist": "^1.2.0"
}
},
"loader-utils": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz",
"integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==",
"dev": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^1.0.1"
}
}
}
},
"@vue/web-component-wrapper": { "@vue/web-component-wrapper": {
"version": "1.3.0", "version": "1.3.0",
"resolved": "https://registry.npmjs.org/@vue/web-component-wrapper/-/web-component-wrapper-1.3.0.tgz", "resolved": "https://registry.npmjs.org/@vue/web-component-wrapper/-/web-component-wrapper-1.3.0.tgz",
@@ -4282,7 +4282,7 @@
"append-field": { "append-field": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz",
"integrity": "sha1-HjRA6RXwsSA9I3SOeO3XubW0PlY=" "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw=="
}, },
"arch": { "arch": {
"version": "2.2.0", "version": "2.2.0",
@@ -9175,7 +9175,7 @@
"pause": { "pause": {
"version": "0.0.1", "version": "0.0.1",
"resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz", "resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz",
"integrity": "sha512-KG8UEiEVkR3wGEb4m5yZkVCzigAD+cVEJck2CzYZO37ZGJfctvVptVO192MwrtPhzONn6go8ylnOdMhKqi4nfg==" "integrity": "sha1-HUCLP9t2kjuVQ9lvtMnf1TXZy10="
}, },
"picocolors": { "picocolors": {
"version": "1.0.0", "version": "1.0.0",
@@ -10935,7 +10935,7 @@
"typedarray": { "typedarray": {
"version": "0.0.6", "version": "0.0.6",
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA=="
}, },
"typedarray-to-buffer": { "typedarray-to-buffer": {
"version": "3.1.5", "version": "3.1.5",
@@ -11308,9 +11308,9 @@
"dev": true "dev": true
}, },
"vuetify": { "vuetify": {
"version": "2.6.6", "version": "2.6.10",
"resolved": "https://registry.npmjs.org/vuetify/-/vuetify-2.6.6.tgz", "resolved": "https://registry.npmjs.org/vuetify/-/vuetify-2.6.10.tgz",
"integrity": "sha512-H4KtxDFmDN8QiTRiGfBySyjMhVaHAJTKB0llGGKZT5jKxtnx9gvEtMWXKtVuRP0NJJP0H6xBPJHNOH7nT18qiQ==" "integrity": "sha512-fgUeRDDCwYkwu6WGEEKGe7IdfzOsXJCZGrqkn1pcS2ycuoDL8mR2/dejH5iFNnBY6MnsT365PAGn0J+9otjfQg=="
}, },
"vuetify-loader": { "vuetify-loader": {
"version": "1.7.3", "version": "1.7.3",

View File

@@ -1,6 +1,6 @@
{ {
"name": "noisedash", "name": "noisedash",
"version": "0.6.0", "version": "0.6.5",
"private": true, "private": true,
"author": "Kay Thomas <kaythomas@pm.me> (https://kaythomas.dev)", "author": "Kay Thomas <kaythomas@pm.me> (https://kaythomas.dev)",
"scripts": { "scripts": {
@@ -27,7 +27,7 @@
"tone": "^14.7.77", "tone": "^14.7.77",
"vue": "^2.6.11", "vue": "^2.6.11",
"vue-router": "^3.5.4", "vue-router": "^3.5.4",
"vuetify": "^2.6.6", "vuetify": "^2.6.10",
"winston": "^3.3.3" "winston": "^3.3.3"
}, },
"devDependencies": { "devDependencies": {

View File

@@ -36,7 +36,8 @@ app.use(session({
store: new FileStore(fileStoreOptions), store: new FileStore(fileStoreOptions),
secret: sessionSecret, secret: sessionSecret,
resave: true, resave: true,
saveUninitialized: true saveUninitialized: true,
cookie: { sameSite: 'strict' }
})) }))
app.use((req, res, next) => { app.use((req, res, next) => {
const msgs = req.session.messages || [] const msgs = req.session.messages || []

View File

@@ -50,7 +50,7 @@
label="Profiles" label="Profiles"
class="mx-3 mb-5" class="mx-3 mb-5"
:disabled="playDisabled" :disabled="playDisabled"
@change="loadProfile" @change="loadProfile(true)"
/> />
</v-row> </v-row>
@@ -297,7 +297,7 @@
<v-card-text> <v-card-text>
<v-container> <v-container>
<v-row> <v-row>
<p>Select profile to record audio for. This is only supported on Chrome and Firefox.</p> <p>Select profile to record audio for. This is only supported on Chrome and Firefox. Current profile will be saved before recording.</p>
</v-row> </v-row>
<v-row> <v-row>
<v-select <v-select
@@ -788,7 +788,7 @@
value="continuous" value="continuous"
/> />
<v-radio <v-radio
label="Sporadic (Not Looped, Plays Randomly Within Interval" label="Sporadic (Not Looped, Plays Randomly Within Interval)"
value="sporadic" value="sporadic"
/> />
</v-radio-group> </v-radio-group>
@@ -1026,7 +1026,7 @@
<v-text-field <v-text-field
v-model="previewSampleFadeIn" v-model="previewSampleFadeIn"
type="number" type="number"
label="Fade In Time" label="Fade In Time (In continuous mode, this only effects first playback)"
:disabled="previewSamplePlaying" :disabled="previewSamplePlaying"
:rules="[rules.gt(-1)]" :rules="[rules.gt(-1)]"
@change="updatePreviewSamplePlayerFadeIn" @change="updatePreviewSamplePlayerFadeIn"

View File

@@ -188,6 +188,18 @@ export default {
this.lfo.connect(this.filter.frequency).start() this.lfo.connect(this.filter.frequency).start()
} }
if (this.isTimerEnabled) {
this.duration = parseInt((this.hours * 3600)) + parseInt((this.minutes * 60)) + parseInt(this.seconds)
this.timeRemaining = this.duration
this.transportInterval = setInterval(() => this.stop(), this.duration * 1000 + 100)
this.timeRemainingInterval = setInterval(() => this.startTimer(), 1000)
Tone.Transport.loopEnd = this.duration
this.noise.sync().start(0).stop(this.duration)
} else {
this.noise.sync().start(0)
}
this.loadedSamples.forEach(s => { this.loadedSamples.forEach(s => {
this.players.player(s.id).loop = true this.players.player(s.id).loop = true
this.players.player(s.id).fadeIn = s.fadeIn this.players.player(s.id).fadeIn = s.fadeIn
@@ -206,39 +218,27 @@ export default {
} else { } else {
this.players.player(s.id).toDestination() this.players.player(s.id).toDestination()
} }
})
if (this.isTimerEnabled) { if (s.playbackMode === 'sporadic') {
this.duration = parseInt((this.hours * 3600)) + parseInt((this.minutes * 60)) + parseInt(this.seconds) this.players.player(s.id).loop = false
this.noise.sync().start(0).stop(this.duration)
Tone.Transport.loopEnd = this.duration
this.timeRemaining = this.duration
this.transportInterval = setInterval(() => this.stop(), this.duration * 1000 + 100)
this.timeRemainingInterval = setInterval(() => this.startTimer(), 1000)
this.loadedSamples.forEach(s => { const maxInt = parseInt(s.sporadicMax, 10)
this.players.player(s.id).unsync().sync().start(0).stop(this.duration) const minInt = parseInt(s.sporadicMin, 10)
})
} else {
this.noise.sync().start(0)
this.loadedSamples.forEach(s => { if (minInt <= maxInt) {
if (s.playbackMode === 'sporadic') { const rand = Math.floor(Math.random() * (maxInt - minInt + 1) + minInt)
this.players.player(s.id).loop = false s.initialSporadicPlayInterval = setInterval(() => this.playSporadicSample(s.id), rand * 1000)
}
} else {
this.players.player(s.id).loop = true
const maxInt = parseInt(s.sporadicMax, 10) if (this.isTimerEnabled) {
const minInt = parseInt(s.sporadicMin, 10) this.players.player(s.id).unsync().sync().start(0).stop(this.duration)
if (minInt <= maxInt) {
const rand = Math.floor(Math.random() * (maxInt - minInt + 1) + minInt)
s.initialSporadicPlayInterval = setInterval(() => this.playSporadicSample(s.id), rand * 1000)
}
} else { } else {
this.players.player(s.id).loop = true
this.players.player(s.id).unsync().sync().start(0) this.players.player(s.id).unsync().sync().start(0)
} }
}) }
} })
Tone.Transport.start('+0.1') Tone.Transport.start('+0.1')
}, },
@@ -344,7 +344,7 @@ export default {
} }
this.exportedProfile = this.profileItems[0] this.exportedProfile = this.profileItems[0]
this.recordedProfile = this.profileItems[0] this.recordedProfile = this.profileItems[0]
this.loadProfile() this.loadProfile(true)
} }
} }
}) })
@@ -420,8 +420,8 @@ export default {
this.errorSnackbar = true this.errorSnackbar = true
}) })
}, },
loadProfile () { loadProfile (checkForUnsavedWork) {
if (this.unsavedWork) { if (checkForUnsavedWork && this.unsavedWork) {
this.confirmSwitchProfileDialog = true this.confirmSwitchProfileDialog = true
} else { } else {
this.$http.get('/profiles/'.concat(this.selectedProfile.id)) this.$http.get('/profiles/'.concat(this.selectedProfile.id))
@@ -736,7 +736,16 @@ export default {
}).then(response => { }).then(response => {
if (response.status === 200) { if (response.status === 200) {
this.getSamples() this.getSamples()
this.loadProfile()
// Update sample if it's already loaded in current profile
const sample = this.loadedSamples.find(s => s.id === this.selectedPreviewSample.id)
if (sample) {
sample.fadeIn = this.previewSampleFadeIn
sample.loopPointsEnabled = this.previewSampleLoopPointsEnabled
sample.loopStart = this.previewSampleLoopStart
sample.loopEnd = this.previewSampleLoopEnd
}
this.closeEditSampleForm() this.closeEditSampleForm()
this.infoSnackbarText = 'Sample Saved' this.infoSnackbarText = 'Sample Saved'
this.infoSnackbar = true this.infoSnackbar = true
@@ -760,6 +769,9 @@ export default {
this.profileMoreDialog = false this.profileMoreDialog = false
}, },
startRecording () { startRecording () {
// Save current profile before recording
this.updateProfile()
this.$http.get('/profiles/'.concat(this.recordedProfile.id)) this.$http.get('/profiles/'.concat(this.recordedProfile.id))
.then(async response => { .then(async response => {
if (response.status === 200) { if (response.status === 200) {
@@ -866,7 +878,7 @@ export default {
const recording = await this.recorder.stop() const recording = await this.recorder.stop()
// Set active profile back to the selected one // Set active profile back to the selected one
this.loadProfile() this.loadProfile(false)
const url = URL.createObjectURL(recording) const url = URL.createObjectURL(recording)
const anchor = document.createElement('a') const anchor = document.createElement('a')
@@ -890,7 +902,7 @@ export default {
await this.recorder.stop() await this.recorder.stop()
// Set active profile back to the selected one // Set active profile back to the selected one
this.loadProfile() this.loadProfile(false)
clearInterval(this.recordingInterval) clearInterval(this.recordingInterval)
this.recordingDialog = false this.recordingDialog = false
@@ -898,7 +910,7 @@ export default {
}, },
discardChanges () { discardChanges () {
this.unsavedWork = false this.unsavedWork = false
this.loadProfile() this.loadProfile(true)
this.confirmSwitchProfileDialog = false this.confirmSwitchProfileDialog = false
}, },
saveChanges () { saveChanges () {