@@ -11,18 +11,17 @@ using RhythmGameUtilities;
11
11
const int seconds = 5 ;
12
12
const int resolution = 192 ;
13
13
14
- var bpmChanges = new Dictionary < int , int >
14
+ var bpmChanges = new Tempo []
15
15
{
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 }
23
20
};
24
21
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 );
26
25
27
26
Console .WriteLine (ticks ); // 1408
28
27
```
@@ -41,11 +40,14 @@ int main()
41
40
const int seconds = 5;
42
41
const int resolution = 192;
43
42
44
- std::map<int, int > bpmChanges = {
43
+ std::vector<Tempo > bpmChanges = {
45
44
{0, 88000}, {3840, 112000}, {9984, 89600}, {22272, 112000},
46
45
{33792, 111500}, {34560, 112000}, {42240, 111980}};
47
46
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);
49
51
50
52
std::cout << ticks << std::endl; // 1408
51
53
@@ -62,13 +64,21 @@ func _ready() -> void:
62
64
var seconds = 5
63
65
var resolution = 192
64
66
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
+ ]
70
80
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 )
72
82
73
- print(ticks ) # 1408
83
+ print(current_position ) # 1408
74
84
```
0 commit comments