Skip to content

Commit 960d474

Browse files
committed
Add option to display tempo as BPM
The dragging mechanic was not changed, i.e. you can only drag in the increments you could before. That means the tempo will always increment in steps of 0.25, which in BPM corresponds to 3.75.
1 parent be04486 commit 960d474

File tree

9 files changed

+38
-4
lines changed

9 files changed

+38
-4
lines changed

scripts/control_create/control_create.gml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ playing = 0
6060
record = 0
6161
tempo = 10
6262
tempodrag = 10
63+
bpm = 0
64+
use_bpm = 0
6365
metronome = 0
6466
metronome_played = -1
6567
marker_pos = 0

scripts/control_draw/control_draw.gml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,9 +1231,17 @@ if (show_layers) {
12311231
popup_set(184, 57, 64, 22, "Position of the marker in bars, beats and sixteenths.")
12321232

12331233
// Tempo
1234-
draw_sprite(spr_tempobox, 0, 108, 57)
12351234
draw_set_halign(fa_center)
1236-
draw_text(136, 60, string_format(tempo, 4, 2) + " t / s")
1235+
if (use_bpm) {
1236+
draw_sprite(spr_tempobox, 1, 101, 57)
1237+
bpm = tempo * 15
1238+
draw_text(136, 60, string_format(bpm, 4, 2) + " BPM")
1239+
popup_set(108, 57, 64, 22, "Tempo of the song (measured in beats per minute).\nClick and drag to change. Right click to reset.")
1240+
} else {
1241+
draw_sprite(spr_tempobox, 0, 108, 57)
1242+
draw_text(136, 60, string_format(tempo, 4, 2) + " t / s")
1243+
popup_set(108, 57, 64, 22, "Tempo of the song (measured in ticks per second).\nClick and drag to change. Right click to reset.")
1244+
}
12371245
draw_set_halign(fa_left)
12381246
a = mouse_rectangle(108, 57, 64, 22)
12391247
popup_set(108, 57, 64, 22, "Tempo of the song (measured in ticks per second.)\nClick and drag to change. Right click to reset.")

scripts/load_settings/load_settings.gml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ marker_end = ini_read_real( "preferences", "marker_end", marker
3737
realvolume = ini_read_real( "preferences", "show_layer_volumes", realvolume)
3838
realstereo = ini_read_real( "preferences", "use_stereo", realstereo)
3939
looptobarend = ini_read_real( "preferences", "loop_to_bar_end", looptobarend)
40+
use_bpm = ini_read_real( "preferences", "use_bpm", use_bpm)
4041
save_version = ini_read_real( "preferences", "save_version", save_version)
4142

4243
// Midi import settings

scripts/save_settings/save_settings.gml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ ini_write_real_clean("preferences", "marker_end", marker_end)
3636
ini_write_real_clean("preferences", "show_layer_volumes", realvolume)
3737
ini_write_real_clean("preferences", "use_stereo", realstereo)
3838
ini_write_real_clean("preferences", "loop_to_bar_end", looptobarend)
39+
ini_write_real_clean("preferences", "use_bpm", use_bpm)
3940
ini_write_real_clean("preferences", "save_version", save_version)
4041

4142
// Midi import settings
40 Bytes
Loading
167 Bytes
Loading
40 Bytes
Loading
167 Bytes
Loading

sprites/spr_tempobox/spr_tempobox.yy

Lines changed: 24 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)