Skip to content

Instantly share code, notes, and snippets.

@remarcable
Last active June 11, 2018 19:09
Show Gist options
  • Save remarcable/9d2aacbfe00dca8c7fbc4e9458429f3e to your computer and use it in GitHub Desktop.
Save remarcable/9d2aacbfe00dca8c7fbc4e9458429f3e to your computer and use it in GitHub Desktop.
Musical practice in JS
// ************************************
// Marc on how to practice effectively
// ************************************
import Universe from 'universe';
import Player from 'player';
// teaching and practicing methods, implement .teach() and .helpWithPractice()
import flowkey from 'flowkey';
import PianoTeacher from 'piano-teacher';
const universe = new Universe(); // keep defaults
const person = new Player({ skillfulness: 100, iq: 131, humor: 80, taste: 'good' }); // typical average piano player
const teacher = new PianoTeacher();
universe.onEvery('day', () =>
practice({
brain: person.brain,
body: person.body,
}),
);
function practice({ brain, body }) {
//* preparation
const important = brain.askQuestion('Was ist in dieser Übesession wirklich neu?');
// FIXME: This should not be needed, brain should be motivated all the time if possible.
// Maybe implement in Player class in onWakeUp eventHandler?
brain.becomeMotivated();
const goals = brain
.getOrCreateGoals()
.filter(goal => goal.isPositiveGoal) // e. g. "Play song at 100 BPM" instead of "Don't be too slow"
.reduce((finalGoals, goal) => {
if (goalIsTooBroad(goal)) {
// e. g. "Play song at 100 BPM" instead of "Improve on song"
const concreteGoals = reifyGoal(goal); // simplify
return [...finalGoals, ...reifyGoals];
} else {
return [...finalGoals, goal];
}
}, []);
if (goalsContradictEachOther(goals)) {
// e. g. contradicting goals: "Become boulding chamption" <=> "Improve articulation on piano"
filterContradictingGoals(goals);
}
createOrIterateOnLongtermGoals();
const practicingHabits = brain.habits.practice;
// e. g. playing the same exercise every time even though you don't need it anymore
filterHabitsThatAreNoLongerNeededButConsumeALotOfTime(practicingHabits);
//* actual practicing
doPreparationExercises(); // play scales and so on
for (goal of goals) {
practiceForIndividualGoal({ goal, method: flowkey }); // flowkey is a good default for the beginning
assessWhetherGoalWasReached(goal); // e.g. make recordings etc.
}
playOldPieces();
improviseAndHaveSomeFun();
//* follow-up
const answer = brain.askQuestion('Ziele erreicht? Was mache ich nächstes mal anders?'); // whatever
body.writeOnPaper(answer);
}
function practiceForIndividualGoal({ goal, method }) {
while (!archievedGoal(goal)) {
practiceForGoal(goal, method); // dependency injection for the pros
if (hasPracticedALot()) {
makeSmallBreak();
}
if (brain.isSatisfiedWithPracticeForGoal(goal)) {
goal.archieve();
}
}
}
function doPreparationExercises() {
playScales();
practiceSightReading();
doFingerExercises();
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment