Skip to content

Commit

Permalink
Clamp famitracker notes after calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperDisk committed Dec 8, 2023
1 parent 4b7ead0 commit 07f720a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/clipboardutils.pas
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ function GetFamitrackerPastedCells: TSelection;
begin
case Note.Note of
0, 13, 14, 15: Result.Note := NO_NOTE;
else Result.Note := (C_3 + (Note.Note-1)) + (12*(Note.Octave - 1));
else begin
Result.Note := EnsureRange((C_3 + (Note.Note-1)) + (12*(Note.Octave - 1)), LOWEST_NOTE, HIGHEST_NOTE);
end;
end;

if Note.Instrument = 64 then
Expand Down

0 comments on commit 07f720a

Please sign in to comment.