i know, of course, that LISP is not an environment for REALTIME actions (pure data / max would be much more suitable) - so I had to outsmart the system a little to import data (from a modularsynth and other applications) almost "on the fly" to generate a LIVE-SCORE (with the influence of this datas) at the concert/on the stage....
maybe i should learn MAX... for more smart-coded REALTIME things 😄
It´s also possible (using MAX or Pure Data) to convert audio impulses to length values using a value in milliseconds as reference for beats and then convert the results to OMN syntax.
(setf mat '(b2cs4eb4e4 cs3eb4f4gs4 c3d4e4f4 fs2bb3cs4e4))
(drop-voicing mat)
The following example returns all chords of type 1:
(drop-voicing mat :type '(1))
In this example we apply a different type to each chord:
(drop-voicing mat :type '(0 1 2 3))
Here the leading voice is set to 'l (lowest voice):
(drop-voicing mat :type '(0 1 2 3) :leading 'l)
(setf chords '(w b3c4d4e4g4 p h g3b3c4d4e4 mf c4d4e4g4b4 p -
q d4fs4g4b4 b3d4e4fs4g4 b3c4e4g4a4 mf a3c4d4e4f4 p
c4d4e4f4a4 mp d4e4f4a4c5 w bb3d4f4a4 bb3d4eb4f4g4 p
-q eb4f4g4bb4d5 mf c4d4f4a4bb4 mp e4f4g4a4c5 w c4e4g4b4))
with LOOP and SLEEP my code should read X (the midi-values) every 2 seconds - (sleep 2). i don't know why "LISP don't safe" variable X inside the loop when i'm doing "midi-entry"....
(i realized for my work, that most of the time i'm using a "coded function" only for a specific project/work. so i stopped it to put all special functions into my user library. now, i have the functions only in my project workspace...)
– New Functions:
PAUSE-SERIES
– Fixed:
VOICE-VARIANT (:rest 's and 'e )
PAUSE-SERIES
This function removes a series of empty bars when lager then a given number (n).
(setf omn '((h b5 pp f6) (-w) (-w) (q cs6 p - b5)
(-q. s cs6 mp b5 e gs5 -q.)
(-e b5 mp gs5 b5 -h) (-w) (-w) (q c6 f - cs6)
(-q s e6 ff e g5 s fs6 -q s fs6 b5 e6 g5)
(-w) (-w) (-w)))
I.
In the first example we use the default division 2 value on each of the given lengths (1/8 equal 1/16 1/16) with interval transposition set to 4, for the entier process. Please note, before applying the function the original material is transposed by one semitone:
(progn
(setf mat-transp (pitch-transpose 1 mat))
(setf variant (voice-variant mat-transp :interval 4))
(def-score var1
(
:key-signature 'chromatic
:flexible-clef t
:time-signature '(2 4)
:tempo 86
:layout (list
(treble-layout 'v1 :name "Material" :abbr "M")
(treble-layout 'v2 :name "Variant" :abbr "V"))
)
(v1 :omn mat
:channel 1
:sound 'gm
:program 1)
(v2 :omn variant
:channel 2))
(audition-musicxml-last-score)
)
II.
Below the time-signature 4/4 defines the time for each of the two interval values. To the first bar of the original material we applied interval 4, to the second bar we applied interval 13, and so on. Both values are looped to satisfy the original bar count:
(progn
(setf mat-transp (pitch-transpose 1 mat))
(setf variant (voice-variant mat-transp :interval '((4) (13))))
(def-score var2
(
:key-signature 'chromatic
:flexible-clef t
:time-signature '(2 4)
:tempo 86
:layout (list
(treble-layout 'v1 :name "Material" :abbr "M")
(treble-layout 'v2 :name "Variant" :abbr "V"))
)
(v1 :omn mat
:channel 1
:sound 'gm
:program 1)
(v2 :omn variant
:channel 2))
(audition-musicxml-last-score)
)
III.
In this example the measure value overwrites the original time-signature 4/4 to 1/4 which in effect will shorten the time by 4 for each interval value. The variant 'i (inversion) is applied to a measure and to the original material before other processes happen:
(progn
(setf mat-transp (pitch-transpose 1 mat))
(setf variant (voice-variant mat-transp
:measure 1/4
:interval '((4) (13))
:variant 'i))
(def-score var3
(
:key-signature 'chromatic
:flexible-clef t
:time-signature '(2 4)
:tempo 86
:layout (list
(treble-layout 'v1 :name "Material" :abbr "M")
(treble-layout 'v2 :name "Variant" :abbr "V"))
)
(v1 :omn mat
:channel 1
:sound 'gm
:program 1)
(v2 :omn variant
:channel 2))
(audition-musicxml-last-score)
)
IV.
In the following example we generate two sequences using the same material with equal processing values. With the :variant set to '? (random) we potentially get a different result in each of the sequences on every-other measure:
(progn
(setf vec (gen-noise 30 :type :gaussian :seed 45))
(setf pitches (filter-repeat 1 (vector-to-pitch '(e1 g6) vec)))
(setf omn (make-omn :length '(q q q q)
:pitch pitches
:span :pitch))
(setf mat (omn-to-time-signature omn '(4 4)))
(setf mat-transp (pitch-transpose -12 mat))
(setf v1 (voice-variant mat
:measure 1
:divide 5
:interval '((0) (13))
:variant '(p ?)))
(setf v2 (voice-variant mat-transp
:measure 1
:divide 5
:interval '((0) (13))
:variant '(p ?)))
(def-score var4
(
:key-signature 'chromatic
:flexible-clef t
:time-signature '(2 4)
:tempo 86
:layout (list
(treble-layout 'v1 :name "Variant1" :abbr "V1")
(treble-layout 'v2 :name "Variant2" :abbr "V2"))
)
(v1 :omn v1
:channel 1
:sound 'gm
:program 1)
(v2 :omn v2
:channel 2))
(audition-musicxml-last-score)
)
V.
To create more interesting rhythms, we can set the multiply value to control how the basic value is divided up. If, for example the length is 1/4 and the divide value is 5, therefore our basic value is 1/20. If the multiply value is 2 (maximum) the basic value 1/20 is to be multiplied by either 1 (giving a 1/20 length) or 2 (giving a 1/10 length). We can therefore create more interesting divisions to a given duration by introducing this form of variation:
(progn
(setf vec (gen-noise 60 :type :gaussian :seed 9847))
(setf pitches (filter-repeat 1 (vector-to-pitch '(e1 g4) vec)))
(setf omn (make-omn :length '(q q q q h h w e e e e e e e e)
:pitch pitches
:span :pitch))
(setf lv (length-weight omn :weight '(6 1)))
(setf mat (omn-to-time-signature lv '(4 4)))
(setf transp (pitch-transpose 12 mat))
(setf variant (voice-variant transp
:divide '(2 3 2 2 5 5 4 2 2 2 2 2 2 2 2)
:multiply '(2 1 1 2 2 2 1 2 2 1 2 1 1)
:rest '?
:interval '((0 1 2 3) (13) (3 2 1 0) (13))
:variant '?))
(def-score var5
(
:key-signature 'chromatic
:flexible-clef t
:time-signature '(2 4)
:tempo 86
:layout (list
(treble-layout 'v1 :name "Material" :abbr "M")
(treble-layout 'v2 :name "Variant" :abbr "V"))
)
(v1 :omn mat
:channel 1
:sound 'gm
:program 1)
(v2 :omn variant
:channel 2)
)
(audition-musicxml-last-score)
)
VI.
Source material: Right hand part of the variations op.27 by A. Webern:
(progn
(setf rh
'((-s) (e f4e5 pp -s db5)
(-s) (-s eb4 pp c4d5 -)
(-s) (-s c4d5 pp eb4 -)
(-s) (e db5 pp -s f4e5)
(-s) (s gb4f5 p a5 -)
(s d4ab4db5 p bb4 -) (-s a5 p gb4f5)
(-s) (s b5 f gb4g5 -)
(s a3bb4 f ab4 -) (s c4d5 f> eb4 -)
(s db5 f> f4e5 -) (-s)
(s gb4f5 p a5 d4ab4db5 bb4 -) (-s)
(-s a5 pp gb4f5) (-s)
(-t b2 f e3 bb3 - d5 c4eb4) (-s)
(s db3 f - s. g5 -t) (s gb4f5 p)
(-t a3 mp ab3 mf -s. t db5f5 f c4 -) (s e3e4 p)
(-t s. d2 f -s ab5 mf) (-s)
(t gb4a4 p g3 mp - b2 f e3 bb3 e3 a3 eb4 - g5 mf f4ab4 mp) (-s)
(s f2 f - s. c6 -t) (s b2bb3 p)
(-s t db5 mp -s. t gb5bb5 f4 f -) (t a3 f ab2 - ab2 a3)
(-t f4 f gb5bb5 mf) (-t a3 mp d4ab4 c4 p bb5db6 mf)
(-t b2 f3 b2 -) (t bb5db6 c5 f d4ab4 a3 p)
(-s) (t b4eb5 p bb3 -)
(t d4 p db3 - db3 d4) (-t bb3 p b4eb5)
(-s) (-s eb5 p bb3b4 -) (-s)
(e d4db5 p -s c5) (-s)
(e c5 p -s d4db5) (-s)
(-s bb3b4 p eb5 -) (-s)
(-s ab3g4 p e4 mf) (-s c4gb4b4 f5)
(-s db5 mp bb3a4) (-s)
(-s eb4d5 p gb4) (-s e4 p f3g4)
(-s b3 p a2bb3) (-s c5db6 pp ab5)
(-s) (-s e5eb6 p g5 c4f4b4 p> gb4)
(-s) (-e) (e d5ab5db6 pp)))
(setf augmentation (length-augmentation 4 rh))
(setf mat (omn-to-time-signature augmentation '(4 4)))
(setf mat1 (pitch-transpose 12 mat))
(setf mat2 (pitch-transpose -12 mat))
(setf p1 (voice-variant mat1
:measure '(1/2 1 1)
:divide (rnd-sample 24 '(2 3 5))
:rest '(? n n n ?)
:interval (rnd-sample 24 '((0) (6) (13)))
:variant (rnd-sample 24 '(i r ri))))
(setf p2 (voice-variant mat2
:measure '(1/2 1 1)
:divide (rnd-sample 24 '(1 2))
:rest '(? n n n ?)
:interval (rnd-sample 24 '((0) (6) (13)))
:variant (rnd-sample 24 '(i r ri))))
(setf v1 (length-weight p1 :weight '(7 2)))
(setf v2 (length-weight p2 :weight '(7 1)))
(def-score var6
(
:key-signature 'chromatic
:flexible-clef t
:time-signature '(2 4)
:tempo 86
:layout (list
(treble-layout 'v1 :name "Variant1" :abbr "V1")
(treble-layout 'v2 :name "Variant2" :abbr "V2"))
)
(v1 :omn v1
:channel 1
:sound 'gm
:program 1)
(v2 :omn v2
:channel 2))
(audition-musicxml-last-score)
)
The following example randomly segments a list of given pitches into progressively increasing sublist of elements. I can't seem to recall a function one could use instead of rnd-repeat that would do the same but not randomly, preserving the original order or pitches => (c4) (d4 e4) (f4 g4 a4), etc.
If you open .opmo file in other text editor (like Emacs etc...) then the icon can/will change.
Open Info with the file and select Open with: Opusmodus.
This is how macOS works.
I wrote a function myself, not sure if it is acceptable for Janusz 🙂
hth
(defun remove-tie (y)
"tests if it is a single list or a list of lists,then remove ties"
(if (car (mapcar #'listp y))
(loop for x in y
for z = (remove 'tie x)
for a = (remove 'tie+tie z)
collect a) (remove 'tie+tie (remove 'tie y))))
Edit: I think this only removes ties between bars as I remember correctly..