File: CheckPitches.scm

package info (click to toggle)
denemo 2.6.49-0.2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 66,916 kB
  • sloc: ansic: 94,587; lisp: 38,713; xml: 22,675; python: 1,930; sh: 1,239; makefile: 642; yacc: 288; sed: 93
file content (43 lines) | stat: -rw-r--r-- 1,064 bytes parent folder | download | duplicates (7)
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")