-
Notifications
You must be signed in to change notification settings - Fork 1
/
OM-pursuit.lisp
167 lines (137 loc) · 10.2 KB
/
OM-pursuit.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
;************************************************************************
; OM-Pursuit *
; library for dictionary-based sound modelling in OpenMusic *
; (c) 2011-2014 Marlon Schumacher (CIRMMT/McGill University) *
; https://github.com/marleynoe/OM-Pursuit *
; *
; DSP based on pydbm - (c) Graham Boyes *
; https://github.com/gboyes/pydbm *
;************************************************************************
;
;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.
;
;Authors: M. Schumacher, G.Boyes
(in-package :om)
; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
(defun recursive-load-classes (dir &optional pack)
(loop for item in (om-directory dir) do
(if (directoryp item)
(let ((thepackage
(or (find (car (last (pathname-directory item)))
(subpackages pack) :key 'name :test 'string-equal)
pack)))
(recursive-load-classes item thepackage))
(when (string-equal (pathname-type item) "lisp")
(load item)
(addclass2pack (intern (string-upcase (pathname-name item))) pack)))))
(defparameter *om-pursuit-lib-path* (make-pathname :directory (pathname-directory *load-pathname*)))
(mapcar #'(lambda (file) (compile&load (om-relative-path '("sources" "classes") file)))
'(
"superclasses"
"sgn-constraint"
"score-array"
"sgn-array"
"soundgrain-matrix"
))
(mapcar #'(lambda (file) (compile&load (om-relative-path '("sources") file )))
'(
"preferences"
"array-tools"
"editors"
"file-io"
"ircamdescriptors"
"constraints"
"mapgrain"
"score-tools"
"sdif-tools"
"soundgrain-decomp"
"pursuit-dictionary"
"statistics"
"utilities"
))
(om::fill-library '(
("Soundgrain" (
(nil nil nil (sgn-params sgn-decomp get-sgn-params get-sgn-array get-sgn-array-resamp) nil)))
("Array-tools" (
("array" nil nil (process-array array-vals array-rep-filter) nil)
("component" nil nil (process-array-comp get-comp-vals comp-quantize field-quantize comp-perturbation field-perturbation comp-bandfilter) nil)
("slot" nil nil (process-array-slot slot-lowpass slot-highpass slot-scale) nil)
("array-field" nil nil (process-array-field array-field field-lowpass field-highpass) nil))
nil nil nil)
("Utilities" (
(nil nil nil (get-bpf-points atoms->chords ) nil)))
))
;(sub-pack-name subpack-lists class-list function-list class-alias-list)
(defmethod get-fonde-pict ((self soundgrain-matrix)) *pursuit-bg-pict*)
(setq *pursuit-bg-pict* (om-load-and-store-picture "dibox" 'om-pursuit))
; Version control
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; before committing
; (CL-User::clean-sources *om-pursuit-lib-path*)
; Distribution
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; generate html reference
; (gen-lib-reference "OM-Pursuit")
; before distribution
; (clean-repo *om-pursuit-lib-path*)
; (set-lib-release 1.0) this doesn't work?
(defun clean-repo (&optional dir)
(let ((src-root (or dir (make-pathname :directory (butlast (pathname-directory *load-pathname*) 2)))))
(mapc #'(lambda (file)
(if (system::directory-pathname-p file)
(if (cond (
(string-equal ".git" (car (last (pathname-directory file))))
(string-equal ".dropbox" (car (last (pathname-directory file))))
(string-equal ".svn" (car (last (pathname-directory file))))
(system::call-system (concatenate 'string "rm -Rf \"" (namestring file) "\""))
(clean-repo file))
(when (and (pathname-type file)
(or (string-equal (pathname-type file) "xfasl")
(string-equal (pathname-type file) "fasl")
(string-equal (pathname-type file) "DS_STORE")
(string-equal (pathname-type file) "nfasl")
(string-equal (pathname-type file) "ofasl")
(string-equal (pathname-type file) "ufasl")
(string-equal (pathname-type file) "lisp~")))
(print (concatenate 'string "Deleting " (namestring file) " ..."))
(delete-file file)
)
))
(directory (namestring src-root) :directories t))))
))
; fix this here (with a version-specific variable)
#|
; SPLASH SCREEN
(om-message-dialog
"===========================
OM-Pursuit v1.0beta
Dictionary-based Sound Modelling in OpenMusic
(c) 2011-2013, Marlon Schumacher (CIRMMT/McGill University)
https://github.com/marleynoe/OM-Pursuit
DSP based on pydbm by Graham Boyes
https://github.com/gboyes/pydbm
"
:window-title "OM-Pursuit v1.0beta"
:size (om-make-point 360 200)
:position (om-make-point 200 140)
)
|#
(format *om-stream* "
*************************************************
* OM-PURSUIT *
* Dictionary-based Sound Modelling in OpenMusic *
* *
* (c) 2011-2013 Marlon Schumacher *
* https://github.com/marleynoe/OM-Pursuit *
* *
* DSP based on pydbm - (c) Graham Boyes *
* https://github.com/gboyes/pydbm *
*************************************************
")
(defvar *ircamdescriptor-matrixdescriptions*
'(("1ARR" "autocorrelation") ("1CHR" "chroma") ("1EEV" "energyenvelope") ("1FQ0" "fundamentalfrequency") ("1HEN" "harmonicenergy") ("1HOE" "harmonicoddtoevenratio") ("1HCN" "harmonicspectralcentroid") ("1HDE" "harmonicspectraldecrease") ("1HSD" "harmonicspectraldeviation") ("1HKU" "harmonicspectralkurtosis") ("1HRO" "harmonicspectralrolloff") ("1HSK" "harmonicspectralskewness") ("1HSL" "harmonicspectralslope") ("1HSP" "harmonicspectralspread") ("1HVA" "harmonicspectralvariation") ("1HTR" "harmonictristimulus") ("1INH" "inharmonicity") ("1LDN" "loudness") ("1MFC" "mfcc") ("1NEN" "noiseenergy") ("1NSN" "noisiness") ("1POE" "perceptualoddtoevenratio") ("1PCN" "perceptualspectralcentroid") ("1PDE" "perceptualspectraldecrease") ("1PSD" "perceptualspectraldeviation") ("1PKU" "perceptualspectralkurtosis") ("1PRO" "perceptualspectralrolloff") ("1PSK" "perceptualspectralskewness") ("1PSL" "perceptualspectralslope") ("1PSP" "perceptualspectralspread") ("1PVA" "perceptualspectralvariation") ("1PTR" "perceptualtristimulus") ("1RSL" "relativespecificloudness") ("1SHA" "sharpness") ("1ZCR" "signalzerocrossingrate") ("1SCN" "spectralcentroid") ("1SCM" "spectralcrest") ("1SDE" "spectraldecrease") ("1SFM" "spectralflatness") ("1SKU" "spectralkurtosis") ("1SRO" "spectralrolloff") ("1SSK" "spectralskewness") ("1SSL" "spectralslope") ("1SSP" "spectralspread") ("1SVA" "spectralvariation") ("1SPR" "spread") ("1NRG" "totalenergy") ("IMOD" "amplitudemodulationinfo") ("IMDA" "amplitudemodulationampinfo") ("IMDF" "amplitudemodulationfreqinfo") ("IODO" "deltainfo") ("IOAO" "deltadeltainfo") ("IOAM" "deltadeltamedianfilterinfo") ("IODM" "deltamedianfilterinfo") ("IEFD" "effectivedurationinfo") ("ILAT" "logattacktimeinfo") ("IMED" "medianfilterinfo") ("IDSC" "shorttermfeatureinfo") ("ITCN" "temporalcentroidinfo") ("ITDE" "temporaldecreaseinfo") ("ITIN" "temporalincreaseinfo") ("IWMN" "weightedmeaninfo") ("IMDO" "weightedmeandeltainfo") ("IMAO" "weightedmeandeltadeltainfo") ("IMAM" "weightedmeandeltadeltamedianfilterinfo") ("IMDM" "weightedmeandeltamedianfilterinfo") ("IMOM" "weightedmeanmedianfilterinfo") ("IWSD" "weightedstddeviationinfo") ("ISDO" "weightedstddeviationdeltainfo") ("ISAO" "weightedstddeviationdeltadeltainfo") ("ISAM" "weightedstddeviationdeltadeltamedianfilterinfo") ("ISDM" "weightedstddeviationdeltamedianfilterinfo") ("ISOM" "weightedstddeviationmedianfilterinfo"))
)
(defparameter *ircamdescriptortypes*
'(("signalzerocrossingrate" "1ZCR") ("spectralcentroid" "1SCN") ("spectralcrest" "1SCM") ("spectraldecrease" "1SDE") ("spectralflatness" "1SFM") ("spectralkurtosis" "1SKU") ("spectralrolloff" "1SRO") ("spectralskewness" "1SSK") ("spectralslope" "1SSL") ("spectralspread" "1SSP") ("spectralvariation" "1SVA") ("spread" "1SPR") ("totalenergy" "1NRG")("autocorrelation" "1ARR") ("chroma" "1CHR") ("energyenvelope" "1EEV") ("fundamentalfrequency" "1FQ0") ("harmonicenergy" "1HEN") ("harmonicoddtoevenratio" "1HOE") ("harmonicspectralcentroid" "1HCN") ("harmonicspectraldecrease" "1HDE") ("harmonicspectraldeviation" "1HSD") ("harmonicspectralkurtosis" "1HKU") ("harmonicspectralrolloff" "1HRO") ("harmonicspectralskewness" "1HSK") ("harmonicspectralslope" "1HSL") ("harmonicspectralspread" "1HSP") ("harmonicspectralvariation" "1HVA") ("harmonictristimulus" "1HTR") ("inharmonicity" "1INH") ("loudness" "1LDN") ("mfcc" "1MFC") ("noiseenergy" "1NEN") ("noisiness" "1NSN") ("perceptualoddtoevenratio" "1POE") ("perceptualspectralcentroid" "1PCN") ("perceptualspectraldecrease" "1PDE") ("perceptualspectraldeviation" "1PSD") ("perceptualspectralkurtosis" "1PKU") ("perceptualspectralrolloff" "1PRO") ("perceptualspectralskewness" "1PSK") ("perceptualspectralslope" "1PSL") ("perceptualspectralspread" "1PSP") ("perceptualspectralvariation" "1PVA") ("perceptualtristimulus" "1PTR") ("relativespecificloudness" "1RSL") ("sharpness" "1SHA")))