Skip to content
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

Open
wants to merge 13 commits into
base: initial
Choose a base branch
from
Open

Conversation

mickmister
Copy link
Member

No description provided.

- 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 mickmister changed the base branch from main to initial November 2, 2023 21:29
Copy link
Member Author

@mickmister mickmister left a 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<
Copy link
Member Author

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) => {
Copy link
Member Author

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",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this dep

Comment on lines +5 to +10
export type GlobalState = {
config: ConfigState;
adhocState?: AdhocProgressionState;
progression?: ProgressionState;
userData: UserDataState;
}
Copy link
Member Author

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

Comment on lines +3 to +9
export type ProgressionState = {
currentProgression: number;
currentChord: number;
currentSong: number;
shouldDrumsChangeColor: boolean;
shouldDrumsChangeProgression: boolean;
}
Copy link
Member Author

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.

Comment on lines +75 to +86
getProgressionState: () => ProgressionState | undefined = () => this.progressionMode?.getState();
getAdhocState: () => AdhocProgressionState | undefined = () => {
if (this.adhocCompositionMode) {
this.adhocCompositionMode.getState();
}

if (this.adhocPlaybackMode) {
return this.adhocPlaybackMode.getState();
}

return undefined;
};
Copy link
Member Author

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

Comment on lines +106 to +122
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();
Copy link
Member Author

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

Comment on lines +140 to +143
noteOffAll: () => {
this.midiService.notesOffAll();
this.chordSupervisor.notesOffAll();
},
Copy link
Member Author

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

Comment on lines +8 to +10
import type App from '../../app';
import {AdhocProgressionState} from '../../state/progression_state';
import InputChordSupervisor from '../../io/midi/input_chord_supervisor';
Copy link
Member Author

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

Comment on lines +88 to +102
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,
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant