-
Notifications
You must be signed in to change notification settings - Fork 2
/
midimacs-keyboard.el
55 lines (50 loc) · 1.15 KB
/
midimacs-keyboard.el
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
44
45
46
47
48
49
50
51
52
53
54
55
(eval-when-compile
(require 'cl))
(defun midimacs-keyboard-notes ()
'((?z . C2)
(?s . Cs2)
(?x . D2)
(?d . Ds2)
(?c . E2)
(?v . F2)
(?g . Fs2)
(?b . G2)
(?h . Gs2)
(?n . A2)
(?j . As2)
(?m . B2)
(?, . C3)
(?l . Cs3)
(?. . D3)
(?\; . Ds3)
(?/ . E3)
(?q . C3)
(?2 . Cs3)
(?w . D3)
(?3 . Ds3)
(?e . E3)
(?r . F3)
(?5 . Fs3)
(?t . G3)
(?6 . Gs3)
(?y . A3)
(?7 . As3)
(?u . B3)
(?i . C4)
(?9 . Cs4)
(?o . D4)
(?0 . Ds4)
(?p . E4)
(?\[ . F4)
(?+ . Fs4)
(?\] . G4)))
(defun midimacs-record-key (pitch)
(let* ((song-time (midimacs-quantized-song-time))
(duration midimacs-default-recording-duration)
(channel (midimacs-score-channel midimacs-recording-score))
(start-time (midimacs-score-start-time midimacs-recording-score))
(rel-time (midimacs-time- song-time start-time)))
(when (midimacs-time> rel-time (make-midimacs-time))
(midimacs-play-note channel pitch duration)
(midimacs-add-note-to-score midimacs-recording-score rel-time pitch duration))))
(provide 'midimacs-keyboard)