|
@@ -47,6 +47,7 @@ export class PlaybackManager implements IPlaybackParametersListener {
|
|
this.listeners.push(listener);
|
|
this.listeners.push(listener);
|
|
}
|
|
}
|
|
private readonly percussionChannel: number = 10; // this is a definition of the midi interface (cannot be changed)
|
|
private readonly percussionChannel: number = 10; // this is a definition of the midi interface (cannot be changed)
|
|
|
|
+ private readonly metronomeChannel: number = 9;
|
|
private messageViewer: IMessageViewer;
|
|
private messageViewer: IMessageViewer;
|
|
private audioMetronomePlayer: IAudioMetronomePlayer;
|
|
private audioMetronomePlayer: IAudioMetronomePlayer;
|
|
private audioPlayer: IAudioPlayer<any>;
|
|
private audioPlayer: IAudioPlayer<any>;
|
|
@@ -70,8 +71,8 @@ export class PlaybackManager implements IPlaybackParametersListener {
|
|
private freeMidiChannels: number[] = [];
|
|
private freeMidiChannels: number[] = [];
|
|
private notesToStop: Dictionary<Fraction, ChannelNote[]> = new Dictionary<Fraction, ChannelNote[]>();
|
|
private notesToStop: Dictionary<Fraction, ChannelNote[]> = new Dictionary<Fraction, ChannelNote[]>();
|
|
|
|
|
|
- private metronomeNote: ChannelNote = new ChannelNote(88, this.percussionChannel);
|
|
|
|
- private metronomeNoteFirstBeat: ChannelNote = new ChannelNote(64, this.percussionChannel);
|
|
|
|
|
|
+ private metronomeNote: ChannelNote = new ChannelNote(88, this.metronomeChannel);
|
|
|
|
+ private metronomeNoteFirstBeat: ChannelNote = new ChannelNote(64, this.metronomeChannel);
|
|
|
|
|
|
|
|
|
|
private currentMeasure: SourceMeasure = undefined;
|
|
private currentMeasure: SourceMeasure = undefined;
|
|
@@ -284,6 +285,9 @@ export class PlaybackManager implements IPlaybackParametersListener {
|
|
this.audioPlayer.open(uniqueMidiInstruments, 16);
|
|
this.audioPlayer.open(uniqueMidiInstruments, 16);
|
|
// set drums:
|
|
// set drums:
|
|
this.audioPlayer.setSound(this.percussionChannel, MidiInstrument.Percussion);
|
|
this.audioPlayer.setSound(this.percussionChannel, MidiInstrument.Percussion);
|
|
|
|
+ // TODO might be unnecessary to use another channel,
|
|
|
|
+ // if we find sounds in the percussion channel that match these for metronomeNote (88 and 64 for woodblock):
|
|
|
|
+ this.audioPlayer.setSound(this.metronomeChannel, MidiInstrument.Woodblock);
|
|
}
|
|
}
|
|
|
|
|
|
this.currentReferenceBPM = this.sheetStartBPM = musicSheet.getExpressionsStartTempoInBPM();
|
|
this.currentReferenceBPM = this.sheetStartBPM = musicSheet.getExpressionsStartTempoInBPM();
|