Skip to content

Commit

Permalink
fixed tempo slider bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
moxious committed Jan 2, 2018
1 parent 4ce6eb0 commit de84620
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/components/HummerControls.js
Expand Up @@ -24,11 +24,19 @@ export default class HummerControls extends React.Component {
started: true,
tempoLabel: `Tempo: ${props.app.conductor.getTempo()} BPM`,
};

props.app.conductor.register(this);
}

adjustTempo(factor) {
const tempo = this.state.app.conductor.getTempo() * factor;
this.state.app.conductor.setTempo(Math.floor(tempo));
/** Notify us of conductor changes so we can update state. */
onConductorChange(property, value, conductor) {
if (property === 'tempo') {
this.setState({
tempo: value,
tempoLabel: `Tempo: ${this.state.app.conductor.getTempo()} BPM`,
});
// console.log('State sync to conductor tempo ', value);
}
}

arpeggiate() {
Expand All @@ -46,13 +54,15 @@ export default class HummerControls extends React.Component {
}

handleOpenMenu() {
console.log('Setting menu');
// console.log('Setting menu');
this.setState({
openMenu: true,
});
}

handleTempoSlider = (event, value) => {
// console.log('Tempo slider: ', value, 'against present ', this.state.tempo,
// 'and conductor', this.state.app.conductor.getTempo());
this.setState({
tempo: value,
tempoLabel: `Tempo: ${this.state.app.conductor.getTempo()} BPM`,
Expand Down

0 comments on commit de84620

Please sign in to comment.