-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Full project review from WIP branch #29
base: initial
Are you sure you want to change the base?
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a few comments
|
||
import {Config} from '../../types/config_types/config_types'; | ||
|
||
export type Stdin = Pick< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably fold this stuff into wled service maybe
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"audic": "^3.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this dep
export type GlobalState = { | ||
config: ConfigState; | ||
adhocState?: AdhocProgressionState; | ||
progression?: ProgressionState; | ||
userData: UserDataState; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be abstracted into data-driven buttons with pico.css
No description provided.