Skip to content

Commit

Permalink
atoko | Metronome MediaMarker duration contributed by digits0801
Browse files Browse the repository at this point in the history
  • Loading branch information
atoko committed Sep 14, 2022
1 parent 304bd05 commit d9b930c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 94 deletions.
14 changes: 5 additions & 9 deletions src/main/java/com/utsusynth/utsu/engine/Metronome.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,15 @@ void attach(

List<Duration> generateMarkers(
double seconds,
double tempo
double bpm
) {

ArrayList<Duration> events = new ArrayList<>();
int ratio = Math.floorDiv((int)seconds * 1000, (int) 60000);
double beats = tempo * ratio;
double steps = seconds * ratio;
double bps = bpm * (1.0 / 60.0);
double ms_beat = (1.0 / bps) * (1000.0);

for (int i = 0; i < 200; i++) {
if (i * 1000 > seconds * 1000) {
break;
}
events.add(new Duration(i * 1000));
for (int i = 0; i < seconds * 1000; i+=ms_beat) {
events.add(new Duration(i));
}

return events;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public class PreferencesManager {
private BooleanProperty showVoicebankFaceTemp;
private BooleanProperty showVoicebankBodyTemp;

private BooleanProperty isMetronomeEnabled;

public PreferencesManager(
@SettingsPath File settingsPath,
DocumentBuilderFactory documentBuilderFactory,
Expand Down
85 changes: 0 additions & 85 deletions src/main/java/com/utsusynth/utsu/model/song/Metronome.java

This file was deleted.

0 comments on commit d9b930c

Please sign in to comment.