Skip to content

Commit

Permalink
MIDI channel use
Browse files Browse the repository at this point in the history
  • Loading branch information
Grix committed Mar 8, 2024
1 parent f7777db commit 21b9eab
Show file tree
Hide file tree
Showing 16 changed files with 41 additions and 29 deletions.
2 changes: 1 addition & 1 deletion src/gms2/notes/building_macos/building_macos.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Set build architecture to standard arctitectures (apple silicon + intel)
Set strip style to non-global symbols, and "strip debug symbols during copy" to no.
5. project -> archive
6. distribute with dev id. select provision profile in wizard signing step
6. distribute with dev id. select provision profile in wizard signing step (air-test-profile)
codesign --remove-signature LaserShowGen.app
codesign -s "Developer ID Application: Gitle Mikkelsen (Y62YL762Z5)" --deep --options runtime --timestamp LaserShowGen.app
7. create dmg
Expand Down
4 changes: 2 additions & 2 deletions src/gms2/objects/controller/Create_0.gml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version = "1.11.1";
versiondate = "2024-03-03";
version = "1.11.2";
versiondate = "2024-03-08";

global.list_pool = ds_stack_create();
global.list_pool_is_taken = ds_map_create();
Expand Down
1 change: 1 addition & 0 deletions src/gms2/objects/seqcontrol/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ copy_list = ds_list_create_pool();
env_type_map = ds_map_create();
playlist_list = ds_list_create_pool();
playlist_start_next_flag = false;
midi_keys_pressed = ds_list_create_pool();

last_save_time = get_timer();
high_performance = false;
Expand Down
4 changes: 3 additions & 1 deletion src/gms2/objects/seqcontrol/Other_4.gml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ if (loadprojectflag)
dd_seq_loadproject();
loadprojectflag = false;

update_dac_list_isused();
update_dac_list_isused();

ds_list_clear(midi_keys_pressed);
2 changes: 1 addition & 1 deletion src/gms2/options/linux/options_linux.yy

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

2 changes: 1 addition & 1 deletion src/gms2/options/mac/options_mac.yy

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

2 changes: 1 addition & 1 deletion src/gms2/options/windows/options_windows.yy

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

2 changes: 2 additions & 0 deletions src/gms2/scripts/clear_project/clear_project.gml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ function clear_project() {
ds_list_clear(marker_list);
clean_redo_list_seq();
clean_seq_undo();
ds_list_clear(seqcontrol.jump_button_list);
ds_list_clear(seqcontrol.jump_button_list_midi);

repeat (ds_list_size(layer_list))
{
Expand Down
2 changes: 1 addition & 1 deletion src/gms2/scripts/draw_browser_grid/draw_browser_grid.gml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function draw_browser_grid() {
{
draw_set_color(c_teal);
draw_set_halign(fa_right);
draw_text(t_column*t_cell_size+t_cell_size - 4, t_ystart+t_row*t_cell_size+4, midi_get_note_name(objectlist[| 13]));
draw_text(t_column*t_cell_size+t_cell_size - 4, t_ystart+t_row*t_cell_size+4, string(objectlist[| 13] >> 8) + midi_get_note_name(objectlist[| 13] & $FF));
draw_set_halign(fa_left);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/gms2/scripts/draw_timeline/draw_timeline.gml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function draw_timeline() {
if (jump_button_list_midi[| i] == -1)
draw_text(markerpostemp+4,tlsurf_y+lbsh-20,"[ Press shortcut MIDI key... ]");
else
draw_text(markerpostemp+4,tlsurf_y+lbsh-20,"[ " + midi_get_note_name(jump_button_list_midi[| i]) + " ]");
draw_text(markerpostemp+4,tlsurf_y+lbsh-20,"[ " + string(jump_button_list_midi[| i] >> 8) + midi_get_note_name(jump_button_list_midi[| i] & $FF) + " ]");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,19 @@ function handle_midi_input_live(){
if (t_type == 144 && rtmidi_get_message(2) > 0)
{
// MIDI key pressed
ds_list_add(t_keys, rtmidi_get_message(1));
ds_list_add(midi_keys_pressed, rtmidi_get_message(1));
var t_note = rtmidi_get_message(1) | ((rtmidi_get_message(0) & $0F) << 8);
ds_list_add(t_keys, t_note);
ds_list_add(midi_keys_pressed, t_note);
}
if (t_type == 128 || (t_type == 144 && rtmidi_get_message(2) == 0))
{
// MIDI key released
if (ds_list_find_index(midi_keys_pressed, rtmidi_get_message(1)) != -1)
ds_list_delete(midi_keys_pressed, ds_list_find_index(midi_keys_pressed, rtmidi_get_message(1)));
var t_note = rtmidi_get_message(1) | ((rtmidi_get_message(0) & $0F) << 8);
if (ds_list_find_index(midi_keys_pressed, t_note) != -1)
ds_list_delete(midi_keys_pressed, ds_list_find_index(midi_keys_pressed, t_note));
}
else if (t_type == 176)
{
{
// CC message
var t_ccid = rtmidi_get_message(1);

Expand Down
12 changes: 10 additions & 2 deletions src/gms2/scripts/handle_midi_input_seq/handle_midi_input_seq.gml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@ function handle_midi_input_seq(){
if (t_type == 144 && rtmidi_get_message(2) > 0)
{
// MIDI key pressed
ds_list_add(t_keys, rtmidi_get_message(1));
var t_note = rtmidi_get_message(1) | ((rtmidi_get_message(0) & $0F) << 8);
ds_list_add(t_keys, t_note);
ds_list_add(midi_keys_pressed, t_note);
}
if (t_type == 128 || (t_type == 144 && rtmidi_get_message(2) == 0))
{
// MIDI key released
var t_note = rtmidi_get_message(1) | ((rtmidi_get_message(0) & $0F) << 8);
if (ds_list_find_index(midi_keys_pressed, t_note) != -1)
ds_list_delete(midi_keys_pressed, ds_list_find_index(midi_keys_pressed, t_note));
}
else if (t_type == 176)
{
Expand Down Expand Up @@ -54,7 +63,6 @@ function handle_midi_input_seq(){
return;
}

// todo
// check jump buttons
for (i = 0; i < ds_list_size(jump_button_list_midi); i += 2)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function handle_mousecontrol_live() {
if (string_length(t_shortcut) != 0)
t_shortcut += " or ";
t_shortcut += "MIDI key ";
t_shortcut += midi_get_note_name(objectlist[| 13]);
t_shortcut += (string(objectlist[| 13] >> 8) + midi_get_note_name(objectlist[| 13] & $FF));
}

controller.tooltip = "Click to select and play this file ("+t_shortcut+").\nDouble-click to open in editor mode.\nRight click for options, such as assigning keyboard or MIDI trigger key, and changing playback modes.";
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.11.1
1.11.2
2 changes: 1 addition & 1 deletion version_mac.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.11.0
1.11.2
17 changes: 7 additions & 10 deletions versionnotes.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
v1.11.2
- Fix possible crash when activating output if blind zones have been defined.
- Fix MIDI input does not take channels into account, causing duplicate keys for Akai pads etc.
- Fix push-to-play option not working properly for MIDI input in grid mode.

v1.11.1
- Fix some possible crashes or corruptions when using the arbitrary function tools with an invalid function.

v1.11.0
- Add ability to use MIDI controllers to trigger animations and adjust sliders in the live and timeline modes.
- Add ability to use MIDI controllers to trigger animations and adjust sliders in the grid and timeline modes.
- Text tool user-friendliness improvements, can select built-in fonts with a drop-down menu etc.
- Support for international (UTF-8) LaserBoy fonts. Most built-in fonts now support symbols like ß, ö, ñ etc.
- Add ability to change the number of columns in the grid mode.
- Grid mode project files now save the state of the adjustment sliders.
- Slight change in optimization behavior and default settings.
- No longer caps the FPS to 60 when laser is off: UI can appear smoother at high refresh rate screens.

v1.10.3
- Fix audio on timeline projects not working on some Mac computers.
- [5 other fixes]
- [5 other changes]

0 comments on commit 21b9eab

Please sign in to comment.