1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
;;;;;;;;;;
;;;CheckPitches
(d-Note)
(d-EditMode)
(define-once CheckPitches::Active #f)
(if CheckPitches::Active
(begin
(d-PutMidi 0)
(set! CheckPitches::Active #f))
;;; not active
(let (
(midi 0)
(command 0)
(note 0)
(velocity 0)
(loop 0))
(begin
(set! CheckPitches::Active #t)
(d-PlayMidiKey #x202001)
(d-PlayMidiKey #x202601)
(d-PlayMidiKey #x202201)
(d-InputFilterNames "Check Pitches Filter")
(d-SetMidiCapture #t)
(set! loop (lambda ()
(begin
(set! midi (d-GetMidi))
(set! velocity (bit-extract midi 16 24))
(set! note (bit-extract midi 8 16))
(set! command (bit-extract midi 0 8))
(if (= command #x80)
(loop))
(if (= command #x90);; only check on channel 0
(begin
(d-PlayMidiKey midi)
(if (= (d-GetNoteAsMidi) note)
(begin (d-NextNote)(d-RefreshDisplay))
(begin (d-PlayMidiKey #xF06001))
)
(loop))))))
(loop))))
(d-SetMidiCapture #f)
(display "End of script")
|