Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/show flat notes #418

Merged
merged 2 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,394 changes: 725 additions & 1,669 deletions Minecraft Note Block Studio.yyp

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions scripts/draw_notechart/draw_notechart.gml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
function draw_notechart(argument0, argument1, argument2, argument3) {
// draw_notechart(x, y, key, sharp)
var x1, xx, yy, key, sharp, a;
// draw_notechart(x, y, key, accidental)
var x1, xx, yy, key, accidental, a;
x1 = argument0
xx = median(0, x1 - 32, rw - 320)
yy = argument1
key = argument2
sharp = argument3
accidental = argument3
draw_sprite(spr_notechart, 0 + 3 * theme, xx, yy - 320 + 1)
draw_sprite(spr_notechart, (1 + (x1 > rw - 250)) + 3 * theme, x1 - 16 * (x1 > rw - 250), yy)

Expand All @@ -21,7 +21,8 @@ function draw_notechart(argument0, argument1, argument2, argument3) {
draw_line(xx + 32, yy - 250 + 16 * 6, xx + 32, yy - 250 + 16 * 10)
draw_sprite(spr_Gclef, 0, xx + 58, yy - 250 + 16 * 3)
draw_sprite(spr_Fclef, 0, xx + 48, yy - 250 + 16 * 7)
draw_sprite(spr_note, sharp + 2 * (key > 22), xx + 152, yy - 250 - 8 * (key - 33))
if (keynames_flat) draw_sprite(spr_note_flat, accidental + 2 * (key > 22), xx + 152, yy - 250 - 8 * (key - 33))
else draw_sprite(spr_note_sharp, accidental + 2 * (key > 22), xx + 152, yy - 250 - 8 * (key - 33))
if (key > 22 && key < 25) {
draw_set_alpha(0.25)
draw_line(xx + 122, yy - 250 + 16 * 5, xx + 180, yy - 250 + 16 * 5)
Expand Down
22 changes: 11 additions & 11 deletions scripts/draw_notechart/draw_notechart.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions scripts/draw_piano/draw_piano.gml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function draw_piano(argument0, argument1, argument2, argument3) {
k2 = show_keyboard && piano_key[c2] > 0
if (window = 0 && mouse_rectangle(xx + 39 * a, yy, 39, 128)) {
if (!mouse_rectangle(xx + 39 * a - 12, yy - 7, 25, 71) && (!mouse_rectangle(xx + 39 * a + 27, yy - 7, 25, 71) || (a = k - 1 || c = 1 || c = 4))) {
if (show_notechart && c2 > 6 && c2 < 69 && playing = 0 && !isplayer) draw_notechart(xx + 39 * a + 18, yy - 32, startkey + a, 0)
if (show_notechart && c2 > 6 && c2 < 69 && playing = 0 && !isplayer) draw_notechart(xx + 39 * a + 18, yy - 32, startkey + a, 0) //handle all white keys except C and F
if (mouse_check_button_pressed(mb_right) && show_keyboard) key_edit = c2
// Check mouse clicks
t = key_click[c2]
Expand All @@ -42,8 +42,9 @@ function draw_piano(argument0, argument1, argument2, argument3) {
key_click[c2] = 0
}
if (window = 0 && mouse_rectangle(xx + 39 * a - 12, yy - 7, 25, 71)) {
if (show_notechart && c1 > 6 && c1 < 70 && playing = 0 && !isplayer) draw_notechart(xx + 39 * a - 12 + 12, yy - 32, startkey + a - 1, 1)
if (mouse_check_button_pressed(mb_right) && show_keyboard) key_edit = c1
if (show_notechart && !keynames_flat && c1 > 6 && c1 < 70 && playing = 0 && !isplayer) draw_notechart(xx + 39 * a - 12 + 12, yy - 32, startkey + a - 1, 1) //handles all sharps
if (show_notechart && keynames_flat && c1 > 5 && c1 < 69 && playing = 0 && !isplayer) draw_notechart(xx + 39 * a - 12 + 12, yy - 32, startkey + a, 1) //handles all flats
if (mouse_check_button_pressed(mb_right) && show_keyboard) key_edit = c1
t = key_click[c1]
key_click[c1] = mouse_check_button(mb_left)
if (t = 0 && key_click[c1]) {
Expand Down Expand Up @@ -86,7 +87,7 @@ function draw_piano(argument0, argument1, argument2, argument3) {
k1 = (show_keyboard && piano_key[c1] > 0)
if (window = 0 && mouse_rectangle(xx + 39 * a, yy, 39, 128)) {
if (!mouse_rectangle(xx + 39 * a + 27, yy - 7, 25, 71) || (a = k - 1 || c = 1 || c = 4)) {
if (show_notechart && c1 > 6 && c1 < 69 && playing = 0) draw_notechart(xx + 39 * a + 18, yy - 32, startkey + a, 0)
if (show_notechart && c1 > 6 && c1 < 69 && playing = 0) draw_notechart(xx + 39 * a + 18, yy - 32, startkey + a, 0) //handles C and F
if (mouse_check_button_pressed(mb_right) && show_keyboard) key_edit = c1
t = key_click[c1]
key_click[c1] = mouse_check_button(mb_left)
Expand Down
22 changes: 11 additions & 11 deletions scripts/draw_piano/draw_piano.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

91 changes: 0 additions & 91 deletions sprites/spr_note/spr_note.yy

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
91 changes: 91 additions & 0 deletions sprites/spr_note_flat/spr_note_flat.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading