Commit 0dd1717

Nick committed on
Fix bug where the lowest instrument would retrigger when previewing
commit 0dd1717eaf808c18b6f9a48a6ae3e29d1adcd640 parent 135adb9
1 changed files +4−2
Modifiedtracker.pas +4−2
@@ -917,15 +917,18 @@ var
917 Note: Integer; 917 Note: Integer;
918 Freq: Integer; 918 Freq: Integer;
919 begin 919 begin
920 // Guard conditions
921 if TrackerGrid.Cursor.SelectedPart <> cpNote then Exit;
920 if Shift <> [] then Exit; 922 if Shift <> [] then Exit;
921 if not Keybindings.TryGetData(Key, Note) then Exit; 923 if not Keybindings.TryGetData(Key, Note) then Exit;
924
922 Inc(Note, OctaveSpinEdit.Value*12); 925 Inc(Note, OctaveSpinEdit.Value*12);
923 EnsureRange(Note, LOWEST_NOTE, HIGHEST_NOTE); 926 EnsureRange(Note, LOWEST_NOTE, HIGHEST_NOTE);
924 927
925 if PreviewingInstrument <> Note then 928 if PreviewingInstrument <> Note then
926 PreviewingInstrument := -1; 929 PreviewingInstrument := -1;
927 930
928 if (PreviewingInstrument > 0) or 931 if (PreviewingInstrument > -1) or
929 (not (ActiveControl = TrackerGrid)) or 932 (not (ActiveControl = TrackerGrid)) or
930 (InstrumentComboBox.ItemIndex <= 0) 933 (InstrumentComboBox.ItemIndex <= 0)
931 then exit; 934 then exit;
@@ -1393,7 +1396,6 @@ var
1393 Samp: Integer; 1396 Samp: Integer;
1394 begin 1397 begin
1395 if not Playing then Exit; 1398 if not Playing then Exit;
1396
1397 Max1 := -1; 1399 Max1 := -1;
1398 Max2 := -1; 1400 Max2 := -1;
1399 for I := 0 to SAMPLE_BUFFER_SIZE do begin 1401 for I := 0 to SAMPLE_BUFFER_SIZE do begin