Conversation
- nanokey studio controls juno - and controls wled with knobs and buttons
* initial setup for control management * introduce progression mode. next chord supervisor * chords work * updates for triggering wled and progressions
* begin work on qwerty * arbitrary bulk commit * saving state from open mic * add webapp control panel
* migrate webapp to snowpack and add shared folder * make server used shared folder * clean up deps
* websocket messages work * initial steps for local mode * random clock and test stuff
* progress on adhoc mode. InputChordSupervisor and subscribeToSustainPedal * have inputs hooked up with subscriptions and handling sustain pedal state. going to test out with yamaha now * playing juno with sustain works! * playback works * WIP from last performance
* progress on adhoc mode. InputChordSupervisor and subscribeToSustainPedal * have inputs hooked up with subscriptions and handling sustain pedal state. going to test out with yamaha now * playing juno with sustain works! * playback works * WIP from last performance * fix webapp lint * fix server lint * fix shared lint
mickmister
left a comment
There was a problem hiding this comment.
LGTM, just a few comments
|
|
||
| import {Config} from '../../types/config_types/config_types'; | ||
|
|
||
| export type Stdin = Pick< |
There was a problem hiding this comment.
Move this stuff into server folder. The deps for QwertyService should be minimal. We can make a Stdin adapter class as the "server" version of the dep
| import {log} from '../../utils'; | ||
|
|
||
| let previousPalette = 0; | ||
| export const setRandomColor = async (wled: WLEDClient | undefined) => { |
There was a problem hiding this comment.
Should probably fold this stuff into wled service maybe
| "author": "", | ||
| "license": "ISC", | ||
| "dependencies": { | ||
| "audic": "^3.0.1", |
| export type GlobalState = { | ||
| config: ConfigState; | ||
| adhocState?: AdhocProgressionState; | ||
| progression?: ProgressionState; | ||
| userData: UserDataState; | ||
| } |
There was a problem hiding this comment.
We currently have two "mode"'s states here. But we don't have a "this is the current mode" state property
| export type ProgressionState = { | ||
| currentProgression: number; | ||
| currentChord: number; | ||
| currentSong: number; | ||
| shouldDrumsChangeColor: boolean; | ||
| shouldDrumsChangeProgression: boolean; | ||
| } |
There was a problem hiding this comment.
shouldDrumsChangeColor and shouldDrumsChangeProgression are not really specific to this mode. Maybe they should be in a "common state" thing.
Also, ProgressionMode and AdhocPlaybackMode are not too different from each other.
| getProgressionState: () => ProgressionState | undefined = () => this.progressionMode?.getState(); | ||
| getAdhocState: () => AdhocProgressionState | undefined = () => { | ||
| if (this.adhocCompositionMode) { | ||
| this.adhocCompositionMode.getState(); | ||
| } | ||
|
|
||
| if (this.adhocPlaybackMode) { | ||
| return this.adhocPlaybackMode.getState(); | ||
| } | ||
|
|
||
| return undefined; | ||
| }; |
There was a problem hiding this comment.
This stuff is going to be extracted from this file into separate modes
| changeModeAdhocPlayback = (state: AdhocProgressionState) => { | ||
| if (this.adhocPlaybackMode) { | ||
| return; | ||
| } | ||
|
|
||
| this.adhocCompositionMode?.close(); | ||
| this.adhocCompositionMode = undefined; | ||
|
|
||
| const newState: AdhocProgressionState = {...state, mode: 'playback'}; | ||
| this.adhocPlaybackMode = new AdhocChordPlaybackMode(newState, this.midiService, this); | ||
| this.activeMode = this.adhocPlaybackMode; | ||
|
|
||
| this.broadcastState(); | ||
| }; | ||
|
|
||
| changeModeAdhocComposition = () => { | ||
| this.adhocPlaybackMode?.close(); |
There was a problem hiding this comment.
Same with everything here and everything below until the end of file
| noteOffAll: () => { | ||
| this.midiService.notesOffAll(); | ||
| this.chordSupervisor.notesOffAll(); | ||
| }, |
There was a problem hiding this comment.
Gotta make sure the local mode calls notes off when the user refreshes. Or make it easy to do "note off all" somehow
| import type App from '../../app'; | ||
| import {AdhocProgressionState} from '../../state/progression_state'; | ||
| import InputChordSupervisor from '../../io/midi/input_chord_supervisor'; |
There was a problem hiding this comment.
Would be great to say @core/... here
| const buttonColors: Record<string, ControlPanelActions[]> = { | ||
| [Colors.NAVY]: [ | ||
| // ControlPanelActions.NEXT_CHORD, | ||
| ControlPanelActions.RESET_PROGRESSION, | ||
| ControlPanelActions.LOCK_IN_PROGRESSION, | ||
| ], | ||
| [Colors.AQUA]: [ | ||
| ControlPanelActions.CHANGE_COLOR, | ||
| ControlPanelActions.CHANGE_PRESET, | ||
| ], | ||
| [Colors.PURPLE]: [ | ||
| // ControlPanelActions.RAINBOW, | ||
| ], | ||
| [Colors.RED]: [ | ||
| ControlPanelActions.SOUND_OFF, |
There was a problem hiding this comment.
This will be abstracted into data-driven buttons with pico.css
No description provided.