@@ -2,7 +2,7 @@ | |||||
Simple monitor for displaying MIDI status for digital pianos. | Simple monitor for displaying MIDI status for digital pianos. | ||||
Supports a keyboard span of **9 octaves** (C0-B8, MIDI note number 12-119), as well as | |||||
Supports a **full MIDI key range**, as well as | |||||
granular pedal status display for **soft pedal/una corda** (MIDI CC number 67), | granular pedal status display for **soft pedal/una corda** (MIDI CC number 67), | ||||
**sostenuto** (MIDI CC number 66), and **sustain** (MIDI CC number 64, values from 0-127). | **sostenuto** (MIDI CC number 66), and **sustain** (MIDI CC number 64, values from 0-127). | ||||
@@ -26,12 +26,12 @@ A directory `dist/` should be generated along with build output. | |||||
Just run: | Just run: | ||||
``` | |||||
```shell script | |||||
yarn start | yarn start | ||||
``` | ``` | ||||
Electron should spawn the application window. | |||||
Create React App should run in watch mode, then Electron should spawn the application window shortly. | |||||
## License | ## License | ||||
[MIT License](./LICENSE) | |||||
[MIT License](./LICENSE) |
@@ -10,7 +10,7 @@ | |||||
"@testing-library/jest-dom": "^4.2.4", | "@testing-library/jest-dom": "^4.2.4", | ||||
"@testing-library/react": "^9.3.2", | "@testing-library/react": "^9.3.2", | ||||
"@testing-library/user-event": "^7.1.2", | "@testing-library/user-event": "^7.1.2", | ||||
"@theoryofnekomata/react-musical-keyboard": "1.0.4", | |||||
"@theoryofnekomata/react-musical-keyboard": "1.0.7", | |||||
"@types/jest": "^24.0.0", | "@types/jest": "^24.0.0", | ||||
"@types/react": "^16.9.0", | "@types/react": "^16.9.0", | ||||
"@types/react-dom": "^16.9.0", | "@types/react-dom": "^16.9.0", | ||||
@@ -19,7 +19,8 @@ | |||||
"react": "^16.13.1", | "react": "^16.13.1", | ||||
"react-dom": "^16.13.1", | "react-dom": "^16.13.1", | ||||
"react-scripts": "3.4.1", | "react-scripts": "3.4.1", | ||||
"typescript": "~3.7.2" | |||||
"typescript": "~3.7.2", | |||||
"yargs": "^15.4.1" | |||||
}, | }, | ||||
"scripts": { | "scripts": { | ||||
"postinstall": "electron-builder install-app-deps", | "postinstall": "electron-builder install-app-deps", | ||||
@@ -2,7 +2,7 @@ | |||||
<html lang="en-PH" style="--size-close-button: 2rem;"> | <html lang="en-PH" style="--size-close-button: 2rem;"> | ||||
<head> | <head> | ||||
<meta charset="utf-8" /> | <meta charset="utf-8" /> | ||||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> | |||||
<link rel="icon" href="%PUBLIC_URL%/favicon.png" /> | |||||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||||
<meta name="theme-color" content="#000000" /> | <meta name="theme-color" content="#000000" /> | ||||
<meta | <meta | ||||
@@ -1,6 +1,7 @@ | |||||
import { app, BrowserWindow, Menu, ipcMain, } from 'electron' | import { app, BrowserWindow, Menu, ipcMain, } from 'electron' | ||||
import path from 'path' | import path from 'path' | ||||
import fs from 'fs' | import fs from 'fs' | ||||
import * as yargs from 'yargs' | |||||
import SPANS from './services/spans.json' | import SPANS from './services/spans.json' | ||||
import SCALE_FACTORS from './services/scaleFactors.json' | import SCALE_FACTORS from './services/scaleFactors.json' | ||||
@@ -79,7 +80,7 @@ app | |||||
.whenReady() | .whenReady() | ||||
.then(() => { | .then(() => { | ||||
try { | try { | ||||
const configJsonRaw = fs.readFileSync('./config.json').toString('utf-8') | |||||
const configJsonRaw = fs.readFileSync(path.join(app.getPath('userData'), 'config.json')).toString('utf-8') | |||||
config = JSON.parse(configJsonRaw) | config = JSON.parse(configJsonRaw) | ||||
} catch (e) { | } catch (e) { | ||||
config = { | config = { | ||||
@@ -180,7 +181,10 @@ app | |||||
}) | }) | ||||
app.on('quit', () => { | app.on('quit', () => { | ||||
fs.writeFileSync('./config.json', JSON.stringify(config)) | |||||
if (app.commandLine.hasSwitch('discardConfig')) { | |||||
return | |||||
} | |||||
fs.writeFileSync(path.join(app.getPath('userData'), 'config.json'), JSON.stringify(config)) | |||||
}) | }) | ||||
app.on('window-all-closed', () => { | app.on('window-all-closed', () => { | ||||
@@ -1540,10 +1540,10 @@ | |||||
resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-7.2.1.tgz#2ad4e844175a3738cb9e7064be5ea070b8863a1c" | resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-7.2.1.tgz#2ad4e844175a3738cb9e7064be5ea070b8863a1c" | ||||
integrity sha512-oZ0Ib5I4Z2pUEcoo95cT1cr6slco9WY7yiPpG+RGNkj8YcYgJnM7pXmYmorNOReh8MIGcKSqXyeGjxnr8YiZbA== | integrity sha512-oZ0Ib5I4Z2pUEcoo95cT1cr6slco9WY7yiPpG+RGNkj8YcYgJnM7pXmYmorNOReh8MIGcKSqXyeGjxnr8YiZbA== | ||||
"@theoryofnekomata/react-musical-keyboard@1.0.4": | |||||
version "1.0.4" | |||||
resolved "https://js.pack.modal.sh/@theoryofnekomata%2freact-musical-keyboard/-/react-musical-keyboard-1.0.4.tgz#db4abf5d310563130355d96710ecc8a0a5f97e0d" | |||||
integrity sha512-9Iq0g1iY4DS9ANeqDI4uBBxWSamMiIlUWuT5MNwWYXX2dZesUkkwwPFER4PRiYnzj2+5beuHi8V7L97kp9dxaA== | |||||
"@theoryofnekomata/react-musical-keyboard@1.0.7": | |||||
version "1.0.7" | |||||
resolved "https://js.pack.modal.sh/@theoryofnekomata%2freact-musical-keyboard/-/react-musical-keyboard-1.0.7.tgz#beeb038e086491da79d944828ac9b7b8cfb3030b" | |||||
integrity sha512-H9nARUaOJpoCgRS4MK+bNiM778MyAd+ZczWW5Qaiasam9l0nFn8HVjCW6u+ftYtX3wNQqFPV9VakOwVsjTUlXA== | |||||
dependencies: | dependencies: | ||||
mem "^6.1.0" | mem "^6.1.0" | ||||
@@ -11950,7 +11950,7 @@ yargs@^13.3.0: | |||||
y18n "^4.0.0" | y18n "^4.0.0" | ||||
yargs-parser "^13.1.2" | yargs-parser "^13.1.2" | ||||
yargs@^15.3.1: | |||||
yargs@^15.3.1, yargs@^15.4.1: | |||||
version "15.4.1" | version "15.4.1" | ||||
resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" | resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" | ||||
integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== | integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== | ||||