forked from openmusic-project/OMChroma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOMChroma.lisp
208 lines (168 loc) · 8.19 KB
/
OMChroma.lisp
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
; OMChroma
; High-level control of sound synthesis in OM
;
;This program is free software; you can redistribute it and/or
;modify it under the terms of the GNU General Public License
;as published by the Free Software Foundation; either version 2
;of the License, or (at your option) any later version.
;
;See file LICENSE for further informations on licensing terms.
;
;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;GNU General Public License for more details.
;
;You should have received a copy of the GNU General Public License
;along with this program; if not, write to the Free Software
;Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,10 USA.
;
; (c) Ircam 2000 - 2019
;Authors: M. Stroppa, C. Agon, J. Bresson, S. Lemouton
;;;================================
;;; Lib loader for OM 6
;;;================================
(in-package :om)
(load (merge-pathnames "sources/package" *load-pathname*))
(load (merge-pathnames "sources/chroma/load" *load-pathname*))
(mapc
#'(lambda (file)
(compile&load (merge-pathnames file *load-pathname*)))
'("sources/om6/chroma-init"
"sources/om6/chroma-fun"
"sources/om6/cs-events/general-parsing"
"sources/om6/cs-events/csound/cs-utils"
"sources/om6/cs-events/csound/cs-tables"
"sources/om6/cs-events/csound/csound-evt"
"sources/om6/cs-events/csound/csound-tools"
"sources/om6/cs-events/csound/csound-parsing"
"sources/om6/cs-events/user-funs/user-funs"
"sources/om6/cs-events/user-funs/methods"
"sources/om6/cs-events/chromaspat"
"sources/om6/chroma-reference"
"sources/om6/doc-chroma"
"sources/om6/cr-models/vps-tools"
"sources/om6/cr-models/vpseditor"
"sources/om6/cr-models/cr-model"
"sources/om6/cr-models/processing"
"sources/om6/cr-models/expand-model"
"sources/om6/cr-models/ctl"
))
(import '(cr::fq->pch
cr::fq->midi
cr::fq->ratio
cr::fq->midic
cr::fq->itvl
cr::fq->semitones
cr::pch->fq
cr::pch->midi
cr::pch->midic
cr::pch->itvl
cr::pch->semitones
cr::pch->pch-class
cr::pch->ratio
cr::midi->pch
cr::midi->semitones
cr::midi->pch-class
cr::midi->midic
cr::midi->fq
cr::midi->ratio
cr::midi->itvl
cr::midic->midi
cr::midic->fq
cr::midic->pch
cr::midic->ratio
cr::midic->itvl
cr::midic->semitones
cr::midic->pch-class
cr::ratio->fq
cr::ratio->itvl
cr::ratio->semitones
cr::ratio->midi
cr::ratio->midic
cr::ratio->pch
cr::itvl->fq
cr::itvl->midi
cr::itvl->midic
cr::itvl->ratio
cr::itvl->pch
cr::itvl->semitones
cr::semitones->ratio
cr::semitones->itvl
cr::semitones->fq
cr::semitones->midi
cr::semitones->midic
cr::pch-class->pch
cr::pch-class->midi
cr::pch-class->fq)
)
;(import '(cr::spsht))
(om::fill-library '((nil nil nil (synthesize chroma-prisma) nil)
("Csound"
(("Csound Tables" nil (cs-table gen-cs-table gen01 gen02 gen-02 gen05 gen07 gen-07) nil nil)
("Basic Classes" nil nil nil nil)
("Advanced Classes" nil nil nil nil)
("Multi Channels" nil nil nil nil))
nil nil nil)
("Vertical Pitch Structures"
(("Conversions"
(("FQ" nil nil (cr::fq->pch cr::fq->midi cr::fq->ratio cr::fq->midic cr::fq->itvl cr::fq->semitones) nil)
("PCH" nil nil (cr::pch->fq cr::pch->midi cr::pch->midic cr::pch->itvl cr::pch->semitones cr::pch->pch-class cr::pch->ratio) nil)
("MIDI" nil nil (cr::midi->pch cr::midi->semitones cr::midi->pch-class cr::midi->midic cr::midi->fq cr::midi->ratio cr::midi->itvl) nil)
("MIDIC" nil nil (cr::midic->midi cr::midic->fq cr::midic->pch cr::midic->ratio cr::midic->itvl cr::midic->semitones cr::midic->pch-class) nil)
("IVTL" nil nil (cr::itvl->fq cr::itvl->midi cr::itvl->midic cr::itvl->ratio cr::itvl->pch cr::itvl->semitones) nil)
("RATIO" nil nil (cr::ratio->fq cr::ratio->itvl cr::ratio->semitones cr::ratio->midi cr::ratio->midic cr::ratio->pch) nil)
("SEMITONES" nil nil (cr::semitones->ratio cr::semitones->itvl cr::semitones->fq cr::semitones->midi cr::semitones->midic ) nil)
("PCH-CLASS" nil nil (cr::pch-class->pch cr::pch-class->midi cr::pch-class->fq)) nil)
)
("Inspect" nil nil (get-vps-freqs get-vps-freq-ratios get-vps-intervals
get-vps-amps get-vps-maxamp get-vps-minamp
;;; Lisp functions:
cr::get-homogeneity cr::get-harmonicity cr::get-surface
cr::get-density cr::get-sd cr::get-cs cr::get-virt-fund cr::match) nil)
("Processing" nil nil (low-pass-filter high-pass-filter band-pass-filter
main-partials n-main-partials stretch-vps pitch-transpose
xpose-begin xpose-end
revert-vps mirror-vps) nil)))
("Models"
(("Inspect" nil nil (model-max-amp model-max-freq model-min-freq model-nb-evts) nil)
("Tools" nil nil (make-cr-fun time-map-fun add-random) nil))
(cr-model) (model-data expand-model) nil)
)
(find-library "OMChroma"))
(defun load-chroma-classes (dir &optional pack)
(loop for item in (om-directory dir :files t :directories t) do
(if (directoryp item)
(let ((thepackage
(or (and pack (find (car (last (pathname-directory item)))
(subpackages pack) :key 'name :test 'string-equal))
pack)))
(load-chroma-classes item thepackage))
(when (string-equal (pathname-type item) "lisp")
(load item)
(let ((classname (intern (string-upcase (pathname-name item)))))
(when (and pack (find-class classname nil))
(addclass2pack classname pack)))))))
(let* ((chromapack (or *current-lib* (find-library "OMChroma")))
(cspack (find "Csound" (subpackages chromapack) :key 'name :test 'string-equal))
(basicpack (find "Basic Classes" (subpackages cspack) :key 'name :test 'string-equal))
(advpack (find "Advanced Classes" (subpackages cspack) :key 'name :test 'string-equal))
(spacepack (find "Multi Channels" (subpackages cspack) :key 'name :test 'string-equal)))
(setq *cs-orc-folder* (om-relative-path '("Csound") nil))
(load-chroma-classes (om-relative-path '("sources" "om6" "cs-events" "csound" "classes" "Basic") nil) basicpack)
(load-chroma-classes (om-relative-path '("sources" "om6" "cs-events" "csound" "classes" "Advanced") nil) advpack)
(load-chroma-classes (om-relative-path '("sources" "om6" "cs-events" "csound" "classes" "Panning") nil) spacepack)
)
(unless (fboundp 'om::set-lib-release) (defmethod om::set-lib-release (version &optional lib) nil))
(om::set-lib-release 5.2 (find-library "OMChroma"))
;(cl-user::clean-sources (make-pathname :directory (append (pathname-directory *load-pathname*) '("sources"))))
(print "
==============================
OMChroma
==============================
High-level control of sound synthesis in OM
(c) Ircam 2000-2018
C. Agon, M. Stroppa, J. Bresson, S. Lemouton
==============================
")
; (om::omchroma-reference)