From aed5f02318eb2d80731b29f0e82d338c6c3629cd Mon Sep 17 00:00:00 2001 From: Bentroen Date: Thu, 23 Jan 2020 17:54:38 -0300 Subject: [PATCH 1/9] Prevent auto-saving while song is playing This causes a lag spike which disrupts a smooth song playback. --- scripts/control_draw/control_draw.gml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/control_draw/control_draw.gml b/scripts/control_draw/control_draw.gml index cddb29f7c..92fdbbc59 100644 --- a/scripts/control_draw/control_draw.gml +++ b/scripts/control_draw/control_draw.gml @@ -52,13 +52,13 @@ if (key_edit > -1) { // Autosave if (autosave && filename_ext(filename) = ".nbs") { tonextsave -= 1 / room_speed / 60 - if (tonextsave <= 0) save_song(filename) + if (tonextsave <= 0 && playing == 0) save_song(filename) } // Auto-recovery if (totalblocks > 0) { tonextbackup -= 1 / room_speed / 60 - if (tonextbackup <= 0) { + if (tonextbackup <= 0 && playing == 0) { save_song(backup_file, true) tonextbackup = backupmins } From 67b47eb340aef4a3581304d78d2eb9ac79a66154 Mon Sep 17 00:00:00 2001 From: Bentroen Date: Thu, 23 Jan 2020 18:01:02 -0300 Subject: [PATCH 2/9] Fix scrollbar being drawn outside the screen area The calculation for the amount of columns wasn't taking into consideration the width of the scrollbar, which, in specific window resolutions, would cause it to be rendered too far to the right - thus making it inaccessible. To prevent this, I'm now subtracting half of the width of the scrollbar (8). Subtracting the full width (16) would cause too much useful space to be wasted just so the scrollbar is fully rendered (a full column could be drawn in the space it occupies). Subtracting *half* of the width, half of the width is as hidden as it can get. --- scripts/control_draw/control_draw.gml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/control_draw/control_draw.gml b/scripts/control_draw/control_draw.gml index 92fdbbc59..bfdda5846 100644 --- a/scripts/control_draw/control_draw.gml +++ b/scripts/control_draw/control_draw.gml @@ -74,9 +74,9 @@ if (theme = 2) iconcolor = c_white // Calculate area if (show_layers) { - totalcols = floor((rw - 270) / 32) + totalcols = floor((rw - 8 - 270) / 32) } else { - totalcols = floor(rw / 32) + totalcols = floor((rw - 8) / 32) } rhval = 270 if (!show_piano) { From ca262c8f6622e3b3389ba723a6f9c8c6edfd9d23 Mon Sep 17 00:00:00 2001 From: Bentroen Date: Thu, 23 Jan 2020 18:10:37 -0300 Subject: [PATCH 3/9] Fix replacing note with custom instrument not triggering compatibility check Fixes #88 --- scripts/change_block_manual/change_block_manual.gml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/change_block_manual/change_block_manual.gml b/scripts/change_block_manual/change_block_manual.gml index 69397df5b..c04582cd4 100644 --- a/scripts/change_block_manual/change_block_manual.gml +++ b/scripts/change_block_manual/change_block_manual.gml @@ -22,6 +22,9 @@ if (ins.loaded) play_sound(ins, key, vel, pan, pit) history_set(h_changeblock, xx, yy, ins, key, vel, pan, pit, pins, pkey, pvel, ppan, ppit) changed = 1 + +if (!pins.user && ins.user) block_custom += 1 +if (pins.user && !ins.user) block_custom -= 1 if (pkey >= 33 && pkey <= 57 && (key < 33 || key > 57)) block_outside += 1 if (key >= 33 && key <= 57 && (pkey < 33 || pkey > 57)) block_outside -= 1 if (ppit = 0 && pit != 0) block_pitched += 1 From 03b2a788e86236979aa75f839590dacba7623e5d Mon Sep 17 00:00:00 2001 From: Bentroen Date: Thu, 23 Jan 2020 20:23:09 -0300 Subject: [PATCH 4/9] Fix notes in the first tick of a song not playing when selected Fixes #47 CAUSE: To know when to play a column, the program checks when floor(marker_prevpos) != floor(marker_pos) (these variables correspond to the position of the marker in the previous frame and in the current frame, respectively). When the marker is at the absolute beginning of the song, its position is 0. Making its way to tick 1 of the song (second column), it will increase to one and that condition will only be met on the second tick, where pos and prevpos will be, for example, 1 and 0.9 [floor(1) != floor(0.9)]. That will never be true for the first tick of the song, since floor(<1) = 0, and, as such, it's never played. SOLUTION: An explicit check for the marker being in the beginning of the song AND marker_pos and prevpos being different (meaning you just started playing the song or dragged the marker) was added to the condition. This is not ideal, as it adds another check every tick in the song for something that only happens at the beginning. Ideally, there should be an overhaul in the program to set the marker position to -1 (or something like that) when the marker is at the beginning of the song. --- scripts/selection_draw/selection_draw.gml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/selection_draw/selection_draw.gml b/scripts/selection_draw/selection_draw.gml index 8d0854593..d1e86c561 100644 --- a/scripts/selection_draw/selection_draw.gml +++ b/scripts/selection_draw/selection_draw.gml @@ -11,7 +11,7 @@ w = argument2 h = argument3 draw_set_halign(fa_center) // Play -if (floor(marker_pos) != floor(marker_prevpos) && marker_pos >= selection_x && marker_pos < selection_x + selection_l) { +if ((floor(marker_pos) != floor(marker_prevpos) || (marker_prevpos == 0 && marker_pos != marker_prevpos)) && marker_pos >= selection_x && marker_pos < selection_x + selection_l) { xx = floor(marker_pos) - selection_x if (selection_colfirst[xx] > -1) { for (b = selection_colfirst[xx]; b <= selection_collast[xx]; b += 1) { From cc1e544e28d623d69fde27f9e0d5b280e8e81de8 Mon Sep 17 00:00:00 2001 From: Bentroen Date: Tue, 18 Feb 2020 02:53:24 -0300 Subject: [PATCH 5/9] Fix key C8 not being playable via keyboard shortcut Fixes #128 --- scripts/draw_piano/draw_piano.gml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/draw_piano/draw_piano.gml b/scripts/draw_piano/draw_piano.gml index b9d569a03..04dcd390e 100644 --- a/scripts/draw_piano/draw_piano.gml +++ b/scripts/draw_piano/draw_piano.gml @@ -171,7 +171,7 @@ if (d = 1 && !mouse_check_button(mb_left)) { } // Check key presses if (window = 0 && text_focus = -1 && key_edit = -1 && !keyboard_check(vk_control)) { -for (a = 0 ;a < 87; a += 1) { +for (a = 0; a <= 87; a += 1) { if (piano_key[a] > 0) { if (key_press[a] = 0 && keyboard_check(piano_key[a])) { if (select_lastpressed) selected_key = a From 990efe449820fe2f82e161ff51ae862dfc78e149 Mon Sep 17 00:00:00 2001 From: Bentroen Date: Tue, 18 Feb 2020 03:17:06 -0300 Subject: [PATCH 6/9] Expand text box limit from 200 to 10,000 Prevents the program from crashing when reaching layer 200 due to running out of free text boxes. Fixes #92. It will still crash on layer ~10,000, so a proper fix must still be applied (for example, preventing the user from scrolling at all beyond the 10,000th layer). --- scripts/control_create/control_create.gml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/control_create/control_create.gml b/scripts/control_create/control_create.gml index 06c9abeee..1613d11b0 100644 --- a/scripts/control_create/control_create.gml +++ b/scripts/control_create/control_create.gml @@ -78,7 +78,7 @@ section_exists = 0 section_start = 0 section_end = 0 timeline_pressa = -1 -for (a = 0; a < 200; a += 1) text_exists[a] = 0 +for (a = 0; a < 10000; a += 1) text_exists[a] = 0 // Note blocks starta = 0 From 2da2add7ac417d12a5961524e84f1cc8b98a7f86 Mon Sep 17 00:00:00 2001 From: Bentroen Date: Thu, 27 Feb 2020 01:28:15 -0300 Subject: [PATCH 7/9] Improve changelist window Added a box around changelog content and resized the scrollbar to span the whole height --- scripts/draw_window_update/draw_window_update.gml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/draw_window_update/draw_window_update.gml b/scripts/draw_window_update/draw_window_update.gml index 253f62863..d509ceaf4 100644 --- a/scripts/draw_window_update/draw_window_update.gml +++ b/scripts/draw_window_update/draw_window_update.gml @@ -8,6 +8,7 @@ if (window = w_update) draw_text(x1 + 8, y1 + 8, "Update") else draw_text(x1 + 8, y1 + 8, "Changelist") draw_set_font(fnt_main) if (window = w_update) draw_text(x1 + 32, y1 + 32, "Thank you for upgrading to version " + version + "!") +draw_area(x1 + 16, y1 + 58, x1 + 487, y1 + 310) fullstr = "" fullstr += "Changes in v3.7.1 (2020.01.20):\n* Added an auto-updater. When a new version is available, Note Block Studio\nwill now be able to download and install it automatically. You don't even need\nto open your browser!\n* Pressing Shift while clicking 'Select all note blocks in this layer' will add those\nnotes to the selection rather than clearing it.\n* Holding Shift while dragging layer volumes/stereo will change them in\nincrements of 1, allowing a finer control.\n* Note panning is now prioritized over layer panning. Layers that haven't had\ntheir panning changed will not have any effect on note panning.\n* Re-added the option to import instruments from another song.\n* Bugfixes and improvements:\n * Fixed layer volume and stereo controls being too sensitive.\n * Fixed selection being automatically cleared once every minute.\n * Fixed contents of macro windows not being shown in some circumstances,\nforcing you to quit the program.\n * Fixed MIDI import setting pitch of all notes to +1.\n * Fixed lower notes not playing all the way through/stopping too early.\n * Fixed note count on 'Song stats' not being reset when creating a new song\n(and showing wrong percentages).\n * Fixed a crash when redoing a manual block placement.\n * Fixed a crash when opening the program with the greeting window disabled.\n * Fixed long recent file names overflowing the greeting window.\n * Fixed song area height being calculated incorrectly when the piano is\ndisabled.\n * Improved contrast of various pieces of text in the dark theme.\n * Removed the ability to drag the layer stereo controls with a window open.\n\n" fullstr += "Changes in v3.7.0 (2019.12.31):\n* Added a cool demo song to showcase the new features in 3.7.0!\n* It's now possible to set velocity, panning and detune on each individual note.\n* Added a metronome.\n* Added an option to display tempo as BPM rather than t/s.\n* Auto-save is now a global preference rather than being saved per song.\n* Added an auto-recovery feature so work is not lost if the program crashes.\n* Added Patterns. You can export note block data as a pattern, and import it\ninto whatever song you wish.\n* Note block songs now save song looping.\n* Added a bars/beats/sixteenths display.\n* Added lines that mark each bar in a song.\n* Added an option to choose if looping should wait for the end of the bar.\n* Added an option to show or hide layer boxes.\n* Added four edit modes, which allow you to change different properties of\nnotes (key/velocity/panning/pitch).\n* Holding Shift while scrolling over a note will change a whole octave, or\nfine-tune its velocity/panning/pitch.\n* Added Macros:\n(Accessible by right-clicking a selection, or from the new macro bar)\n * Tremolo\n * Stereo\n * Arpeggio\n * Portamento\n * Vibrato\n * Stagger\n * Chorus\n * Volume LFO\n * Fade in\n * Fade out\n * Replace key\n * Set velocity\n * Set panning\n * Set pitch\n* Added branch export, a new layout for exporting as schematics.\n* Added a metronome function.\n* Added layer management buttons (shift layers up and down, insert, delete).\n* Added a secret clipboard editor for power users.\n* (Slightly) Improved MIDI import, and made it support note velocity.\n* Improved data pack performance; impact on tick rate should be negligible.\n* Data packs can now export notes outside the octave range by providing\na resource pack.\n* Data packs can now be exported as ZIP.\n* Data packs now allow any tempo to be imported into Minecraft.\n* It's now possible to set a custom namespace and path for data pack functions.\n* Added six types of visualizers to data packs.\n* Double-clicking a NBS file will now open the song.\n* Added the ability to export songs in previous NBS format versions\nvia the Save Options window.\n* Note Block Studio will now refuse to load NBS versions made in the future.\n* NBS format updated to version 4.\n* Improved contrast of layer icons in dark theme.\n* Prevented dragging layer stereo from changing the song tempo.\n* Fixed 'Keys to show' resetting to 20 when enabling the piano.\n* Fixed crash in MP3 and data pack export.\n* Fixed crash on opening after updating.\n* Fixed memory leak from audio emitters piling up.\n\n" @@ -37,14 +38,14 @@ for (a = 0; a < n; a += 1) { if (string_char_at(str[a], 1) = "C") strb[a] = 1 fullstr = string_delete(fullstr, 1, string_pos("\n", fullstr)) } -for (a = sb_val[update_scrollbar]; a < sb_val[update_scrollbar] + 14; a += 1) { +for (a = sb_val[update_scrollbar]; a < sb_val[update_scrollbar] + 15; a += 1) { if (a >= n) break if (strb[a]) draw_set_font(fnt_mainbold) else draw_set_font(fnt_main) draw_text(x1 + 32, y1 + 64 + 16 * (a - sb_val[update_scrollbar]), str[a]) } draw_set_font(fnt_main) -draw_scrollbar(update_scrollbar, x1 + 474, y1 + 64, 12, 14, n, 0, 1) +draw_scrollbar(update_scrollbar, x1 + 470, y1 + 60, 12, 18, n, 0, 1) if (draw_button2(x1 + 220, y1 + 340, 72, "OK")) { if (window = w_update) { window = w_greeting From 7f198d36544fe0cc0fbd453855b99d7f58a219d8 Mon Sep 17 00:00:00 2001 From: Bentroen Date: Thu, 27 Feb 2020 01:30:57 -0300 Subject: [PATCH 8/9] Change schematic Minecraft version selector to not include 1.13 Was previously displaying 1.11+, which incorrectly indicated that any version after 1.11 is compatible. Currently, 1.13+ is not supported. --- .../draw_window_schematic_export.gml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/draw_window_schematic_export/draw_window_schematic_export.gml b/scripts/draw_window_schematic_export/draw_window_schematic_export.gml index 59cfc1787..59d5ca277 100644 --- a/scripts/draw_window_schematic_export/draw_window_schematic_export.gml +++ b/scripts/draw_window_schematic_export/draw_window_schematic_export.gml @@ -72,7 +72,7 @@ if (selected_tab_sch = 0) { if (draw_radiobox(x1 + 32, y1 + 240, sch_exp_layout = 1, "Simple walkway", "Generate a simple walkway that stretches\nas far as the length of the song.")) sch_exp_layout = 1 if (draw_radiobox(x1 + 32, y1 + 260, sch_exp_layout = 0, "Circular walkway", "Generate a walkway where the\nplayer travels back and forth.")) sch_exp_layout = 0 draw_text(x1 + 16, y1 + 290, "For Minecraft version:") - if (draw_radiobox(x1 + 32, y1 + 310, !sch_exp_minecraft_old, "1.11+", "Create a Schematic that is compatible with\nnew Minecraft versions only, starting at 1.11.")) sch_exp_minecraft_old = false + if (draw_radiobox(x1 + 32, y1 + 310, !sch_exp_minecraft_old, "1.11-1.12", "Create a Schematic that is compatible with 1.11 or 1.12.\nNOTE: Support for versions 1.13+ is coming soon.")) sch_exp_minecraft_old = false if (draw_radiobox(x1 + 32, y1 + 330, sch_exp_minecraft_old, "pre 1.11", "Create a Schematic that is compatible with\nold Minecraft versions only, before 1.11.")) sch_exp_minecraft_old = true draw_text(x1 + 170, y1 + 220, "Repeaters per row:") sch_exp_notesperrow = median(5, draw_dragvalue(5, x1 + 300, y1 + 220, sch_exp_notesperrow, 1), 100) From 7a0bfb8bb6f64efa187c963d85eeab7990c47c1c Mon Sep 17 00:00:00 2001 From: Bentroen Date: Thu, 27 Feb 2020 01:31:28 -0300 Subject: [PATCH 9/9] 3.7.2 --- scripts/draw_window_update/draw_window_update.gml | 1 + scripts/macros/macros.gml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/draw_window_update/draw_window_update.gml b/scripts/draw_window_update/draw_window_update.gml index d509ceaf4..b92ac1524 100644 --- a/scripts/draw_window_update/draw_window_update.gml +++ b/scripts/draw_window_update/draw_window_update.gml @@ -10,6 +10,7 @@ draw_set_font(fnt_main) if (window = w_update) draw_text(x1 + 32, y1 + 32, "Thank you for upgrading to version " + version + "!") draw_area(x1 + 16, y1 + 58, x1 + 487, y1 + 310) fullstr = "" +fullstr += "Changes in v3.7.2 (2020.02.27):\n* Auto-saving will now wait until you pause the song to prevent stuttering.\n* Fixed notes in the first tick of a song not playing when selected.\n* Fixed C8 key on piano not being playable through keyboard shortcuts.\n* Fixed a crash when scrolling down to layer 200.\n* Fixed scrollbar in the note block area getting outside the screen in some\nwindow sizes.\n* Fixed compatibility indicator being incorrect in some circumstances.\n\n" fullstr += "Changes in v3.7.1 (2020.01.20):\n* Added an auto-updater. When a new version is available, Note Block Studio\nwill now be able to download and install it automatically. You don't even need\nto open your browser!\n* Pressing Shift while clicking 'Select all note blocks in this layer' will add those\nnotes to the selection rather than clearing it.\n* Holding Shift while dragging layer volumes/stereo will change them in\nincrements of 1, allowing a finer control.\n* Note panning is now prioritized over layer panning. Layers that haven't had\ntheir panning changed will not have any effect on note panning.\n* Re-added the option to import instruments from another song.\n* Bugfixes and improvements:\n * Fixed layer volume and stereo controls being too sensitive.\n * Fixed selection being automatically cleared once every minute.\n * Fixed contents of macro windows not being shown in some circumstances,\nforcing you to quit the program.\n * Fixed MIDI import setting pitch of all notes to +1.\n * Fixed lower notes not playing all the way through/stopping too early.\n * Fixed note count on 'Song stats' not being reset when creating a new song\n(and showing wrong percentages).\n * Fixed a crash when redoing a manual block placement.\n * Fixed a crash when opening the program with the greeting window disabled.\n * Fixed long recent file names overflowing the greeting window.\n * Fixed song area height being calculated incorrectly when the piano is\ndisabled.\n * Improved contrast of various pieces of text in the dark theme.\n * Removed the ability to drag the layer stereo controls with a window open.\n\n" fullstr += "Changes in v3.7.0 (2019.12.31):\n* Added a cool demo song to showcase the new features in 3.7.0!\n* It's now possible to set velocity, panning and detune on each individual note.\n* Added a metronome.\n* Added an option to display tempo as BPM rather than t/s.\n* Auto-save is now a global preference rather than being saved per song.\n* Added an auto-recovery feature so work is not lost if the program crashes.\n* Added Patterns. You can export note block data as a pattern, and import it\ninto whatever song you wish.\n* Note block songs now save song looping.\n* Added a bars/beats/sixteenths display.\n* Added lines that mark each bar in a song.\n* Added an option to choose if looping should wait for the end of the bar.\n* Added an option to show or hide layer boxes.\n* Added four edit modes, which allow you to change different properties of\nnotes (key/velocity/panning/pitch).\n* Holding Shift while scrolling over a note will change a whole octave, or\nfine-tune its velocity/panning/pitch.\n* Added Macros:\n(Accessible by right-clicking a selection, or from the new macro bar)\n * Tremolo\n * Stereo\n * Arpeggio\n * Portamento\n * Vibrato\n * Stagger\n * Chorus\n * Volume LFO\n * Fade in\n * Fade out\n * Replace key\n * Set velocity\n * Set panning\n * Set pitch\n* Added branch export, a new layout for exporting as schematics.\n* Added a metronome function.\n* Added layer management buttons (shift layers up and down, insert, delete).\n* Added a secret clipboard editor for power users.\n* (Slightly) Improved MIDI import, and made it support note velocity.\n* Improved data pack performance; impact on tick rate should be negligible.\n* Data packs can now export notes outside the octave range by providing\na resource pack.\n* Data packs can now be exported as ZIP.\n* Data packs now allow any tempo to be imported into Minecraft.\n* It's now possible to set a custom namespace and path for data pack functions.\n* Added six types of visualizers to data packs.\n* Double-clicking a NBS file will now open the song.\n* Added the ability to export songs in previous NBS format versions\nvia the Save Options window.\n* Note Block Studio will now refuse to load NBS versions made in the future.\n* NBS format updated to version 4.\n* Improved contrast of layer icons in dark theme.\n* Prevented dragging layer stereo from changing the song tempo.\n* Fixed 'Keys to show' resetting to 20 when enabling the piano.\n* Fixed crash in MP3 and data pack export.\n* Fixed crash on opening after updating.\n* Fixed memory leak from audio emitters piling up.\n\n" fullstr += "Changes in v3.6.0 (2019.08.08):\n* Added MP3 export option to select whether you want to include\n locked layers.\n* Added loop button to loop the current song.\n* Readded colored note blocks, added option for the shaped ones.\n* Added option to toggle piano visibility.\n* Updated icon.\n* NBS format updated to version 3. Now stores song length again.\n* Fixed an issue where there was an unintended gradient over sprites.\n* Fixed typo in preferences.\n* Fixed instrument icons being blank.\n* Fixed preferences not saving.\n\n" diff --git a/scripts/macros/macros.gml b/scripts/macros/macros.gml index 3882a3fad..47c8f94cf 100644 --- a/scripts/macros/macros.gml +++ b/scripts/macros/macros.gml @@ -1,6 +1,6 @@ #macro gm_runtime_version "2.2.3.344" -#macro version_date "2020.01.20" -#macro version "3.7.1" +#macro version_date "2020.02.27" +#macro version "3.7.2" #macro nbs_version 4 #macro pat_version 1