-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4121e17
commit e59017b
Showing
9 changed files
with
144 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
namespace Ensembles.Core { | ||
public class MetronomeLFOPlayer { | ||
string _lfo_directory_location; | ||
int _time_signature_n; | ||
int _time_signature_d; | ||
string _lfo_file_location; | ||
int _tempo = 120; | ||
public MetronomeLFOPlayer (string lfo_directory_location) { | ||
_lfo_directory_location = lfo_directory_location; | ||
metronome_lfo_player_init (); | ||
} | ||
~MetronomeLFOPlayer () { | ||
metronome_lfo_player_destruct (); | ||
} | ||
|
||
public void play_measure (int time_signature_n, int time_signature_d) { | ||
if (_time_signature_n != time_signature_n || _time_signature_d != time_signature_d) { | ||
_time_signature_n = time_signature_n; | ||
_time_signature_d = time_signature_d; | ||
_lfo_file_location = _lfo_directory_location + "/" + | ||
time_signature_n.to_string () + "_" + | ||
time_signature_d.to_string () + ".mtlfo"; | ||
metronome_lfo_player_change_base (_lfo_file_location, _tempo, 1920); | ||
} else { | ||
metronome_lfo_player_play (); | ||
} | ||
} | ||
|
||
public void set_tempo (int tempo) { | ||
_tempo = tempo; | ||
metronome_lfo_player_set_tempo (_tempo); | ||
} | ||
} | ||
} | ||
|
||
extern void metronome_lfo_player_init (); | ||
extern void metronome_lfo_player_destruct (); | ||
extern void metronome_lfo_player_change_base (string mid_file, int tempo, int eol); | ||
extern void metronome_lfo_player_play (); | ||
extern void metronome_lfo_player_set_tempo (int tempo); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters