From 439c6f8eddcf3c40c8fd61923b991dffe5964845 Mon Sep 17 00:00:00 2001 From: Ravi Widnef <163608714+StopMotionEGames@users.noreply.github.com> Date: Tue, 24 Feb 2026 20:41:04 -0300 Subject: [PATCH 01/11] note preview when changing the key, vol and pan by scrolling over a note no longer ignores layer vol/pan Resolves #449 --- scripts/add_block_manual/add_block_manual.gml | 2 +- .../change_block_manual.gml | 2 +- scripts/control_draw/control_draw.gml | 32 +++++++++++++++---- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/scripts/add_block_manual/add_block_manual.gml b/scripts/add_block_manual/add_block_manual.gml index ae1a48df..d2f3aae0 100644 --- a/scripts/add_block_manual/add_block_manual.gml +++ b/scripts/add_block_manual/add_block_manual.gml @@ -68,7 +68,7 @@ function add_block_manual(argument0, argument1, argument2, argument3, argument4, if (xx >= songs[song].enda) songs[song].enda = xx if (yy >= songs[song].endb) songs[song].endb = yy - if (ins.loaded) play_sound(ins, key, vel, pan, pit) + if (ins.loaded) play_sound(ins, key, (songs[song].layervol[yy] / 100 ) * vel, (songs[song].layerstereo[yy] + pan) / 2, pit) history_set(h_addblock, xx, yy, ins, key, vel, pan, pit) var insname = songs[song].instrument_list[| ds_list_find_index(songs[song].instrument_list, ins)].name diff --git a/scripts/change_block_manual/change_block_manual.gml b/scripts/change_block_manual/change_block_manual.gml index 71b18227..c5d1bce4 100644 --- a/scripts/change_block_manual/change_block_manual.gml +++ b/scripts/change_block_manual/change_block_manual.gml @@ -25,7 +25,7 @@ function change_block_manual(argument0, argument1, argument2, argument3, argumen songs[song].song_pit[xx, yy] = pit } - if (ins.loaded) play_sound(ins, key, vel, pan, pit) + if (ins.loaded) play_sound(ins, key, (songs[song].layervol[yy] / 100 ) * vel, (songs[song].layerstereo[yy] + pan) / 2, pit) var insname = songs[song].instrument_list[| ds_list_find_index(songs[song].instrument_list, ins)].name if (insname = "Tempo Changer") { diff --git a/scripts/control_draw/control_draw.gml b/scripts/control_draw/control_draw.gml index 74314265..6637683f 100644 --- a/scripts/control_draw/control_draw.gml +++ b/scripts/control_draw/control_draw.gml @@ -1,6 +1,7 @@ function control_draw() { // control_draw() - var a, b, c, d, e, f, g, p, l, s, exist, str, str2, m, xx, x1, y1, x2, y2, iconcolor, showmenu, totalcols, totalrows, compx, prev, colr, note_offset; + var a, b, c, d, e, f, g, p, l, s, exist, str, str2, m, xx, x1, y1, x2, y2, iconcolor, showmenu, totalcols, totalrows, compx, prev, colr, note_offset, + preview_pan = 100, preview_vol = 100; var checkplaying = playing - playing_prev playing_prev = playing @@ -232,7 +233,11 @@ function control_draw() { selected_vel = 100 selected_pan = 100 selected_pit = 0 - play_sound(current_song.instrument, selected_key, 100 ,100, 0) + + preview_vol = (songs[song].layervol[selby] / 100 ) * selected_vel + preview_pan = (songs[song].layerstereo[selby] + selected_pan) / 2 + + play_sound(current_song.instrument, selected_key, preview_vol, preview_pan, 0) } if (mouse_wheel_up_dynamic() && insindex < ds_list_size(current_song.instrument_list) - 1) { insindex++ @@ -240,7 +245,11 @@ function control_draw() { selected_vel = 100 selected_pan = 100 selected_pit = 0 - play_sound(current_song.instrument, selected_key, 100 ,100, 0) + + preview_vol = (songs[song].layervol[selby] / 100 ) * selected_vel + preview_pan = (songs[song].layerstereo[selby] + selected_pan) / 2 + + play_sound(current_song.instrument, selected_key, preview_vol, preview_pan, 0) } } if (mousewheel = 2 && window = 0 && (exist = 0 || changepitch = 0) && !isplayer && !volume_scroll) { @@ -249,14 +258,22 @@ function control_draw() { selected_vel = 100 selected_pan = 100 selected_pit = 0 - play_sound(current_song.instrument, selected_key, 100 ,100, 0) + + preview_vol = (songs[song].layervol[selby] / 100 ) * selected_vel + preview_pan = (songs[song].layerstereo[selby] + selected_pan) / 2 + + play_sound(current_song.instrument, selected_key, preview_vol, preview_pan, 0) } if (mouse_wheel_up_dynamic() && selected_key < 87) { selected_key += 1 selected_vel = 100 selected_pan = 100 selected_pit = 0 - play_sound(current_song.instrument, selected_key, 100 ,100, 0) + + preview_vol = (songs[song].layervol[selby] / 100 ) * selected_vel + preview_pan = (songs[song].layerstereo[selby] + selected_pan) / 2 + + play_sound(current_song.instrument, selected_key, preview_vol, preview_pan, 0) } } @@ -475,12 +492,15 @@ function control_draw() { selected_vel = current_song.song_vel[selbx, selby] selected_pan = current_song.song_pan[selbx, selby] selected_pit = current_song.song_pit[selbx, selby] + + preview_vol = (songs[song].layervol[selby] / 100 ) * selected_vel + preview_pan = (songs[song].layerstereo[selby] + selected_pan) / 2 } else { selected_vel = 100 selected_pan = 100 selected_pit = 0 } - play_sound(current_song.instrument, selected_key, selected_vel, selected_pan, selected_pit) + play_sound(current_song.instrument, selected_key, preview_vol, preview_pan, selected_pit) } } From 5eba185781438afb51ab9dd4bf4160354c4e1530 Mon Sep 17 00:00:00 2001 From: Ravi Widnef <163608714+StopMotionEGames@users.noreply.github.com> Date: Thu, 26 Feb 2026 19:53:22 -0300 Subject: [PATCH 02/11] check if selby is in range and hovering a layer should use layer's vol/pan for note preview before calculate the vol/pan --- scripts/control_draw/control_draw.gml | 28 +++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/scripts/control_draw/control_draw.gml b/scripts/control_draw/control_draw.gml index 6637683f..4c68cff3 100644 --- a/scripts/control_draw/control_draw.gml +++ b/scripts/control_draw/control_draw.gml @@ -234,8 +234,11 @@ function control_draw() { selected_pan = 100 selected_pit = 0 - preview_vol = (songs[song].layervol[selby] / 100 ) * selected_vel - preview_pan = (songs[song].layerstereo[selby] + selected_pan) / 2 + preview_vol = (selby >= 0 && selby <= current_song.endb && !hoverlayer_scrollnote_preview) + ? (songs[song].layervol[selby] / 100 ) * selected_vel : 100 + + preview_pan = (selby >= 0 && selby <= current_song.endb && !hoverlayer_scrollnote_preview) + ? (songs[song].layerstereo[selby] + selected_pan) / 2 : 100 play_sound(current_song.instrument, selected_key, preview_vol, preview_pan, 0) } @@ -246,8 +249,11 @@ function control_draw() { selected_pan = 100 selected_pit = 0 - preview_vol = (songs[song].layervol[selby] / 100 ) * selected_vel - preview_pan = (songs[song].layerstereo[selby] + selected_pan) / 2 + preview_vol = (selby >= 0 && selby <= current_song.endb && !hoverlayer_scrollnote_preview) + ? (songs[song].layervol[selby] / 100 ) * selected_vel : 100 + + preview_pan = (selby >= 0 && selby <= current_song.endb && !hoverlayer_scrollnote_preview) + ? (songs[song].layerstereo[selby] + selected_pan) / 2 : 100 play_sound(current_song.instrument, selected_key, preview_vol, preview_pan, 0) } @@ -259,8 +265,11 @@ function control_draw() { selected_pan = 100 selected_pit = 0 - preview_vol = (songs[song].layervol[selby] / 100 ) * selected_vel - preview_pan = (songs[song].layerstereo[selby] + selected_pan) / 2 + preview_vol = (selby >= 0 && selby <= current_song.endb && !hoverlayer_scrollnote_preview) + ? (songs[song].layervol[selby] / 100 ) * selected_vel : 100 + + preview_pan = (selby >= 0 && selby <= current_song.endb && !hoverlayer_scrollnote_preview) + ? (songs[song].layerstereo[selby] + selected_pan) / 2 : 100 play_sound(current_song.instrument, selected_key, preview_vol, preview_pan, 0) } @@ -270,8 +279,11 @@ function control_draw() { selected_pan = 100 selected_pit = 0 - preview_vol = (songs[song].layervol[selby] / 100 ) * selected_vel - preview_pan = (songs[song].layerstereo[selby] + selected_pan) / 2 + preview_vol = (selby >= 0 && selby <= current_song.endb && !hoverlayer_scrollnote_preview) + ? (songs[song].layervol[selby] / 100 ) * selected_vel : 100 + + preview_pan = (selby >= 0 && selby <= current_song.endb && !hoverlayer_scrollnote_preview) + ? (songs[song].layerstereo[selby] + selected_pan) / 2 : 100 play_sound(current_song.instrument, selected_key, preview_vol, preview_pan, 0) } From ac435b518695f022f46d8532103b75c7f3bc532a Mon Sep 17 00:00:00 2001 From: Ravi Widnef <163608714+StopMotionEGames@users.noreply.github.com> Date: Fri, 27 Feb 2026 00:06:31 -0300 Subject: [PATCH 03/11] add checkbox option for vol/pan preview when hovering a layer --- scripts/draw_window_preferences/draw_window_preferences.gml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/draw_window_preferences/draw_window_preferences.gml b/scripts/draw_window_preferences/draw_window_preferences.gml index 4f95e7e0..c5a71f98 100644 --- a/scripts/draw_window_preferences/draw_window_preferences.gml +++ b/scripts/draw_window_preferences/draw_window_preferences.gml @@ -532,6 +532,7 @@ function draw_window_preferences() { if (draw_radiobox(x1 + 40, y1 + 110 + (theme = 3) * 22, mousewheel = 1, "Use mouse wheel to change instrument", "Use the mouse wheel to toggle between\nthe available instruments.")) mousewheel = 1 if (draw_radiobox(x1 + 40, y1 + 130 + (theme = 3) * 22, mousewheel = 2, "Use mouse wheel to change key", "Use the mouse wheel to toggle\nbetween the keys on the piano.")) mousewheel = 2 if (draw_checkbox(x1 + 40, y1 + 158 + (theme = 3) * 22, changepitch, "Change note properties when scrolling over notes", "Whether scrolling when hovering over a note should change its key,\nvelocity, panning or pitch, according to the currently selected edit mode.")) changepitch=!changepitch + if (draw_checkbox(x1 + 40, y1 + 186 + (theme = 3) * 22, hoverlayer_scrollnote_preview, "Volume/Panning preview relative to current hovered layer", "Whether the volume/panning preview should be relative\nto the layer you are hovering over.")) hoverlayer_scrollnote_preview=!hoverlayer_scrollnote_preview //draw_text_dynamic(x1 + 40, y1 + 178, "Tip: Hold Shift while scrolling over a note to change a whole octave,\nor fine-tune its velocity, panning or pitch.") if (theme = 3) draw_theme_font(font_info_med) draw_areaheader(x1 + 22, y1 + 220 + (theme = 3) * 22, 456, 105, "Piano") @@ -549,6 +550,7 @@ function draw_window_preferences() { if (draw_radiobox(x1 + 40, y1 + 110 + (theme = 3) * 22, mousewheel = 1, "使用鼠标滚轮改变音色", "使用鼠标滚轮切换可用音色。")) mousewheel = 1 if (draw_radiobox(x1 + 40, y1 + 130 + (theme = 3) * 22, mousewheel = 2, "使用鼠标滚轮改变音调", "使用鼠标滚轮改变目前使用的音调。")) mousewheel = 2 if (draw_checkbox(x1 + 40, y1 + 158 + (theme = 3) * 22, changepitch, "当在音符上使用鼠标滚轮改变音符属性", "在音符上使用鼠标滚轮时是否根据目前模式改变其音调、音量、声道或音高。")) changepitch=!changepitch + if (draw_checkbox(x1 + 40, y1 + 186 + (theme = 3) * 22, hoverlayer_scrollnote_preview, "相对于当前悬停图层的音量/平移预览", "音量/平移预览是否应相对于鼠标悬停的图层。")) hoverlayer_scrollnote_preview=!hoverlayer_scrollnote_preview //draw_text_dynamic(x1 + 40, y1 + 178, "Tip: Hold Shift while scrolling over a note to change a whole octave,\nor fine-tune its velocity, panning or pitch.") if (theme = 3) draw_theme_font(font_info_med) draw_areaheader(x1 + 22, y1 + 220 + (theme = 3) * 22, 456, 105, "琴键") From 4b7cc19e4d5565e14677b7c37359360dfc7a990c Mon Sep 17 00:00:00 2001 From: Ravi Widnef <163608714+StopMotionEGames@users.noreply.github.com> Date: Fri, 27 Feb 2026 00:07:25 -0300 Subject: [PATCH 04/11] initialize hoverlayer_scrollnote_preview in control_create sure, I'll find a better name to this variable --- scripts/control_create/control_create.gml | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/control_create/control_create.gml b/scripts/control_create/control_create.gml index 6ebaa1d9..b75160e4 100644 --- a/scripts/control_create/control_create.gml +++ b/scripts/control_create/control_create.gml @@ -395,6 +395,7 @@ function control_create() { mousewheel = 0 changepitch = 1 + hoverlayer_scrollnote_preview = 0 keynames = ["A", "A#", "B", "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#"]; keynames_flat = 0 From b6699c4a48ef84b2bab4d7a1ad09e0c5ab8831a0 Mon Sep 17 00:00:00 2001 From: Ravi Widnef <163608714+StopMotionEGames@users.noreply.github.com> Date: Fri, 27 Feb 2026 18:36:44 -0300 Subject: [PATCH 05/11] rename variable for hover layer note vol/pan preview --- scripts/control_create/control_create.gml | 2 +- scripts/control_draw/control_draw.gml | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/control_create/control_create.gml b/scripts/control_create/control_create.gml index b75160e4..bb951dc2 100644 --- a/scripts/control_create/control_create.gml +++ b/scripts/control_create/control_create.gml @@ -395,7 +395,7 @@ function control_create() { mousewheel = 0 changepitch = 1 - hoverlayer_scrollnote_preview = 0 + layerhov_vppreview = 0 keynames = ["A", "A#", "B", "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#"]; keynames_flat = 0 diff --git a/scripts/control_draw/control_draw.gml b/scripts/control_draw/control_draw.gml index 4c68cff3..bc0e730e 100644 --- a/scripts/control_draw/control_draw.gml +++ b/scripts/control_draw/control_draw.gml @@ -234,10 +234,10 @@ function control_draw() { selected_pan = 100 selected_pit = 0 - preview_vol = (selby >= 0 && selby <= current_song.endb && !hoverlayer_scrollnote_preview) + preview_vol = (selby >= 0 && selby <= current_song.endb && !layerhov_vppreview ) ? (songs[song].layervol[selby] / 100 ) * selected_vel : 100 - preview_pan = (selby >= 0 && selby <= current_song.endb && !hoverlayer_scrollnote_preview) + preview_pan = (selby >= 0 && selby <= current_song.endb && !layerhov_vppreview ) ? (songs[song].layerstereo[selby] + selected_pan) / 2 : 100 play_sound(current_song.instrument, selected_key, preview_vol, preview_pan, 0) @@ -249,10 +249,10 @@ function control_draw() { selected_pan = 100 selected_pit = 0 - preview_vol = (selby >= 0 && selby <= current_song.endb && !hoverlayer_scrollnote_preview) + preview_vol = (selby >= 0 && selby <= current_song.endb && !layerhov_vppreview ) ? (songs[song].layervol[selby] / 100 ) * selected_vel : 100 - preview_pan = (selby >= 0 && selby <= current_song.endb && !hoverlayer_scrollnote_preview) + preview_pan = (selby >= 0 && selby <= current_song.endb && !layerhov_vppreview ) ? (songs[song].layerstereo[selby] + selected_pan) / 2 : 100 play_sound(current_song.instrument, selected_key, preview_vol, preview_pan, 0) @@ -265,10 +265,10 @@ function control_draw() { selected_pan = 100 selected_pit = 0 - preview_vol = (selby >= 0 && selby <= current_song.endb && !hoverlayer_scrollnote_preview) + preview_vol = (selby >= 0 && selby <= current_song.endb && !layerhov_vppreview ) ? (songs[song].layervol[selby] / 100 ) * selected_vel : 100 - preview_pan = (selby >= 0 && selby <= current_song.endb && !hoverlayer_scrollnote_preview) + preview_pan = (selby >= 0 && selby <= current_song.endb && !layerhov_vppreview ) ? (songs[song].layerstereo[selby] + selected_pan) / 2 : 100 play_sound(current_song.instrument, selected_key, preview_vol, preview_pan, 0) @@ -279,10 +279,10 @@ function control_draw() { selected_pan = 100 selected_pit = 0 - preview_vol = (selby >= 0 && selby <= current_song.endb && !hoverlayer_scrollnote_preview) + preview_vol = (selby >= 0 && selby <= current_song.endb && !layerhov_vppreview ) ? (songs[song].layervol[selby] / 100 ) * selected_vel : 100 - preview_pan = (selby >= 0 && selby <= current_song.endb && !hoverlayer_scrollnote_preview) + preview_pan = (selby >= 0 && selby <= current_song.endb && !layerhov_vppreview ) ? (songs[song].layerstereo[selby] + selected_pan) / 2 : 100 play_sound(current_song.instrument, selected_key, preview_vol, preview_pan, 0) From 962ed7ce331dc6771ef03b1d446bb09690cfec9d Mon Sep 17 00:00:00 2001 From: Ravi Widnef <163608714+StopMotionEGames@users.noreply.github.com> Date: Fri, 27 Feb 2026 18:37:07 -0300 Subject: [PATCH 06/11] add option to enable/disable hover layer note vol/pan preview in Preferences window --- scripts/draw_window_preferences/draw_window_preferences.gml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/draw_window_preferences/draw_window_preferences.gml b/scripts/draw_window_preferences/draw_window_preferences.gml index c5a71f98..40bf90a6 100644 --- a/scripts/draw_window_preferences/draw_window_preferences.gml +++ b/scripts/draw_window_preferences/draw_window_preferences.gml @@ -532,7 +532,7 @@ function draw_window_preferences() { if (draw_radiobox(x1 + 40, y1 + 110 + (theme = 3) * 22, mousewheel = 1, "Use mouse wheel to change instrument", "Use the mouse wheel to toggle between\nthe available instruments.")) mousewheel = 1 if (draw_radiobox(x1 + 40, y1 + 130 + (theme = 3) * 22, mousewheel = 2, "Use mouse wheel to change key", "Use the mouse wheel to toggle\nbetween the keys on the piano.")) mousewheel = 2 if (draw_checkbox(x1 + 40, y1 + 158 + (theme = 3) * 22, changepitch, "Change note properties when scrolling over notes", "Whether scrolling when hovering over a note should change its key,\nvelocity, panning or pitch, according to the currently selected edit mode.")) changepitch=!changepitch - if (draw_checkbox(x1 + 40, y1 + 186 + (theme = 3) * 22, hoverlayer_scrollnote_preview, "Volume/Panning preview relative to current hovered layer", "Whether the volume/panning preview should be relative\nto the layer you are hovering over.")) hoverlayer_scrollnote_preview=!hoverlayer_scrollnote_preview + if (draw_checkbox(x1 + 40, y1 + 186 + (theme = 3) * 22, layerhov_vppreview , "Volume/Panning preview relative to current hovered layer", "Whether the volume/panning preview should be relative\nto the layer you are hovering over.")) layerhov_vppreview =!layerhov_vppreview //draw_text_dynamic(x1 + 40, y1 + 178, "Tip: Hold Shift while scrolling over a note to change a whole octave,\nor fine-tune its velocity, panning or pitch.") if (theme = 3) draw_theme_font(font_info_med) draw_areaheader(x1 + 22, y1 + 220 + (theme = 3) * 22, 456, 105, "Piano") @@ -550,7 +550,7 @@ function draw_window_preferences() { if (draw_radiobox(x1 + 40, y1 + 110 + (theme = 3) * 22, mousewheel = 1, "使用鼠标滚轮改变音色", "使用鼠标滚轮切换可用音色。")) mousewheel = 1 if (draw_radiobox(x1 + 40, y1 + 130 + (theme = 3) * 22, mousewheel = 2, "使用鼠标滚轮改变音调", "使用鼠标滚轮改变目前使用的音调。")) mousewheel = 2 if (draw_checkbox(x1 + 40, y1 + 158 + (theme = 3) * 22, changepitch, "当在音符上使用鼠标滚轮改变音符属性", "在音符上使用鼠标滚轮时是否根据目前模式改变其音调、音量、声道或音高。")) changepitch=!changepitch - if (draw_checkbox(x1 + 40, y1 + 186 + (theme = 3) * 22, hoverlayer_scrollnote_preview, "相对于当前悬停图层的音量/平移预览", "音量/平移预览是否应相对于鼠标悬停的图层。")) hoverlayer_scrollnote_preview=!hoverlayer_scrollnote_preview + if (draw_checkbox(x1 + 40, y1 + 186 + (theme = 3) * 22, layerhov_vppreview , "相对于当前悬停图层的音量/平移预览", "音量/平移预览是否应相对于鼠标悬停的图层。")) layerhov_vppreview =!layerhov_vppreview //draw_text_dynamic(x1 + 40, y1 + 178, "Tip: Hold Shift while scrolling over a note to change a whole octave,\nor fine-tune its velocity, panning or pitch.") if (theme = 3) draw_theme_font(font_info_med) draw_areaheader(x1 + 22, y1 + 220 + (theme = 3) * 22, 456, 105, "琴键") From 846432a966c5c685dcfd482cb959bcaf9fd13fbd Mon Sep 17 00:00:00 2001 From: Ravi Widnef <163608714+StopMotionEGames@users.noreply.github.com> Date: Fri, 27 Feb 2026 18:37:48 -0300 Subject: [PATCH 07/11] save/load hover layer note vol/pan preview option --- scripts/load_settings/load_settings.gml | 1 + scripts/save_settings/save_settings.gml | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/load_settings/load_settings.gml b/scripts/load_settings/load_settings.gml index 9a74191f..eb327ba8 100644 --- a/scripts/load_settings/load_settings.gml +++ b/scripts/load_settings/load_settings.gml @@ -47,6 +47,7 @@ function load_settings() { show_outofrange = ini_read_real( "preferences", "show_outofrange", show_outofrange) mousewheel = ini_read_real( "preferences", "mousewheel", mousewheel) changepitch = ini_read_real( "preferences", "change_pitch", changepitch) + layerhov_vppreview = ini_read_real( "preferences", "layerhov_vppreview", layerhov_vppreview) select_lastpressed = ini_read_real( "preferences", "select_lastpressed", select_lastpressed) marker_follow = ini_read_real( "preferences", "marker_follow", marker_follow) marker_pagebypage = ini_read_real( "preferences", "marker_pagebypage", marker_pagebypage) diff --git a/scripts/save_settings/save_settings.gml b/scripts/save_settings/save_settings.gml index 3c1f210d..8ea34215 100644 --- a/scripts/save_settings/save_settings.gml +++ b/scripts/save_settings/save_settings.gml @@ -45,6 +45,7 @@ function save_settings() { ini_write_real_clean("preferences", "show_outofrange", show_outofrange) ini_write_real_clean("preferences", "mousewheel", mousewheel) ini_write_real_clean("preferences", "change_pitch", changepitch) + ini_write_real_clean("preferences", "layerhov_vppreview", layerhov_vppreview) ini_write_real_clean("preferences", "select_lastpressed", select_lastpressed) ini_write_real_clean("preferences", "marker_follow", marker_follow) ini_write_real_clean("preferences", "marker_pagebypage", marker_pagebypage) From e42cc81195e9228bdc98f50f62eadac7740c2028 Mon Sep 17 00:00:00 2001 From: Ravi Widnef <163608714+StopMotionEGames@users.noreply.github.com> Date: Fri, 27 Feb 2026 18:41:51 -0300 Subject: [PATCH 08/11] fix checking for the vol/pan calcule for hover layer note vol/pan preview --- scripts/control_draw/control_draw.gml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/control_draw/control_draw.gml b/scripts/control_draw/control_draw.gml index bc0e730e..078bb7d1 100644 --- a/scripts/control_draw/control_draw.gml +++ b/scripts/control_draw/control_draw.gml @@ -234,10 +234,10 @@ function control_draw() { selected_pan = 100 selected_pit = 0 - preview_vol = (selby >= 0 && selby <= current_song.endb && !layerhov_vppreview ) + preview_vol = (selby >= 0 && selby <= current_song.endb && layerhov_vppreview) ? (songs[song].layervol[selby] / 100 ) * selected_vel : 100 - preview_pan = (selby >= 0 && selby <= current_song.endb && !layerhov_vppreview ) + preview_pan = (selby >= 0 && selby <= current_song.endb && layerhov_vppreview) ? (songs[song].layerstereo[selby] + selected_pan) / 2 : 100 play_sound(current_song.instrument, selected_key, preview_vol, preview_pan, 0) @@ -249,10 +249,10 @@ function control_draw() { selected_pan = 100 selected_pit = 0 - preview_vol = (selby >= 0 && selby <= current_song.endb && !layerhov_vppreview ) + preview_vol = (selby >= 0 && selby <= current_song.endb && layerhov_vppreview) ? (songs[song].layervol[selby] / 100 ) * selected_vel : 100 - preview_pan = (selby >= 0 && selby <= current_song.endb && !layerhov_vppreview ) + preview_pan = (selby >= 0 && selby <= current_song.endb && layerhov_vppreview) ? (songs[song].layerstereo[selby] + selected_pan) / 2 : 100 play_sound(current_song.instrument, selected_key, preview_vol, preview_pan, 0) @@ -265,10 +265,10 @@ function control_draw() { selected_pan = 100 selected_pit = 0 - preview_vol = (selby >= 0 && selby <= current_song.endb && !layerhov_vppreview ) + preview_vol = (selby >= 0 && selby <= current_song.endb && layerhov_vppreview) ? (songs[song].layervol[selby] / 100 ) * selected_vel : 100 - preview_pan = (selby >= 0 && selby <= current_song.endb && !layerhov_vppreview ) + preview_pan = (selby >= 0 && selby <= current_song.endb && layerhov_vppreview) ? (songs[song].layerstereo[selby] + selected_pan) / 2 : 100 play_sound(current_song.instrument, selected_key, preview_vol, preview_pan, 0) @@ -279,10 +279,10 @@ function control_draw() { selected_pan = 100 selected_pit = 0 - preview_vol = (selby >= 0 && selby <= current_song.endb && !layerhov_vppreview ) + preview_vol = (selby >= 0 && selby <= current_song.endb && layerhov_vppreview) ? (songs[song].layervol[selby] / 100 ) * selected_vel : 100 - preview_pan = (selby >= 0 && selby <= current_song.endb && !layerhov_vppreview ) + preview_pan = (selby >= 0 && selby <= current_song.endb && layerhov_vppreview) ? (songs[song].layerstereo[selby] + selected_pan) / 2 : 100 play_sound(current_song.instrument, selected_key, preview_vol, preview_pan, 0) From 33ab33127c8cee617e197b5e3134ef03d08d11da Mon Sep 17 00:00:00 2001 From: Ravi Widnef <163608714+StopMotionEGames@users.noreply.github.com> Date: Fri, 27 Feb 2026 19:02:01 -0300 Subject: [PATCH 09/11] change hover layer note vol/pan preview checkbox y position --- scripts/draw_window_preferences/draw_window_preferences.gml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/draw_window_preferences/draw_window_preferences.gml b/scripts/draw_window_preferences/draw_window_preferences.gml index 40bf90a6..f285720f 100644 --- a/scripts/draw_window_preferences/draw_window_preferences.gml +++ b/scripts/draw_window_preferences/draw_window_preferences.gml @@ -532,7 +532,7 @@ function draw_window_preferences() { if (draw_radiobox(x1 + 40, y1 + 110 + (theme = 3) * 22, mousewheel = 1, "Use mouse wheel to change instrument", "Use the mouse wheel to toggle between\nthe available instruments.")) mousewheel = 1 if (draw_radiobox(x1 + 40, y1 + 130 + (theme = 3) * 22, mousewheel = 2, "Use mouse wheel to change key", "Use the mouse wheel to toggle\nbetween the keys on the piano.")) mousewheel = 2 if (draw_checkbox(x1 + 40, y1 + 158 + (theme = 3) * 22, changepitch, "Change note properties when scrolling over notes", "Whether scrolling when hovering over a note should change its key,\nvelocity, panning or pitch, according to the currently selected edit mode.")) changepitch=!changepitch - if (draw_checkbox(x1 + 40, y1 + 186 + (theme = 3) * 22, layerhov_vppreview , "Volume/Panning preview relative to current hovered layer", "Whether the volume/panning preview should be relative\nto the layer you are hovering over.")) layerhov_vppreview =!layerhov_vppreview + if (draw_checkbox(x1 + 40, y1 + 178 + (theme = 3) * 22, layerhov_vppreview , "Volume/Panning preview relative to current hovered layer", "Whether the volume/panning preview should be relative\nto the layer you are hovering over.")) layerhov_vppreview =!layerhov_vppreview //draw_text_dynamic(x1 + 40, y1 + 178, "Tip: Hold Shift while scrolling over a note to change a whole octave,\nor fine-tune its velocity, panning or pitch.") if (theme = 3) draw_theme_font(font_info_med) draw_areaheader(x1 + 22, y1 + 220 + (theme = 3) * 22, 456, 105, "Piano") @@ -550,7 +550,7 @@ function draw_window_preferences() { if (draw_radiobox(x1 + 40, y1 + 110 + (theme = 3) * 22, mousewheel = 1, "使用鼠标滚轮改变音色", "使用鼠标滚轮切换可用音色。")) mousewheel = 1 if (draw_radiobox(x1 + 40, y1 + 130 + (theme = 3) * 22, mousewheel = 2, "使用鼠标滚轮改变音调", "使用鼠标滚轮改变目前使用的音调。")) mousewheel = 2 if (draw_checkbox(x1 + 40, y1 + 158 + (theme = 3) * 22, changepitch, "当在音符上使用鼠标滚轮改变音符属性", "在音符上使用鼠标滚轮时是否根据目前模式改变其音调、音量、声道或音高。")) changepitch=!changepitch - if (draw_checkbox(x1 + 40, y1 + 186 + (theme = 3) * 22, layerhov_vppreview , "相对于当前悬停图层的音量/平移预览", "音量/平移预览是否应相对于鼠标悬停的图层。")) layerhov_vppreview =!layerhov_vppreview + if (draw_checkbox(x1 + 40, y1 + 178 + (theme = 3) * 22, layerhov_vppreview , "相对于当前悬停图层的音量/平移预览", "音量/平移预览是否应相对于鼠标悬停的图层。")) layerhov_vppreview =!layerhov_vppreview //draw_text_dynamic(x1 + 40, y1 + 178, "Tip: Hold Shift while scrolling over a note to change a whole octave,\nor fine-tune its velocity, panning or pitch.") if (theme = 3) draw_theme_font(font_info_med) draw_areaheader(x1 + 22, y1 + 220 + (theme = 3) * 22, 456, 105, "琴键") From 67ec09501a677747583b46555d93fc08e72e5983 Mon Sep 17 00:00:00 2001 From: Ravi Widnef <163608714+StopMotionEGames@users.noreply.github.com> Date: Sat, 28 Feb 2026 00:29:49 -0300 Subject: [PATCH 10/11] reduce code duplication for change key/ins on scroll and preview Reduced the amout of times the volume/panning preview is calculated Reduced the amout of times the selected_vel/pan/pit is set to 100 or 0 --- scripts/control_draw/control_draw.gml | 93 +++++++++++---------------- 1 file changed, 36 insertions(+), 57 deletions(-) diff --git a/scripts/control_draw/control_draw.gml b/scripts/control_draw/control_draw.gml index 078bb7d1..5cafcb1c 100644 --- a/scripts/control_draw/control_draw.gml +++ b/scripts/control_draw/control_draw.gml @@ -225,68 +225,47 @@ function control_draw() { } } } - if (mousewheel = 1 && window = 0 && (exist = 0 || changepitch = 0) && !isplayer && !volume_scroll) { - var insindex = ds_list_find_index(current_song.instrument_list, current_song.instrument) - if (mouse_wheel_down_dynamic() && insindex > 0) { - insindex-- - current_song.instrument = current_song.instrument_list[| insindex] - selected_vel = 100 - selected_pan = 100 - selected_pit = 0 - - preview_vol = (selby >= 0 && selby <= current_song.endb && layerhov_vppreview) - ? (songs[song].layervol[selby] / 100 ) * selected_vel : 100 - preview_pan = (selby >= 0 && selby <= current_song.endb && layerhov_vppreview) - ? (songs[song].layerstereo[selby] + selected_pan) / 2 : 100 - - play_sound(current_song.instrument, selected_key, preview_vol, preview_pan, 0) - } - if (mouse_wheel_up_dynamic() && insindex < ds_list_size(current_song.instrument_list) - 1) { - insindex++ - current_song.instrument = current_song.instrument_list[| insindex] - selected_vel = 100 - selected_pan = 100 - selected_pit = 0 - - preview_vol = (selby >= 0 && selby <= current_song.endb && layerhov_vppreview) - ? (songs[song].layervol[selby] / 100 ) * selected_vel : 100 + // scroll to change the instument or key if enabled. Also check if user scrolled before continue + if (window = 0 && (mouse_wheel_down_dynamic() || mouse_wheel_up_dynamic()) && (exist = 0 || changepitch = 0) && !isplayer && !volume_scroll) { - preview_pan = (selby >= 0 && selby <= current_song.endb && layerhov_vppreview) - ? (songs[song].layerstereo[selby] + selected_pan) / 2 : 100 - - play_sound(current_song.instrument, selected_key, preview_vol, preview_pan, 0) - } - } - if (mousewheel = 2 && window = 0 && (exist = 0 || changepitch = 0) && !isplayer && !volume_scroll) { - if (mouse_wheel_down_dynamic() && selected_key > 0) { - selected_key -= 1 - selected_vel = 100 - selected_pan = 100 - selected_pit = 0 - - preview_vol = (selby >= 0 && selby <= current_song.endb && layerhov_vppreview) - ? (songs[song].layervol[selby] / 100 ) * selected_vel : 100 + selected_vel = 100 + selected_pan = 100 + selected_pit = 0 - preview_pan = (selby >= 0 && selby <= current_song.endb && layerhov_vppreview) - ? (songs[song].layerstereo[selby] + selected_pan) / 2 : 100 - - play_sound(current_song.instrument, selected_key, preview_vol, preview_pan, 0) - } - if (mouse_wheel_up_dynamic() && selected_key < 87) { - selected_key += 1 - selected_vel = 100 - selected_pan = 100 - selected_pit = 0 - - preview_vol = (selby >= 0 && selby <= current_song.endb && layerhov_vppreview) - ? (songs[song].layervol[selby] / 100 ) * selected_vel : 100 + var insindex = ds_list_find_index(current_song.instrument_list, current_song.instrument) - preview_pan = (selby >= 0 && selby <= current_song.endb && layerhov_vppreview) - ? (songs[song].layerstereo[selby] + selected_pan) / 2 : 100 + if (mouse_wheel_down_dynamic()) { + if (mousewheel = 1 && insindex > 0) { + insindex-- + current_song.instrument = current_song.instrument_list[| insindex] + } + + if (mousewheel = 2 && selected_key > 0) { + selected_key -= 1 + } + } + + if (mouse_wheel_up_dynamic()) { + if (mousewheel = 1 && insindex < ds_list_size(current_song.instrument_list) - 1) { + insindex++ + current_song.instrument = current_song.instrument_list[| insindex] + } + + if (mousewheel = 2 && selected_key < 87) { + selected_key += 1 + } + } + + preview_vol = + (selby >= 0 && selby <= current_song.endb && layerhov_vppreview) + ? (songs[song].layervol[selby] / 100 ) * selected_vel : 100 + + preview_pan = + (selby >= 0 && selby <= current_song.endb && layerhov_vppreview) + ? (songs[song].layerstereo[selby] + selected_pan) / 2 : 100 - play_sound(current_song.instrument, selected_key, preview_vol, preview_pan, 0) - } + play_sound(current_song.instrument, selected_key, preview_vol, preview_pan, 0) } // Draw note blocks From af713cc85f6c1e43cccf25e499a516a5d97daab8 Mon Sep 17 00:00:00 2001 From: Ravi Widnef <163608714+StopMotionEGames@users.noreply.github.com> Date: Sat, 28 Feb 2026 12:28:17 -0300 Subject: [PATCH 11/11] change option name and tooltip for layerhov_vppreview in Preferences window to be more consistent with other settings --- scripts/draw_window_preferences/draw_window_preferences.gml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/draw_window_preferences/draw_window_preferences.gml b/scripts/draw_window_preferences/draw_window_preferences.gml index f285720f..9d980171 100644 --- a/scripts/draw_window_preferences/draw_window_preferences.gml +++ b/scripts/draw_window_preferences/draw_window_preferences.gml @@ -532,7 +532,7 @@ function draw_window_preferences() { if (draw_radiobox(x1 + 40, y1 + 110 + (theme = 3) * 22, mousewheel = 1, "Use mouse wheel to change instrument", "Use the mouse wheel to toggle between\nthe available instruments.")) mousewheel = 1 if (draw_radiobox(x1 + 40, y1 + 130 + (theme = 3) * 22, mousewheel = 2, "Use mouse wheel to change key", "Use the mouse wheel to toggle\nbetween the keys on the piano.")) mousewheel = 2 if (draw_checkbox(x1 + 40, y1 + 158 + (theme = 3) * 22, changepitch, "Change note properties when scrolling over notes", "Whether scrolling when hovering over a note should change its key,\nvelocity, panning or pitch, according to the currently selected edit mode.")) changepitch=!changepitch - if (draw_checkbox(x1 + 40, y1 + 178 + (theme = 3) * 22, layerhov_vppreview , "Volume/Panning preview relative to current hovered layer", "Whether the volume/panning preview should be relative\nto the layer you are hovering over.")) layerhov_vppreview =!layerhov_vppreview + if (draw_checkbox(x1 + 40, y1 + 178 + (theme = 3) * 22, layerhov_vppreview , "Apply hovered layer's volume and panning to note preview sounds", "Whether the preview sound's volume and panning should be\nrelative to the layer the mouse is hovering over.")) layerhov_vppreview =!layerhov_vppreview //draw_text_dynamic(x1 + 40, y1 + 178, "Tip: Hold Shift while scrolling over a note to change a whole octave,\nor fine-tune its velocity, panning or pitch.") if (theme = 3) draw_theme_font(font_info_med) draw_areaheader(x1 + 22, y1 + 220 + (theme = 3) * 22, 456, 105, "Piano") @@ -550,7 +550,7 @@ function draw_window_preferences() { if (draw_radiobox(x1 + 40, y1 + 110 + (theme = 3) * 22, mousewheel = 1, "使用鼠标滚轮改变音色", "使用鼠标滚轮切换可用音色。")) mousewheel = 1 if (draw_radiobox(x1 + 40, y1 + 130 + (theme = 3) * 22, mousewheel = 2, "使用鼠标滚轮改变音调", "使用鼠标滚轮改变目前使用的音调。")) mousewheel = 2 if (draw_checkbox(x1 + 40, y1 + 158 + (theme = 3) * 22, changepitch, "当在音符上使用鼠标滚轮改变音符属性", "在音符上使用鼠标滚轮时是否根据目前模式改变其音调、音量、声道或音高。")) changepitch=!changepitch - if (draw_checkbox(x1 + 40, y1 + 178 + (theme = 3) * 22, layerhov_vppreview , "相对于当前悬停图层的音量/平移预览", "音量/平移预览是否应相对于鼠标悬停的图层。")) layerhov_vppreview =!layerhov_vppreview + if (draw_checkbox(x1 + 40, y1 + 178 + (theme = 3) * 22, layerhov_vppreview , "将悬停图层的音量和声像调整应用于音符预览声音", "预览声音的音量和声像定位是否应与鼠标悬停的图层相关。")) layerhov_vppreview =!layerhov_vppreview //draw_text_dynamic(x1 + 40, y1 + 178, "Tip: Hold Shift while scrolling over a note to change a whole octave,\nor fine-tune its velocity, panning or pitch.") if (theme = 3) draw_theme_font(font_info_med) draw_areaheader(x1 + 22, y1 + 220 + (theme = 3) * 22, 456, 105, "琴键")