Skip to content

Commit dd96a16

Browse files
committed
Keep track of blocks with fine pitch tuning
This is for a future addition in the Compatibility window to transpose notes inside the ±100 pitch range.
1 parent f945ba2 commit dd96a16

File tree

11 files changed

+14
-1
lines changed

11 files changed

+14
-1
lines changed

scripts/add_block/add_block.gml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ if (!insnum) {
5151
if (ins.user) block_custom += 1
5252
}
5353
if (key < 33 || key > 57) block_outside += 1
54+
if (pit != 0) block_pitched += 1
5455
totalblocks += 1
5556

5657
if (colfirst[xx] = -1 || yy < colfirst[xx]) colfirst[xx] = yy

scripts/add_block_manual/add_block_manual.gml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ rowamount[yy] += 1
5353
ins.num_blocks++
5454
if (key < 33 || key > 57) block_outside += 1
5555
if (ins.user) block_custom += 1
56+
if (pit != 0) block_pitched += 1
5657
totalblocks += 1
5758
changed = 1
5859
work_add += 1

scripts/add_block_select/add_block_select.gml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ rowamount[yy] += 1
4444
ins.num_blocks++
4545
if (key < 33 || key > 57) block_outside += 1
4646
if (ins.user) block_custom += 1
47+
if (pit != 0) block_pitched += 1
4748
totalblocks += 1
4849

4950
if (colfirst[xx] = -1 || yy < colfirst[xx]) colfirst[xx] = yy

scripts/calculate_size/calculate_size.gml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ if (block_outside > 0) {
55
if (block_custom > 0) {
66
if (!question("Some note blocks have a custom instrument assigned to them. Export anyway?", "Minecraft Compatibility")) return 0
77
}
8+
if (block_pitched > 0) {
9+
if (!question("Some note blocks have fine pitch tuning, which isn't supported in note blocks. Export anyway?", "Minecraft Compatibility")) return 0
10+
}
811
if (tempo != 10 && tempo != 5 && tempo != 2.5) {
912
message("The tempo of the song is not compatible with Minecraft. As a result, the playback speed of the song in-game will differ from the one in the program.", "Tempo")
1013
}

scripts/change_block_manual/change_block_manual.gml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ history_set(h_changeblock, xx, yy, ins, key, vel, pan, pit, pins, pkey, pvel, pp
2424
changed = 1
2525
if (pkey >= 33 && pkey <= 57 && (key < 33 || key > 57)) block_outside += 1
2626
if (key >= 33 && key <= 57 && (pkey < 33 || pkey > 57)) block_outside -= 1
27+
if (ppit = 0 && pit != 0) block_pitched += 1
28+
if (ppit != 0 && pit = 0) block_pitched -= 1

scripts/control_create/control_create.gml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ song_played[0, 0] = 0
9999
song_added[0, 0] = 0
100100
block_outside = 0
101101
block_custom = 0
102+
block_pitched = 0
102103
midi_devices = 0
103104

104105
colamount[0] = 0

scripts/control_draw/control_draw.gml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ remove_emitters()
2121

2222
if (selected = 0) {
2323
if (block_outside = 0 && block_custom = 0) {
24-
if (tempo = 10 || tempo = 5 || tempo = 2.5) compatible = 1
24+
if ((tempo = 10 || tempo = 5 || tempo = 2.5) && block_pitched = 0) compatible = 1
2525
else compatible = 2
2626
} else compatible = 0
2727
}

scripts/remove_block/remove_block.gml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ song_exists[xx, yy] = 0
88
song_ins[xx, yy].num_blocks--
99
if (song_key[xx, yy] < 33 || song_key[xx, yy] > 57) block_outside -= 1
1010
if (song_ins[xx, yy].user) block_custom -= 1
11+
if (song_pit[xx, yy] != 0) block_pitched -= 1
1112
song_ins[xx, yy] = 0
1213
song_key[xx, yy] = 0
1314
song_vel[xx, yy] = 0

scripts/remove_block_manual/remove_block_manual.gml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pit = song_pit[xx, yy]
1313
ins.num_blocks--
1414
if (song_key[xx, yy] < 33 || song_key[xx, yy] > 57) block_outside -= 1
1515
if (ins.user) block_custom -= 1
16+
if (song_pit[xx, yy] != 0) block_pitched -= 1
1617
song_ins[xx, yy] = 0
1718
song_key[xx, yy] = 0
1819
song_vel[xx, yy] = 0

scripts/remove_block_select/remove_block_select.gml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ song_exists[xx, yy] = 0
88
song_ins[xx, yy].num_blocks--
99
if (song_key[xx, yy] < 33 || song_key[xx, yy] > 57) block_outside -= 1
1010
if (song_ins[xx, yy].user) block_custom -= 1
11+
if (song_pit[xx, yy] != 0) block_pitched -= 1
1112

1213
song_ins[xx, yy] = 0
1314
song_key[xx, yy] = 0

0 commit comments

Comments
 (0)