Note off on stop.

This commit is contained in:
severak 2019-10-21 15:26:00 +02:00
parent bcf68eb32a
commit 806324e7b1
1 changed files with 8 additions and 0 deletions

View File

@ -103,6 +103,12 @@ function timer:action_cb()
matrix.redraw="YES"
end
function silence()
for i=1,#instruments do
midiwire.note_off(mout, instruments[i][2], chan)
end
end
function playbtn:action()
bpm.active="NO"
factor.active="NO"
@ -116,6 +122,7 @@ function stopbtn:action()
len.active="YES"
timer.run="NO"
-- todo - tohle lépe
silence()
if step==1 then
matrix:setcell(9, LEN-1, "")
else
@ -218,6 +225,7 @@ function pat_recall(patno)
if not patterns[patno] then return end
local was_running = timer.run == "YES"
timer.run="NO" -- pause while recalling to not glitch
silence()
for x=1,8 do
patterns[patno][x] = patterns[patno][x] or {}
for y=1,32 do