mirror of
https://github.com/kaythomas0/noisedash.git
synced 2025-11-12 03:16:20 +00:00
Compare commits
52 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e961568178 | ||
|
|
8595a3f155 | ||
|
|
9f376ae56f | ||
|
|
cba9cd6e85 | ||
|
|
7b080e0163 | ||
|
|
0618f9e8d6 | ||
|
|
1c3f09fcb8 | ||
|
|
98419b6248 | ||
|
|
2d2f1810d1 | ||
|
|
c9fcf06503 | ||
|
|
53c05dfe56 | ||
|
|
2dc54c7347 | ||
|
|
bd73809ad9 | ||
|
|
3d7c3545ea | ||
|
|
02c5fd9660 | ||
|
|
d98b23ed40 | ||
|
|
d57ea01750 | ||
|
|
3cc060fdae | ||
|
|
2f21025d20 | ||
|
|
bdbbdee48d | ||
|
|
f442d486a3 | ||
|
|
ef3eb1a70a | ||
|
|
2bb67a9a22 | ||
|
|
af2384b790 | ||
|
|
d83639b5c6 | ||
|
|
5d3a6fb912 | ||
|
|
722e0600f1 | ||
|
|
cd65c0b714 | ||
|
|
d73afdb68c | ||
|
|
e72503e91e | ||
|
|
294a4e4dec | ||
|
|
21fda5ce04 | ||
|
|
17301b5b31 | ||
|
|
923f5bb52e | ||
|
|
0cac4f2d5a | ||
|
|
5b99b8cfc2 | ||
|
|
1ae403171e | ||
|
|
c329f4f70a | ||
|
|
f1654d39ca | ||
|
|
a698934823 | ||
|
|
0ec92bad85 | ||
|
|
0bb814e763 | ||
|
|
621576db14 | ||
|
|
80969ca029 | ||
|
|
26fc54054f | ||
|
|
8a1fc99fb5 | ||
|
|
e6cc5b36c5 | ||
|
|
6c4c24c166 | ||
|
|
9466ed692b | ||
|
|
5ace3d9996 | ||
|
|
c4642df353 | ||
|
|
aca7fbd1e0 |
8
.github/dependabot.yml
vendored
Normal file
8
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "npm"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
||||||
|
# Disable version updates for npm dependencies
|
||||||
|
open-pull-requests-limit: 0
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
FROM node:14
|
FROM node:20
|
||||||
LABEL maintainer="kaythomas@pm.me"
|
LABEL maintainer="kaythomas@pm.me"
|
||||||
WORKDIR /var/noisedash
|
WORKDIR /var/noisedash
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm install
|
RUN npm install --force
|
||||||
COPY . .
|
COPY . .
|
||||||
ENV NODE_ENV production
|
ENV NODE_ENV production
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|||||||
22
README.md
22
README.md
@@ -23,6 +23,9 @@ Requires docker and docker-compose
|
|||||||
|
|
||||||
* Download the provided [docker-compose.yml file](https://github.com/kaythomas0/noisedash/blob/main/docker-compose.yml)
|
* Download the provided [docker-compose.yml file](https://github.com/kaythomas0/noisedash/blob/main/docker-compose.yml)
|
||||||
* In the same directory as the docker-compose file, created a folder called `config`, and inside it, put the provided [config file](https://github.com/kaythomas0/noisedash/blob/main/config/default.json)
|
* In the same directory as the docker-compose file, created a folder called `config`, and inside it, put the provided [config file](https://github.com/kaythomas0/noisedash/blob/main/config/default.json)
|
||||||
|
* `maxSampleSize` is in bytes - 10GB by default
|
||||||
|
* Keep `tls` as `false` if using an external web server like nginx
|
||||||
|
* `production.json` exists in the source code and is left empty intentionally for the reason outlined here: https://github.com/node-config/node-config/wiki/Strict-Mode#node_env-value-of-node_env-did-not-match-any-deployment-config-file-names=
|
||||||
* Edit the config file to your preference
|
* Edit the config file to your preference
|
||||||
* Bring the container up:
|
* Bring the container up:
|
||||||
|
|
||||||
@@ -34,9 +37,26 @@ docker-compose up -d
|
|||||||
|
|
||||||
(Raspberry Pi compatible images are available, see armv7 images on [Docker Hub](https://hub.docker.com/repository/docker/noisedash/noisedash))
|
(Raspberry Pi compatible images are available, see armv7 images on [Docker Hub](https://hub.docker.com/repository/docker/noisedash/noisedash))
|
||||||
|
|
||||||
|
## Kubernetes
|
||||||
|
|
||||||
|
You can apply the manifest.yaml in the kubernetes folder to install Noisedash into your Kubernetes cluster.
|
||||||
|
|
||||||
|
Optionally, uncomment the last lines in the file to also create an ingress. The ingress, commented out by default, needs to have the clusterIssuser annotation set to your cluster issuer (default: letsencrypt-prod) and the ingress class set to your Ingress class (default: Nginx)
|
||||||
|
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
$ kubectl apply -f ./kubernetes/manifest.yaml
|
||||||
|
persistentvolumeclaim/db-pvc created
|
||||||
|
persistentvolumeclaim/samples-pvc created
|
||||||
|
deployment.apps/noisedash created
|
||||||
|
service/noisedash created
|
||||||
|
configmap/noisedashcfg created
|
||||||
|
ingress.networking.k8s.io/noisedashingress created
|
||||||
|
```
|
||||||
|
|
||||||
## From Source
|
## From Source
|
||||||
|
|
||||||
Requires node 14 and npm
|
Requires node 20 and npm
|
||||||
|
|
||||||
* Clone the repo:
|
* Clone the repo:
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
"listeningPort": 1432,
|
"listeningPort": 1432,
|
||||||
"sessionFileStorePath": "sessions",
|
"sessionFileStorePath": "sessions",
|
||||||
"sampleUploadPath": "samples",
|
"sampleUploadPath": "samples",
|
||||||
"maxSampleSize": 10737418240, // In bytes, 10GB by default
|
"maxSampleSize": 10737418240,
|
||||||
"logFile": "log/noisedash.log",
|
"logFile": "log/noisedash.log",
|
||||||
"tls": false, // Keep this as false if using an external web server like nginx
|
"tls": false,
|
||||||
"tlsKey": "certs/key.pem",
|
"tlsKey": "certs/key.pem",
|
||||||
"tlsCert": "certs/cert.pem"
|
"tlsCert": "certs/cert.pem"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{} // Left empty intentionally: https://github.com/node-config/node-config/wiki/Strict-Mode#node_env-value-of-node_env-did-not-match-any-deployment-config-file-names=
|
{}
|
||||||
240
kubernetes/manifest.yaml
Normal file
240
kubernetes/manifest.yaml
Normal file
@@ -0,0 +1,240 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: db-pvc
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 10Gi
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: samples-pvc
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 10Gi
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: noisedash
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: noisedash
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: noisedash
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: noisedash
|
||||||
|
image: noisedash/noisedash:latest
|
||||||
|
ports:
|
||||||
|
- containerPort: 1432
|
||||||
|
volumeMounts:
|
||||||
|
- name: db
|
||||||
|
mountPath: /var/noisedash/db
|
||||||
|
- name: samples
|
||||||
|
mountPath: /var/noisedash/samples
|
||||||
|
- name: config
|
||||||
|
mountPath: /var/noisedash/config/default.json
|
||||||
|
subPath: config.json
|
||||||
|
volumes:
|
||||||
|
- name: db
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: db-pvc
|
||||||
|
- name: samples
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: samples-pvc
|
||||||
|
- name: config
|
||||||
|
configMap:
|
||||||
|
name: noisedashcfg
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: noisedash
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: noisedash
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: 80
|
||||||
|
targetPort: 1432
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: noisedashcfg
|
||||||
|
data:
|
||||||
|
config.json: |
|
||||||
|
{
|
||||||
|
"Server": {
|
||||||
|
"listeningPort": 1432,
|
||||||
|
"sessionFileStorePath": "sessions",
|
||||||
|
"sampleUploadPath": "samples",
|
||||||
|
"maxSampleSize": 10737418240,
|
||||||
|
"logFile": "log/noisedash.log",
|
||||||
|
"tls": false,
|
||||||
|
"tlsKey": "certs/key.pem",
|
||||||
|
"tlsCert": "certs/cert.pem"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
---
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||||
|
kubernetes.io/ingress.class: nginx
|
||||||
|
kubernetes.io/tls-acme: "true"
|
||||||
|
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
|
||||||
|
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/instance: noisedash
|
||||||
|
name: noisedashingress
|
||||||
|
spec:
|
||||||
|
rules:
|
||||||
|
- host: noisedash.freshbrewed.science
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- backend:
|
||||||
|
service:
|
||||||
|
name: noisedash
|
||||||
|
port:
|
||||||
|
number: 80
|
||||||
|
path: /
|
||||||
|
pathType: ImplementationSpecific
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- noisedash.freshbrewed.science
|
||||||
|
secretName: noisedash-tls
|
||||||
|
builder@DESKTOP-QADGF36:~/Workspaces/pyplanereport$
|
||||||
|
builder@DESKTOP-QADGF36:~/Workspaces/pyplanereport$ cat noiseall.yaml
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: db-pvc
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 10Gi
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: samples-pvc
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 10Gi
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: noisedash
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: noisedash
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: noisedash
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: noisedash
|
||||||
|
image: noisedash/noisedash:latest
|
||||||
|
ports:
|
||||||
|
- containerPort: 1432
|
||||||
|
volumeMounts:
|
||||||
|
- name: db
|
||||||
|
mountPath: /var/noisedash/db
|
||||||
|
- name: samples
|
||||||
|
mountPath: /var/noisedash/samples
|
||||||
|
- name: config
|
||||||
|
mountPath: /var/noisedash/config/default.json
|
||||||
|
subPath: config.json
|
||||||
|
volumes:
|
||||||
|
- name: db
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: db-pvc
|
||||||
|
- name: samples
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: samples-pvc
|
||||||
|
- name: config
|
||||||
|
configMap:
|
||||||
|
name: noisedashcfg
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: noisedash
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: noisedash
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: 80
|
||||||
|
targetPort: 1432
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: noisedashcfg
|
||||||
|
data:
|
||||||
|
config.json: |
|
||||||
|
{
|
||||||
|
"Server": {
|
||||||
|
"listeningPort": 1432,
|
||||||
|
"sessionFileStorePath": "sessions",
|
||||||
|
"sampleUploadPath": "samples",
|
||||||
|
"maxSampleSize": 10737418240,
|
||||||
|
"logFile": "log/noisedash.log",
|
||||||
|
"tls": false,
|
||||||
|
"tlsKey": "certs/key.pem",
|
||||||
|
"tlsCert": "certs/cert.pem"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# ---
|
||||||
|
# apiVersion: networking.k8s.io/v1
|
||||||
|
# kind: Ingress
|
||||||
|
# metadata:
|
||||||
|
# annotations:
|
||||||
|
# cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||||
|
# kubernetes.io/ingress.class: nginx
|
||||||
|
# kubernetes.io/tls-acme: "true"
|
||||||
|
# nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
|
||||||
|
# nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
|
||||||
|
# labels:
|
||||||
|
# app.kubernetes.io/instance: noisedash
|
||||||
|
# name: noisedashingress
|
||||||
|
# spec:
|
||||||
|
# rules:
|
||||||
|
# - host: noisedash.freshbrewed.science
|
||||||
|
# http:
|
||||||
|
# paths:
|
||||||
|
# - backend:
|
||||||
|
# service:
|
||||||
|
# name: noisedash
|
||||||
|
# port:
|
||||||
|
# number: 80
|
||||||
|
# path: /
|
||||||
|
# pathType: ImplementationSpecific
|
||||||
|
# tls:
|
||||||
|
# - hosts:
|
||||||
|
# - noisedash.freshbrewed.science
|
||||||
|
# secretName: noisedash-tls
|
||||||
19975
package-lock.json
generated
19975
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
24
package.json
24
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "noisedash",
|
"name": "noisedash",
|
||||||
"version": "0.6.0",
|
"version": "0.7.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"author": "Kay Thomas <kaythomas@pm.me> (https://kaythomas.dev)",
|
"author": "Kay Thomas <kaythomas@pm.me> (https://kaythomas.dev)",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -12,11 +12,11 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vscode/sqlite3": "^5.0.8",
|
"@vscode/sqlite3": "^5.0.8",
|
||||||
"axios": "^0.21.4",
|
"axios": "^1.6.0",
|
||||||
"config": "^3.3.6",
|
"config": "^3.3.6",
|
||||||
"connect-history-api-fallback": "^1.6.0",
|
"connect-history-api-fallback": "^1.6.0",
|
||||||
"cookie-parser": "^1.4.5",
|
"cookie-parser": "^1.4.5",
|
||||||
"core-js": "^3.22.7",
|
"core-js": "^3.23.5",
|
||||||
"express": "^4.18.1",
|
"express": "^4.18.1",
|
||||||
"express-session": "^1.17.3",
|
"express-session": "^1.17.3",
|
||||||
"multer": "^1.4.5-lts.1",
|
"multer": "^1.4.5-lts.1",
|
||||||
@@ -25,18 +25,18 @@
|
|||||||
"path": "^0.12.7",
|
"path": "^0.12.7",
|
||||||
"session-file-store": "^1.5.0",
|
"session-file-store": "^1.5.0",
|
||||||
"tone": "^14.7.77",
|
"tone": "^14.7.77",
|
||||||
"vue": "^2.6.11",
|
"vue": "^2.7.16",
|
||||||
"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": {
|
||||||
"@babel/core": "^7.12.16",
|
"@babel/core": "^7.12.16",
|
||||||
"@babel/eslint-parser": "^7.12.16",
|
"@babel/eslint-parser": "^7.12.16",
|
||||||
"@vue/cli-plugin-babel": "^5.0.4",
|
"@vue/cli-plugin-babel": "^5.0.8",
|
||||||
"@vue/cli-plugin-eslint": "^5.0.4",
|
"@vue/cli-plugin-eslint": "^5.0.8",
|
||||||
"@vue/cli-plugin-router": "^5.0.4",
|
"@vue/cli-plugin-router": "^5.0.8",
|
||||||
"@vue/cli-service": "^5.0.4",
|
"@vue/cli-service": "^5.0.8",
|
||||||
"@vue/eslint-config-standard": "^6.1.0",
|
"@vue/eslint-config-standard": "^6.1.0",
|
||||||
"eslint": "^7.32.0",
|
"eslint": "^7.32.0",
|
||||||
"eslint-plugin-html": "^6.2.0",
|
"eslint-plugin-html": "^6.2.0",
|
||||||
@@ -44,11 +44,11 @@
|
|||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-promise": "^5.1.0",
|
"eslint-plugin-promise": "^5.1.0",
|
||||||
"eslint-plugin-standard": "^4.0.0",
|
"eslint-plugin-standard": "^4.0.0",
|
||||||
"eslint-plugin-vue": "^8.0.3",
|
"eslint-plugin-vue": "^7.20.0",
|
||||||
"sass": "~1.32.0",
|
"sass": "~1.32.0",
|
||||||
"sass-loader": "^10.0.0",
|
"sass-loader": "^10.0.0",
|
||||||
"vue-cli-plugin-vuetify": "^2.5.0",
|
"vue-cli-plugin-vuetify": "^2.5.8",
|
||||||
"vue-template-compiler": "^2.6.11",
|
"vue-template-compiler": "^2.7.16",
|
||||||
"vuetify-loader": "^1.7.3"
|
"vuetify-loader": "^1.7.3"
|
||||||
},
|
},
|
||||||
"bugs": "https://github.com/kaythomas0/noisedash/issues",
|
"bugs": "https://github.com/kaythomas0/noisedash/issues",
|
||||||
|
|||||||
@@ -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 || []
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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 () {
|
||||||
|
|||||||
Reference in New Issue
Block a user