@@ -11,18 +11,17 @@ using RhythmGameUtilities;
1111const int seconds = 5 ;
1212const int resolution = 192 ;
1313
14- var bpmChanges = new Dictionary < int , int >
14+ var bpmChanges = new Tempo []
1515{
16- { 0 , 88000 },
17- { 3840 , 112000 },
18- { 9984 , 89600 },
19- { 22272 , 112000 },
20- { 33792 , 111500 },
21- { 34560 , 112000 },
22- { 42240 , 111980 }
16+ new () { Position = 0 , BPM = 88000 }, new () { Position = 3840 , BPM = 112000 },
17+ new () { Position = 9984 , BPM = 89600 }, new () { Position = 22272 , BPM = 112000 },
18+ new () { Position = 33792 , BPM = 111500 }, new () { Position = 34560 , BPM = 112000 },
19+ new () { Position = 42240 , BPM = 111980 }
2320};
2421
25- var ticks = Utilities .ConvertSecondsToTicks (seconds , resolution , bpmChanges );
22+ var timeSignatureChanges = new TimeSignature [] { new () { Position = 0 , Numerator = 4 , Denominator = 2 } };
23+
24+ var ticks = Utilities .ConvertSecondsToTicks (seconds , resolution , bpmChanges , timeSignatureChanges );
2625
2726Console .WriteLine (ticks ); // 1408
2827```
@@ -41,11 +40,14 @@ int main()
4140 const int seconds = 5;
4241 const int resolution = 192;
4342
44- std::map<int, int > bpmChanges = {
43+ std::vector<Tempo > bpmChanges = {
4544 {0, 88000}, {3840, 112000}, {9984, 89600}, {22272, 112000},
4645 {33792, 111500}, {34560, 112000}, {42240, 111980}};
4746
48- auto ticks = ConvertSecondsToTicks(seconds, resolution, bpmChanges);
47+ std::vector<TimeSignature> timeSignatureChanges = {{0, 4, 2}};
48+
49+ auto ticks = ConvertSecondsToTicks(seconds, resolution, bpmChanges,
50+ timeSignatureChanges);
4951
5052 std::cout << ticks << std::endl; // 1408
5153
@@ -62,13 +64,21 @@ func _ready() -> void:
6264 var seconds = 5
6365 var resolution = 192
6466
65- var bpm_changes = {
66- 0: 88000, 3840: 112000, 9984: 89600,
67- 22272: 112000, 33792: 111500, 34560: 112000,
68- 42240: 111980
69- }
67+ var bpm_changes = [
68+ {"position": 0, "bpm": 8800 },
69+ {"position": 3840, "bpm": 112000 },
70+ {"position": 9984, "bpm": 89600 },
71+ {"position": 22272, "bpm": 112000 },
72+ {"position": 33792, "bpm": 111500 },
73+ {"position": 34560, "bpm": 112000 },
74+ {"position": 42240, "bpm": 111980 }
75+ ]
76+
77+ var time_signature_changes = [
78+ {"position": 0, "numerator": 4, "denominator": 2 }
79+ ]
7080
71- var ticks = rhythm_game_utilities.convert_seconds_to_ticks(seconds, resolution, bpm_changes)
81+ var current_position = rhythm_game_utilities.convert_seconds_to_ticks(seconds, resolution, bpm_changes, time_signature_changes )
7282
73- print(ticks ) # 1408
83+ print(current_position ) # 1408
7484```
0 commit comments