Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 06/20/2018 in all areas

  1. 4 points
    Audition format (excerpts) of various personal application studies for Opusmodus. .. .
  2. 3 points
    JulioHerrlein

    Turing Piano (Julio Herrlein)

    Dear Friends, I'd like to share a composition all made in Opusmodus. The composition is part of the Portfolio of my Doctoral Dissertation. I'd like to thank you so much, Opusmodus and the support of you here in this forum was amazing !! Love you all !! TURING PIANO (Julio Herrlein) Here is the commented code for the First Section: ;;;PART A ;PITCHES – The pitch structure are based on "chevron-like" patterns. This can be related to some Xenakis ideas: the arborescences, the music as a plot idea. (setf patpit (integer-to-pitch (gen-integer-step 0 68 '(1 -2 3 -4 5 -6 7 -8 9 -10 11)))) (setf patpit2 (integer-to-pitch (gen-integer-step 0 68 '(11 -10 9 -8 7 -6 5 -4 3 -2 1)))) ;;; This interval pattern leads to an infinite ascending movement, like the picture below: ;;; After that, I decided to restrict the ambitus of the pattern, otherwise it goes ascending forever. I did the restriction thinking in the hands of the pianist, in a way to not collide or crossing the hands. ;;;After the ambitus restriction, the next step was find some partitions to make some chords for the piece, so each hand have a diferent partition of the chevron-like pattern, like below (setf pitpartition (ambitus '(g3 c6)(chordize-list (gen-divide '(1 1 1 3 1 1 1 2) patpit)))) (setf pitpartition2 (ambitus '(g1 g3)(chordize-list (gen-divide '(2 1 1 1 1 2 1 1 1 1 1 1 1 1) patpit2)))) ;;; Next, i decided on the Rhythms to use. The rhythms are complementary, i.e., each hand plays on the silence of the other, using the following pattern: DIGRESSION: The FORTE NUMBERS are part of my dissertation that makes the conversion of the entire Forte sets onto Rhythms modulo 12. The dissertation (in portuguese) can be downloaded HERE: Das alturas ao ritmo : teoria dos conjuntos rítmicos como ferramenta composicional From pitches to rhythm: rhythmic set theory as a compositional tool. http://hdl.handle.net/10183/179457 Abstract This doctoral dissertation is divided into two parts: the first deals a rhythmic set theory, and the second contains the portfolio of compositions developed during this period of studies. This dissertation presents a system of rhythmic organization parallel to the musical set theory pitch class organization FORTE (1973), as well as an adaptation of the time-point-system (BABBITT, 1962). From the standpoint of the traditional set theory, and also from the diatonic set theory, this unified approach allows to estabilish a connecting tissue of basic aspects: from the harmony and chords symbols to the rhythmic organization. At one time, in a complete catalog, the families of pitch class sets and chord symbols are related to their respective rhythmic counterparts. The musical motivation for this research came from my interest in the swinging and groovy repetitive rhythms called timelines (TOUSSAINT, 2013), commonly used in popular music. These dancing timelines have properties similar to those of the diatonic sets, and for this reason, this dissertation presents some properties of the diatonic pitch class sets, drawing a parallel with their rhythmic counterparts. These relationships also appear in the portfolio of compositions, characterizing some procedures used. The portfolio of compositions, which includes a composition for symphony orchestra, is presented form the standpoint of a duality between transparency and opacity. This duality address the essential differences in the audibility of the results from various composition techniques. This study of Rhythmic Set Theory will serve as an analytical approach of my compositional output in popular music, with a systematic way to understant and to extrapolate some aspects already used in my practice as composer and improviser. Here is the rhythm used in Turing Piano (with Forte numbers and rotations) (setf ritmo1 (gen-repeat 10 '(s s -s s s -s -s -s s -s -s s -s s -s -s s -s s -s -s -s s -s))) (setf ritmo1b (length-invert ritmo1 :omn t)) ; DINAMICS: Following the parametric stuff, I decided to set the dynamics, according to the harmonic density, i.e. the more notes, the more louder. (setf din1 (span pitpartition '(p p p ff p mf pp ff))) (setf din2 (span pitpartition2 '(f p p p p ff p p ff pp pp f mf mf))) ;ASSEMBLING of the materials (setf lhmat1 (make-omn :length ritmo1 :pitch (pitch-transpose 4 pitpartition) :velocity din1)) (setf rhmat1 (make-omn :length ritmo1b :pitch (pitch-transpose 4 pitpartition2) :velocity din2)) ;MONTAGE of music blocks (assemblage) (setf pianoassemblerh (assemble-seq lhmat1)) (setf pianoassemblelh (assemble-seq rhmat1)) ;;;SCORE- Layout (def-score Miniatura-pno1 (:key-signature 'atonal :time-signature '(3 4) :tempo 85 :octave-shift '(c2 c6) :layout (grand-layout 'pno :all-accidentals 'all)) (pno :omn (merge-voices lhmat1 rhmat1) :channel 1 :sound 'gm :program 0) ) COMPLETE VIDEO
  3. 3 points
    Eno/Byrne-esque 'Beat-Betas' as audition tape (i.e. 60 second continuous excerpts). Opusmodus generated MIDI...Mixed as "prototypes" in Logic 9.1.8,'auditioned' in iTunes 'live' to "Audio Hijack Pro".
  4. 3 points
    Wow, thank you...that means a lot coming from you :) Even at my extremely novice level with Opusmodus, the possibilities of what I can accomplish towards my own goals (experimental electronics) are seemingly endless :) The combination of the online documentation and the continuing insights/inspiration derived from this forum and it's generous and talented contributors....is making this first leg of my learning Opusmodus an extremely exciting and rewarding period of education...and as I am able generate and collect these audio materials into a personal library, no doubt Opusmodus will allow me to develop unique approaches to electronic musiking which is my primary driving force ;-)
  5. 1 point
    ;;; SET Variables (setf pitch-1 '(c2 cs2 d2 ds2 e2 f2 fs2 g2 gs2 a2 as2 b2 c3 cs3 d3 ds3 e3 f3 fs3 g3 gs3 a3 as3 b3)) (setf pitch-2 '(c2 cs2 d2 ds2 e2 f2 fs2 g2 gs2 a2 as2 b2 c3 cs3 d3 ds3 e3 f3 fs3 g3 gs3 a3 as3 b3 c4)) (setf reverse-p (nreverse pitch-2)) (setf rotation-p-1 (gen-rotate :left pitch-1 :type :seq)) (setf rotation-p-2 (gen-rotate :right reverse-p :type :seq)) (setf rotation-p-3 (gen-rotate :right pitch-1 :type :seq)) (setf rotation-p-4 (gen-rotate :left reverse-p :type :seq)) (setf rotation-combo-A (gen-repeat 17 (append rotation-p-1 rotation-p-3))) (setf rotation-combo-B (gen-repeat 16 (append rotation-p-2 rotation-p-4))) (setf bin-map-1 (binary-map (gen-binary-euclidean 1 8 5 7) 's)) (setf bin-map-2 (binary-map (gen-binary-euclidean 1 8 5 8) 's)) ;;----------------- (setf drum-rotation-1 (make-omn :pitch rotation-combo-A :length (span rotation-combo-A bin-map-1) :velocity '(ff mp = = = = = =))) (setf drum-rotation-2 (make-omn :pitch rotation-combo-B :length (span rotation-combo-B bin-map-2) :velocity '(ff mp = = = = = =))) ;;; SET Voices (setf Voice1 drum-rotation-1) (setf Voice2 drum-rotation-2) ;;;-------------------------- (def-score Euclidean-Rotations ( :key-signature 'chromatic :time-signature '(4 4) :composer "Loopy C" :copyright "Copyleft © 2017 Chris R Gibson" :tempo 106 :flexible-clef t :ignore-velocity t ) (inst1 :omn Voice1 :port 0 :channel 1 :sound 'Logic :program '1 :volume 90) (inst2 :omn Voice2 :port 0 :channel 2 :sound 'Logic :program '1 :volume 90) ) Really, REALLY basic code...but indulges my interests in shifting rhythm patterns. Pitch-lists are designed for the triggering of Spectrasonics 'Stylus RMX', the mixes then taking three stereo pairs and applying separate fx processing for final bounce in Logic 9.1.8. As I said, pure indulgence of a personal compulsion...shared here simply as example of the variety of Opusmodus application as applied to beat creation. ...
  6. 1 point
    Not much, but happy to share. Somedays, I just set up a live audio host and some interesting instruments and samples, and then 'browse' the Opusmodus documentation. In these sessions, I am combining a playful way to add to my knowledge while generating audio materials via audition and MIDI Export for my library to be used as later combinatory/compound materials. As the title suggests, these are just live experimentations with 'vector-to-length', along with variations on a theme to the value of 'vector-smooth' (from min to max value over session period). ;; (setf vector (gen-white-noise 10000)) (setf v2l-1 (vector-to-length '1/128 -3 13 vector)) (setf v2l-s-1 (vector-to-length '1/128 -3 13 (vector-smooth 0.1 vector))) (setf chromatic-12 '(c2 cs2 d2 ds2 e2 f2 fs2 g2 gs2 a2 as2 b2)) (setf chromatic-16 '(c2 cs2 d2 ds2 e2 f2 fs2 g2 gs2 a2 as2 b2 c3 cs3 d3 ds3)) ;;----------------------------- (setf voice-1 (make-omn :length (length-weight v2l-s-1 :weight '(34 1)) :pitch (span v2l-s-1 chromatic-16) :velocity (messiaen-permutation '(ff f mf mp p)))) ;;----------------------------- ...and with pitch-figurate and additional permutation: (setf voice-1 (make-omn :length (length-weight v2l-s-1 :weight '(67 1)) :pitch (span v2l-s-1 (pitch-figurate 6 chromatic-12 :interval (messiaen-permutation '(1 -1 2 -2 3 -3 4 -4 5 -5)))) :velocity (messiaen-permutation (messiaen-permutation '(ff f mf mp p))))) The pitch list is for the sequential triggering 'sample slices' via New Sonic Arts 'Vice', each slice corresponding to a specific pitch (thus the pitch-figurate serves to add controllable variation of slice triggering). The exercise is focused on rhythm, but in the context of untraditional/non-percussion materials ;-) hth ...
  7. 1 point
    AM

    filter-omn-by-intervals

    a sieve/filter-function - filters specific INTERVALS and replacing the others by rests. (don't work perfect, but as a sketch....) ;;; (defun equal/or (n alist) (car (loop for i in alist when (equal i n) collect 't))) ;;; FUNCTION (defun filter-omn-by-intervals (omn-seq intervals) (setf omn-seq (loop with omn-events = (single-events omn-seq) with i = 0 while (not (null (nth i omn-events))) when (equal/or (car (pitch-to-interval (append (omn :pitch (nth i omn-events)) (omn :pitch (nth (1+ i) omn-events))))) intervals) collect (list (nth i omn-events) (nth (1+ i) omn-events)) and do (incf i 2) else collect (neg! (car (omn :length (nth i omn-events)))) and do (incf i)))) ;;; EXAMPLE (setf basic-omn-seq (make-omn :pitch (vector-to-pitch '(c4 c6) (gen-white-noise 100 :type :logistic)) :length '(t) :span :pitch)) ;;; check out all these filter-tests (setf omn-seq (filter-omn-by-intervals basic-omn-seq '(1 2 3))) ;(setf omn-seq (filter-omn-by-intervals basic-omn-seq '(3 -3))) ;(setf omn-seq (filter-omn-by-intervals basic-omn-seq '(1 -1 5 -5 7 -7))) (def-score example (:title "example" :key-signature 'atonal :time-signature '(4 4) :tempo 90) (instrument1 :omn (flatten omn-seq) :channel 1 :sound 'gm-piano) (instrument2 :omn (flatten basic-omn-seq) :velocity 20 :channel 3 :sound 'gm-piano)) here is a more complex example (defvar library) (defvar abfolge) (defvar omn-seq) (defvar rhy) (defvar field) ;;;library + rhy -------------------------------------------------------------------------------- (setf rhy 44) ;;; LIBRARY MIRT RHY-PAAREN! (setf library (list '(eb5 5 p mute) '(e4 5 mf mute) '(gs4 3 f mute) '(g5 3 ppp mute) '(f6 2 p mute) '(cs4 1 f mute) '(d5 1 fff mute) '(b3 4 pppp mute) '(bb5 4 mp mute) '(a4 3 pp mute) '(fs3 (2 7) ppp mute) '(c6 (1 11) mp mute))) (setf library (loop for i in library collect (append (list (car i)) (if (listp (cadr i)) (gen-length (list (rnd-pick (cadr i))) rhy) (gen-length (list (cadr i)) rhy)) (filter-last 2 i)))) ;;; gen seq from library/abfolge--------------------------------------------------------------- (setf field '(eb5 e4 gs4 g5 f6 cs4 d5 b3 bb5 a4 fs3 c6)) (setf abfolge (pick-norepeat 500 field)) (setf omn-seq (loop for x in abfolge with y do (setf y (assoc x library)) append (append (reverse (filter-first 2 y)) (filter-last 2 y)))) (setf basic-omn-seq omn-seq) (setf omn-seq (filter-omn-by-intervals basic-omn-seq '(1 -1 11 -11 13 -13 4 -4 8 -8 16 -16 20 -20 28 -28 32 -32 7 -7 19 -19))) ;;;--------------------------------------------------------------------------------------------- (def-score example2 (:title "example2" :key-signature 'atonal :time-signature '(4 4) :tempo 90) (instrument :omn (flatten omn-seq) :channel 1 :sound 'gm-piano) (hidden-structure :omn (flatten basic-omn-seq) :channel 1 :velocity 0 :sound 'gm-piano)) ;;;--------------------------------------------------------------------------------------------- (omn-list-plot (flatten omn-seq) :join-points t)
  8. 1 point
    Grand improvisation, cool indeed 😎
  9. 1 point
    AM

    rest-diminution/augmentation

    i needed functions which shorten/enlarge only the RESTS of my complex/tupled-mixed texture - not precisely - so i coded it with diminution/augmentation+round (otherwise i would be in trouble by the crazy rests)... violà... use it or code it smarter for OMPO! greetings andré 3 functions: rest-diminution rest-augmentation only-length-augmentation ;;; (defun rest-diminution (omnlist &key (factor 1) (round 1/4)) (length-rest-merge (flatten (loop for i in (single-events (length-rest-merge omnlist)) when (< (car (omn :length i)) 0) collect (length-rational-quantize (length-diminution factor i) :round round) else collect i)))) (rest-diminution '(-3q q e4 mp -w e e4 ff) :factor 3 :round 1/4) => (-q e4 mp -h e e4 ff) (rest-diminution '(-3q q e4 mp -w e e4 ff) :factor 3 :round 1/8) => (-e q e4 mp -q. e e4 ff) ;;; (defun rest-augmentation (omnlist &key (factor 1) (round 1/4)) (length-rest-merge (flatten (loop for i in (single-events (length-rest-merge omnlist)) when (< (car (omn :length i)) 0) collect (length-rational-quantize (length-augmentation factor i) :round round) else collect i)))) (rest-augmentation '(-3q q e4 mp -w e e4 ff) :factor 3 :round 1/4) => (-q e4 mp -d. e e4 ff) (rest-augmentation '(-3q q e4 mp -w e e4 ff) :factor 3 :round 1/8) => (-q e4 mp -d. e e4 ff) ;;; (defun only-length-augmentation (omnlist &key (factor 1) (round 1/4)) (length-rest-merge (flatten (loop for i in (single-events (length-rest-merge omnlist)) when (> (car (omn :length i)) 0) collect (length-rational-quantize (length-augmentation factor i) :round round) else collect i)))) (only-length-augmentation '(-3q q e4 mp -w e e4 ff) :factor 3 :round 1/8) => (-3q h. e4 mp -w q. e4 ff) (only-length-augmentation '(-3q q e4 mp -w e e4 ff) :factor 3 :round 1/4) => (-3q h. e4 mp -w q. e4 ff -e)
  10. 1 point
    AM

    filter-events-by-length

    you can filter all events by length (>= min). all other events will be replaced by rests... (defun filter-events-by-length (omnlist &key min) (let ((omnlist (single-events omnlist)) (min (car (omn :length (list min))))) (flatten (length-rest-merge (loop for i in omnlist when (>= (car (omn :length i)) min) collect i else collect (neg! (car (omn :length i)))))))) (filter-events-by-length '(e c4 d4 e4 e5 q c4 d4 e4 h c4 d4 e4) :min 'e) => (e c4 mf e d4 mf e e4 mf e e5 mf q c4 mf q d4 mf q e4 mf h c4 mf h d4 mf h e4 mf) (filter-events-by-length '(e c4 d4 e4 e5 q c4 d4 e4 h c4 d4 e4) :min 'q) => (-h q c4 mf q d4 mf q e4 mf h c4 mf h d4 mf h e4 mf) (filter-events-by-length '(e c4 d4 e4 e5 q c4 d4 e4 h c4 d4 e4) :min 'h) => (-wq h c4 mf h d4 mf h e4 mf)
  11. 1 point
    opmo

    filter-events-by-length

    I like that. Will do shortly.
  12. 1 point
    AM

    filter-events-by-length

    @janusz: you could expand it with conditionals like >, <, =, span .... and implement it.... and... if you would write this function with conditionals for pitches (sequences of pitches) you could filter by vector-envelope...
  13. 1 point
    opmo

    binary-filter

    Predefined functions can't be changed otherwise you would break the system. I will make a doc for the binary-invert function soon.
  14. 1 point
    AM

    binary-filter

    something i've coded... (defun binary-filter (alist bin-list) (let ((event-list (cond ((omn-formp alist) (single-events alist)) (t alist)))) (flatten (loop for i in event-list for j in bin-list when (= j 1) collect i else append (cond ((omn-formp i) (list (length-invert (car i)))) ((lengthp i) (neg! (omn :length (list i))))))))) (binary-filter '(q -q -q q) '(0 1 0 1)) => (-1/4 -q -1/4 q) (binary-filter '(q q q q -q) '(0 1 0 1 1)) => (-1/4 q -1/4 q -q) (binary-filter '(c4 d4 e4 f4) '(1 1 0 1)) => (c4 d4 f4) (binary-filter '(q c4 mf d4 e4 e f4 ppp g4 a4 b4) '(1 0 1 1 0 1 1)) => (q c4 mf -1/4 q e4 mf e f4 ppp -1/8 e a4 ppp e b4 ppp)
  15. 1 point
    opmo

    binary-filter

    (defun binary-filter (alist bin-list &key (omn t)) (let ((event-list (cond ((omn-formp alist) (single-events alist)) (t alist)))) (flatten (loop for i in event-list for j in bin-list when (= j 1) collect i else append (maybe-omn-decode omn (cond ((omn-formp i) (list (length-invert (car i)))) ((lengthp i) (neg! (omn :length (list i)))))))))) (binary-filter '(q c4 mf d4 e4 e f4 ppp g4 a4 b4) '(1 0 1 1 0 1 1)) => (q c4 mf -q q e4 mf e f4 ppp -e e a4 ppp e b4 ppp) Only one type of parameters can be decoded at a time.
  16. 1 point
    o_e

    binary-filter

    Hi André Just investigating your function.. Then I've tried a little cosmetic hack to make it more readable, but it did not work out and I don't understand why. What did I overlook? Thanks! ole ;;; the orginal function (defun binary-filter (alist bin-list) (let ((event-list (cond ((omn-formp alist) (single-events alist)) (t alist)))) (flatten (loop for i in event-list for j in bin-list when (= j 1) collect i else append (cond ((omn-formp i) (list (length-invert (car i)))) ((lengthp i) (neg! (omn :length (list i))))))))) (binary-filter '(q c4 mf d4 e4 e f4 ppp g4 a4 b4) '(1 0 1 1 0 1 1)) => (q c4 mf -1/4 q e4 mf e f4 ppp -1/8 e a4 ppp e b4 ppp) ;;;Why is it not working?? (defun foo-rep (n sequence &key omn) (maybe-omn-decode omn (binary-filter n sequence))) (foo-rep '(q c4 mf d4 e4 e f4 ppp g4 a4 b4) '(1 0 1 1 0 1 1) :omn t) -->(q c4 mf -1/4 q e4 mf e f4 ppp -1/8 e a4 ppp e b4 ppp);??
  17. 1 point
    AM

    omn-sieve-filter

    (defun memberp (n liste) (not (equal 'nil (member n liste)))) ;;; MAIN (defun omn-sieve-filter (omn-list filter-list) (flatten (loop for i in (single-events omn-list) for j from 1 to (length omn-list) when (memberp j filter-list) collect i else collect (length-invert (car i))))) (omn-sieve-filter (make-omn :pitch (rnd-sample 10 '(c4 d4 e4 fs4 gs4) :seed 89) :length '(e) :span :pitch) '(1 2 3 5 8 9 10)) => (e c4 mf e gs4 mf e fs4 mf -1/8 e e4 mf -1/8 -1/8 e c4 mf e gs4 mf e fs4 mf)
  18. 1 point
    Hi Torsten, my Mac have 16gig of RAM. Also, i'm using an SSD. About the articulations, if you expand one instrument group, you will see the play module AND a bidule keyswitcher who allow me to have the soundset i use. Best, S. added 6 minutes later Actually, i use a derivation of this with Bidule encapsuled into Logic X. I attach the logic template here, if you want to have a look. Best S. BaseOrch5.logicx.zip
  19. 1 point
    Hi, here's for study purpose the Opusmodus score of the first movement of my piano trio. All the best to the wonderful Opusmodus users community ! SB. PianoTrio-SlonimskyV2.opmo
  20. 1 point
    I am interested in controlling musical textures, i.e., relations between polyphonic parts. I defined a bunch of functions that use the simple polyphonic music representation used also by my function preview-score that I presented shortly (see https://opusmodus.com/forums/topic/902-polyphonic-preview/#comment-2686). Apologies that this post is a bit longer. Here is a particularly flexible function: map-parts transforms a polyphonic score. It is a variant of the standard Lisp function mapcar, where a function is applied to every part in a score, but each instrument/part can be given its own function arguments for the transformation. One argument is the respective part of the score. This argument is marked by an underscore (_) in the argument lists. In the following example, the function pitch-transpose is applied to a score with two very simple parts consisting of only a single note each. This function has two required arguments, a transposition interval (measured in semitones), and the pitch sequence or OMN to transpose. The transposition interval for the first part is 4 (major third upwards), and the underscore marks the position of the violin part to transpose, etc. Note that you can always see and hear the resulting score by wrapping preview-score around each example. Hopefully these examples sufficiently demonstrate my need to have some shortcut for preview-score :) (map-parts '(:vln ((h e4)) :vlc ((h c3))) #'pitch-transpose '(:vln (4 _) :vlc (12 _))) => (:vln ((h gs4)) :vlc ((h c4))) Here are a few more relatively simple application examples. I am first defining some musical material to reduce the length of the remaining definitions. (setf material '((-3h fs4 pp eb4 <) (q e4 < fs4 <) (3h gs4 mp> a4 > bb4 >) (q a4 pp -) (-5h - g4 pp leg eb4 < leg d4 < leg) (q bb4 < e4 <) (5h g4 mp> leg b4 > leg a4 > leg bb4 > leg d4 > leg) (q gs4 pp -))) Now, the next example creates a strict canon formed with the given material -- but without following any counterpoint rules :) For different parts the material is metrically shifted and transposed. This example also shows that map-parts calls can be nested (naturally). The function metric-shift appends some rest before some musical material, but preserves its rhythmical structure, i.e. metrically shifts the material. (map-parts (map-parts `(:vl1 ,material :vl2 ,material :vla ,material :vlc ,material) #'metric-shift '(:vl1 :skip ;; :skip means to leave part unchanged :vl2 (-q _) :vla (-h _) :vlc (-h. _))) #'pitch-transpose '(:vl1 (6 _) :vl2 (4 _) :vla (2 _) :vlc :skip)) The next examples shows some simple homorhythmic texture created by randomised transpositions. Each part shares a similar overall pitch profile. Note also that calls can be more concise with a (lambda) function that nests calls to transformation functions -- instead of nesting map-parts as shown above. (map-parts `(:vl1 ,material :vl2 ,material :vla ,material :vlc ,material) #'(lambda (transpose seq) ;; static transposition for moving parts into different registers (pitch-transpose transpose ;; randomised transposition of notes in parts (pitch-transpose-n (rnd 10 :low -2 :high 2) seq))) '(:vl1 (7 _) :vl2 (0 _) :vla (-10 _) :vlc (-20 _))) Finally, here is a homophonic texture created by random pitch variants (retrograde, inversion etc.). The global pitch profiles of parts differ here, in contrast to the previous example. (map-parts `(:vl1 ,material :vl2 ,material :vla ,material :vlc ,material) #'pitch-variant `(:vl1 (_ :transpose 7 :seed 10) :vl2 (_ :transpose 0 :seed 20) :vla (_ :transpose -10 :seed 30) :vlc (_ :transpose -20 :seed 40)) :shared-args '(:variant ?)) All these examples demonstrate very conventional textures, as such textures are more easy to explain. For completeness, below is the definition of MAP-PARTS. There are various dependencies that I tried all to add as well. Please let me know if I missed any definition, and apologies in advance. Best, Torsten (defun map-parts (score fn part-args &key (parameter nil) (shared-args nil)) "Create or transform a polyphonic score. The original purpose is for creating/transforming musical textures, i.e., relations between polyphonic parts. Applies function `fn' to parts in `score': this function is a variant of the standard Lisp function `mapcar', but specialised for scores. A score is represented in the format discussed in the documentation of the function `preview-score'. Additional arguments for `fn' can be specified in `part-args', and these argument lists can be different for each part. However, one argument is the part of the score. This argument is marked by an underscore (_) in the argument lists. In the following example, the function `pitch-transpose' is applied to a score with two parts. This function has two required arguments, a transposition interval (measured in semitones), and the pitch sequence or OMN to transpose. The transposition interval for the first part is 4 (major third upwards), and the underscore marks the position of the violin part to transpose, etc. ;;; (map-parts '(:vln ((h e4)) ;;; :vlc ((h c3))) ;;; #'pitch-transpose ;;; '(:vln (4 _) ;;; :vlc (12 _))) Args: - score (headerless score): See {defun preview-score} for format description. - fn: A function that expects and returns an OMN sequence or a sequence of parameter values (e.g., lengths, or pitches) as specified in the argument `parameter'. - part-args (plist): Alternating instrument keywords (same as in `score') followed by arguments list for `fn' for that instrument/part. If arguments is :skip, then that part is returned unchanged. - parameter (omn parameter, e.g., :length or :pitch, default nil means processing full OMN expression): If `fn' expects only single parameter to process, then it can be set here. - shared-args (list): For all instruments/parts, these arguments are appended at end end of its part-specific arguments. They are useful, e.g., for keyword arguments. " ;; catching hard-to-find user error... (let* ((instruments (get-instruments score)) (missing-instruments (remove-if #'(lambda (arg-instr) (member arg-instr instruments)) (get-instruments part-args)))) (assert (not missing-instruments) (part-args) "map-parts: Some instruments in `part-args' don't have a matching instrument in `score'. ~A.~%" missing-instruments)) (let ((parts (make-hash-table :test #'equal))) ;; fill hash table, using leading keywords as keys (loop for part in (tu:plist->pairs score) do (setf (gethash (first part) parts) part)) (tu:pairs->plist (loop for instrument-arg-pair in (tu:plist->pairs part-args) for instrument = (first instrument-arg-pair) for part = (gethash instrument parts) for part-omn = (second part) for fn-args = (second instrument-arg-pair) collect (if (equal fn-args :skip) part ; no processing (cons instrument (let ((result (apply fn (append (substitute (if parameter (omn parameter part-omn) part-omn) '_ fn-args) shared-args)))) (list (if parameter (omn-replace parameter result part-omn) result))))) )))) (defun metric-shift (l lengths) "Appends `l' (a length or omn) before `lengths' (a list of lengths or omn), but maintains the metric structure, i.e., the function shifts `lengths' metrically 'to the right' by `l'. Returns an OMN form if lengths is an OMN form, otherwise a length form. Related: assemble-seq (but that does not shift across bars)" (let* ((time-sigs (get-time-signature lengths)) (result (omn-to-time-signature (cons l (flatten lengths)) time-sigs))) (if (omn-formp lengths) result (omn :length result)))) ; (metric-shift '-h '((q q q q) (q q q q))) ; (metric-shift '(h g4) '((q c4 q d4 q e4 q f4) (q c4 q d4 q e4 q f4))) (defun get-instruments (score) "Returns all instruments of `score', a headerless score (see {defun preview-score} for its format)." (at-even-position score)) (defun at-even-position (in-list) (at-position in-list 2 0)) (defun at-position (in-list factor offset) "Returns a list containing every factor-th elements of in-list starting at offset" (mapcar #'(lambda (i) (nth i in-list)) (arithmeric-series factor offset (ceiling (/ (length in-list) factor))))) (defun arithmeric-series (factor offset length) (let (result) (reverse (dotimes (i length result) (push (+ (* i factor) offset) result))))) (defun plist->pairs (plist) (loop :for (key val) :on plist :by #'cddr :collect (list key val))) (defun pairs->plist (pairs) (one-level-flat pairs)) (defun one-level-flat (list) "flatens one level of the given form. Example: (one-level-flat '(((note) (note)) ((pause) (pause)) ((note)))) -> ( (note) (note) (pause) (pause) (note))" (apply #'append list))
  21. 1 point
    Stephane Boussuge

    Klangreihen Model

    Hi Rangarajan you will find all the information into this book: https://www.amazon.co.uk/Serial-Composition-Tonality-Dominik-Sedivy/dp/3902796030/276-6904282-9885755?ie=UTF8&*Version*=1&*entries*=0 Best regards SB.
  22. 1 point
    This is a great learning experience. Both SB and AM thank you so much!!!! Worked on page 90 of Slonimsky's book to further discover what can be done with make-scale and came up with the following: ;; Slonimsky 648 (make-scale 'c4 14 :alt '(13 -11) :type :pal) ;; Slonimsky 649 (make-scale 'c4 14 :alt '(13 13 -11 -11) :type :pal) ;; Slonimsky 650 (make-scale 'c4 13 :alt '(13 13 13 -11 -11 -11) :type :pal) ;; Slonimsky 651 (make-scale 'c4 13 :alt '(1 13 -11) :type :pal) ;; Slonimsky 652 (make-scale 'c4 13 :alt '(13 -11 1) :type :pal) ;; Slonimsky 653 (make-scale 'c4 13 :alt '(13 1 -11) :type :pal) ;; Slonimsky 654 (make-scale 'c4 13 :alt '(1 1 13 1 1 -11) :type :pal) ;; Slonimsky 655 (make-scale 'c2 13 :alt '(11 -1 11 -1) :type :pal) ;; Slonimsky 656 - has mismatch with original -> to be checked why (make-scale 'c2 14 :alt '(11 11 -13 11) :type :pal) ;; Slonimsky 657 - has mismatch with original -> to be checked why (make-scale 'c2 14 :alt '(11 11 11 11 -13 -13 -13) :type :pal) It makes my day :-) Wim Dijkgraaf
  23. 1 point
    AM

    Beginner: Slonimsky 648 as a function

    in lisp -> create OMN with (midi-to-pitch)... (setq half-row (loop repeat 13 with interval with stack = 60 with cnt = 0 when (oddp cnt) do (setq interval 13) when (evenp cnt) do (setq interval -11) when (= cnt 0) collect stack else collect (setq stack (+ stack interval)) do (incf cnt))) (midi-to-pitch (append half-row (reverse (butlast half-row))))
  24. 1 point
    Hi, may be this can do what you want: (make-scale 'c4 14 :alt '(13 -11) :type :pal) SB.
  25. 1 point
    ajf-

    Klangreihen Study

    Here is my study about the klangreihen: (defparameter tempo 60) (defparameter title "Klangreihen Study") ;;; This object takes care of setting and getting of parts (defclass study-score () ((instruments :initarg :instruments :initform 0) (duration :initarg :duration :initform 0) (parts))) ;;; When initializing, fill it with an empty model for parts (array of size N) (defmethod initialize-instance :after ((score study-score) &key) (let ((instruments (slot-value score 'instruments ))) (setf (slot-value score 'parts) (make-array instruments :initial-element '(-w)' :fill-pointer instruments)))) ;;; Getter and setter methods (defun get-part (score n) (elt (slot-value score 'parts) n )) (defun (setf part) (part score n) (let ((previous-value (elt (slot-value score 'parts) n))) (setf (elt (slot-value score 'parts) n) (concatenate 'list previous-value part)))) ;;; Instance of the object (defparameter study (make-instance 'study-score :instruments 16 :duration tempo)) ;;; Main procedure (let* ;; Main local variables ((12tone '(0 2 4 5 7 9 6 8 10 11 1 3)) (variants (list (row-variant 0 'r4 12tone) (row-variant 0 '4 12tone))) (total-parts (slot-value study 'instruments)) (bases (apply #'append (map 'list #'(lambda (v) (klangreihen 0 '(3 3 3 3) v)) variants))) (lengths (subseq (gen-divide total-parts (gen-length (distributive-cube (interference2 '(3 2 2))) 16)) 0 (length bases)))) (loop for base in bases for length in lengths do (labels ;; Local transformative functions ((amount-of (n) (/ 1 (nth n length))) (vel-scale (v) (+ 0.2 (* 0.6 v) )) (vel-format (v) (get-velocity (list v) :type :symbol)) (velocity-for (n) (vel-format (vel-scale (/ (amount-of n) 16)))) (length-for (n) (list (nth n length ))) (octave-of (n) (let ((low-bound (- 12 (* 12 (round (* (/ 1 total-parts) n 3.4) ))))) (list low-bound (+ low-bound 12)))) (pitch-for (n) (let* ((rolled (gen-surround base :size (amount-of n) :start n))) (ambitus (octave-of n) rolled)))) (loop for n from 0 to (- total-parts 1) do (destructuring-bind (&key length pitch velocity) ;; Example of handling on a case-by-case basis. No extra cases configured now. (case n (otherwise (list :length (length-for n) :velocity (velocity-for n) :pitch (pitch-for n) ))) (setf (part study n) (make-omn :length length :pitch pitch :velocity velocity :span :pitch))))))) ;;; Retrieve parts and save score (let ((partnum -1)) (def-score Study (:title title :composer "A. Jacomet" :key-signature 'atonal :time-signature '(4 4) :tempo tempo :layout (string-ensemble-layout '(vn11 vn12 vn13 vn14 vn21 vn22 vn23 vn24) '(vla1 vla2 vla3 vla4) '(vlc1 vlc2) '(ctb1 ctb2))) (vn11 :omn (get-part study (incf partnum)) :sound 'gm :program 'Acoustic-Grand-Piano :channel 1) (vn12 :omn (get-part study (incf partnum)) :sound 'gm :program 'Acoustic-Grand-Piano :channel 2) (vn13 :omn (get-part study (incf partnum)) :sound 'gm :program 'Acoustic-Grand-Piano :channel 3) (vn14 :omn (get-part study (incf partnum)) :sound 'gm :program 'Acoustic-Grand-Piano :channel 4) (vn21 :omn (get-part study (incf partnum)) :sound 'gm :program 'Acoustic-Grand-Piano :channel 5) (vn22 :omn (get-part study (incf partnum)) :sound 'gm :program 'Acoustic-Grand-Piano :channel 6) (vn23 :omn (get-part study (incf partnum)) :sound 'gm :program 'Acoustic-Grand-Piano :channel 7) (vn24 :omn (get-part study (incf partnum)) :sound 'gm :program 'Acoustic-Grand-Piano :channel 8) (vla1 :omn (get-part study (incf partnum)) :sound 'gm :program 'Acoustic-Grand-Piano :channel 9) (vla2 :omn (get-part study (incf partnum)) :sound 'gm :program 'Acoustic-Grand-Piano :channel 11) (vla3 :omn (get-part study (incf partnum)) :sound 'gm :program 'Acoustic-Grand-Piano :channel 12) (vla4 :omn (get-part study (incf partnum)) :sound 'gm :program 'Acoustic-Grand-Piano :channel 13) (vlc1 :omn (get-part study (incf partnum)) :sound 'gm :program 'Acoustic-Grand-Piano :channel 14) (vlc2 :omn (get-part study (incf partnum)) :sound 'gm :program 'Acoustic-Grand-Piano :channel 14) (ctb1 :omn (get-part study (incf partnum)) :sound 'gm :program 'Acoustic-Grand-Piano :channel 15) (ctb2 :omn (get-part study (incf partnum)) :sound 'gm :program 'Acoustic-Grand-Piano :channel 15))) (live-coding-midi (compile-score 'Study)) (display-musicxml 'Study) ;;;--------------------------------------------------------- ;;; ANNOTATION ;;;--------------------------------------------------------- #! This study is about the LISP languages and the possibilities of working with object oriented programming and loops. The first important part of this study is the 'study-score' class defined at the top of the file. (defclass study-score () ((instruments :initarg :instruments :initform 0) (duration :initarg :duration :initform 0) (parts))) On initialization, that object will create and save in one of it's properties, a model of the parts, which is an array of lists. (defmethod initialize-instance :after ((score study-score) &key) (let ((instruments (slot-value score 'instruments ))) (setf (slot-value score 'parts) (make-array instruments :initial-element '(-w)' :fill-pointer instruments)))) It is important to note that this can be extended to an N-dimensional array supporting Parts, Pitches, Velocities, Lengths, and more information. We then define trivial functions that are intended to help in adding and retrieving parts. (defun get-part (score n) (elt (slot-value score 'parts) n )) (defun (setf part) (part score n) (let ((previous-value (elt (slot-value score 'parts) n))) (setf (elt (slot-value score 'parts) n) (concatenate 'list previous-value part)))) This will eventually help keep our program free of code redundancy, and we can adapt the parts in any way we like in a global way. The rest is a simple example of utilizing a klangreihen base and looping over it. The loop starts with a LET clause that sets all the basic parameters: (let* ;; Main local variables ((12tone '(0 2 4 5 7 9 6 8 10 11 1 3)) (variants (list (row-variant 0 'r4 12tone) (row-variant 0 '4 12tone))) (total-parts (slot-value study 'instruments)) (bases (apply #'append (map 'list #'(lambda (v) (klangreihen 0 '(3 3 3 3) v)) variants))) (lengths (subseq (gen-divide total-parts (gen-length (distributive-cube (interference2 '(3 2 2))) 16)) 0 (length bases)))) ..... ) Looping over these global parameters, we start to build our theme sequentially, making all parts for each base. (loop for base in bases for length in lengths do (labels ... )) The LABELS special operator allows us to define local functions for our loop body, that will be helpful in transforming the data. Within it's function body, we have the actual loop that loops over the parts: (loop for n from 0 to (- total-parts 1) ...) The DESTRUCTURING-BIND macro allows us to keep our syntax clean and succint, because we can handle different cases using CASE, while setting Length, Velocity and Pitch, and then in a single line, retrieve those values and use them to set that particular omn in the parts array: (destructuring-bind (&key length pitch velocity) ;; Example of handling on a case-by-case basis. No extra cases configured now. (case n (otherwise (list :length (length-for n) :velocity (velocity-for n) :pitch (pitch-for n) ))) (setf (part study n) (make-omn :length length :pitch pitch :velocity velocity :span :pitch))) !#
×