diff options
Diffstat (limited to 'guile/starlet/midi-control/button-utils.scm')
-rw-r--r-- | guile/starlet/midi-control/button-utils.scm | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/guile/starlet/midi-control/button-utils.scm b/guile/starlet/midi-control/button-utils.scm index d9a3c1c..0786cab 100644 --- a/guile/starlet/midi-control/button-utils.scm +++ b/guile/starlet/midi-control/button-utils.scm @@ -46,18 +46,21 @@ (set! time-last-press time-this-press))))) (when (or ready-note pause-note) - (add-hook! - (state-change-hook pb) - (lambda (new-state) - (cond - ((eq? new-state 'pause) - (send-note-on controller pause-note)) - ((eq? new-state 'ready) - (send-note-on controller ready-note)) - ((eq? new-state 'running) - (send-note-on controller ready-note)) - (else - (send-note-off controller ready-note))))))) + (let ((state-change-func + (lambda (new-state) + (cond + ((eq? new-state 'pause) + (send-note-on controller pause-note)) + ((eq? new-state 'ready) + (send-note-on controller ready-note)) + ((eq? new-state 'running) + (send-note-on controller ready-note)) + (else + (send-note-off controller ready-note)))))) + (add-hook! + (state-change-hook pb) + state-change-func) + (state-change-func (playback-state pb))))) (define* (make-stop-button controller pb button |