Jump to content

torstenanders

Members
  • Posts

    496
  • Joined

  • Last visited

Reputation Activity

  1. Like
    torstenanders got a reaction from AM in lisp / special divide - help needed   
    For a generic solution, you could use some function split-if that expects a Boolean function as argument comparing two consecutive pairs, and always splits a sublist if the Boolean function returns True. I don't have such a Lisp function at hand right now, but of an algorithm idea here is a similar Python function, only that this expects a Boolean function of a single argument only. If you port this function to Lisp, you could then generalise it by checking the number of arguments the given Boolean function expects, and it apply it always to the corresponding consecutive number of elements of xs.
     
    def split_if(fun, xs): """ Splits `xs` (list) into sublists based on a test. Starts a new sublist at every element for which Boolean function `fun` returns true. Examples -------- >>> split_if(lambda x: x % 3 == 0, [0, 1, 2, 3, 4, 5]) [[0, 1, 2], [3, 4, 5]] >>> split_if(lambda x: x % 3 == 0, [1, 2, 3, 4, 5, 6, 7]) [[1, 2], [3, 4, 5], [6, 7]] NOTE: Internally, `split_if` skips the first element of `xs`. So, if `fun` is stateful, it should initialise its state using that first element. For an example, see implementation of `format_api.split_into_sections`. """ result_list = [] start = 0 # Collect new list up to x whenever fun(x) == true, but not before first element for index, x in enumerate(xs[1:]): if fun(x): result_list.append(xs[start:index+1]) start = index+1 if start == 0: return [xs] result_list.append(xs[start:]) return result_list  
     
    Here is another approach as well with a Lisp function from my toolbox expecting a list of positions where to split the list. You could find those positions by iterating over conservative pairs of your list elements with the function positions-if listed below.
     
    OK, none of this is a ready made solution, but all the necessary pieces are there 🙂  I need to head back to work now ....
     
    Torsten
     
    (defun subseqs (sequence positions &optional end) "Splits `sequence' into a list of subsequences split at `positions'. Each element in `positions' specifies a position at which a new sublist starts. ; (subseqs '(0 1 2 3 4 5 6) '(0 2 4)) => ((0 1) (2 3) (4 5 6)) ; (subseqs '(0 1 2 3 4 5 6) '(2 4 6) 5) => ((2 3) (4)) `positions' are implicitly sorted and positions beyond end are excluded. " (let* ((updated-pos (sort (if end (remove-if #'(lambda (x) (>= x end)) positions) positions) #'<)) (full-pos (append updated-pos (list (if end end (length sequence)))))) (mapcar #'(lambda (start end) (subseq sequence start end)) (butlast full-pos) (rest full-pos)) )) (defun positions-if (predicate sequence &key key (start 0)) "Like the Common Lisp function `position-if', but returns all positions in `sequence' that match `predicate'. ; (positions-if #'oddp '((1) (2) (3) (4)) :key #'car) ; => (0 2)" (labels ((aux (predicate sequence &key key (start 0) accum) (let ((pos (position-if predicate sequence :start start :key key))) (if pos (aux predicate sequence :start (1+ pos) :key key :accum (cons pos accum)) (reverse accum))))) (aux predicate sequence :start start :key key))) #| ;; comparison (position-if #'oddp '((1) (2) (3) (4)) :key #'car) |#  
  2. Like
    torstenanders got a reaction from Stephane Boussuge in Negative Harmony Function   
    Just a brief follow-up. While Partch's book is obviously available in English, the other authors all wrote in German. More recent Neo-Riemannian theory is often pretty math-heavy, so also somewhat hard to digest for us composers. To get a taste of these harmonic theories in a highly developed form (with dualism throughout, but that is only one facet) delivered by a practicing composers, you might want to have a look at the recent English translation and discussion of Sigfrid Karg-Elert's book Acoustic Determination of Pitch, Chord and Function from 1930.
     
    Byrne, D. A. (2018) The Harmonic Theories of Sigfrid Karg-Elert: Acoustics, Function, Transformation, Perception. PhD Thesis thesis. University of Cincinnati. Online available (with a somewhat slow download speed) at https://etd.ohiolink.edu/apexprod/rws_olink/r/1501/10?p10_etd_subid=162928&clear=10   Warning: this is not for the faint of heart 🙂   Best, Torsten
  3. Thanks
    torstenanders got a reaction from loopyc in Negative Harmony Function   
    Are you simply looking for an invert function, e.g., pitch-invert? 
     
    (pitch-invert '(c4 d4 e4)) => (c4 bb3 gs3)  
    This function inverts (mirrors) around the first pitch by default. If you are looking for retaining the original ambitus, you might want to instead you my function invert-in-ambitus (https://tanders.github.io/tot/sources/pitch.html#_g251910).
     
    (invert-in-ambitus '(c4 e4 g4))  => (g4 eb4 c4)
    BTW, when you are specifically talking about a harmonic context in which you are "mirroring" chords, there exist extensive music theories based on this idea already. The notion of minor chords as the mirror image of major chords, and its implications on harmonic functions (tonic, dominant, subdominant etc.) was in detail explored under the label of dualism by theorists like Hugo Riemann, Arthur von Öttingen and Sigfrid Karg-Elert. They also already generalised this notion for microtonal music. Likely independently of these theorists exploring the notion of dualism, Harry Partch's concept of otonality and utonality is also based on this idea, now firmly in the field of microtonal music. In microtonal harmonic theory I came across this notion also elsewhere (e.g., discussed by the composers and theorists of ekmelic music like Franz Richter Herf, which may have arrived there independently as well.
     
    Anyway, this harmonic concept in general is so basic and fundamental that I would not be surprised it would have been studied by the likes of Pythagoras already...
     
    Best,
    Torsten
  4. Thanks
    torstenanders got a reaction from loopyc in Negative Harmony Function   
    Just a brief follow-up. While Partch's book is obviously available in English, the other authors all wrote in German. More recent Neo-Riemannian theory is often pretty math-heavy, so also somewhat hard to digest for us composers. To get a taste of these harmonic theories in a highly developed form (with dualism throughout, but that is only one facet) delivered by a practicing composers, you might want to have a look at the recent English translation and discussion of Sigfrid Karg-Elert's book Acoustic Determination of Pitch, Chord and Function from 1930.
     
    Byrne, D. A. (2018) The Harmonic Theories of Sigfrid Karg-Elert: Acoustics, Function, Transformation, Perception. PhD Thesis thesis. University of Cincinnati. Online available (with a somewhat slow download speed) at https://etd.ohiolink.edu/apexprod/rws_olink/r/1501/10?p10_etd_subid=162928&clear=10   Warning: this is not for the faint of heart 🙂   Best, Torsten
  5. Like
    torstenanders got a reaction from AM in lsystem - extension idea   
    > the GAP is between visual L-systems and acoustic ones
     
    Yes, of course, there is a completely different way of perception at play. If you come up with a good answer to that, I would be interested.
     
    BTW, if you want some other examples of compositional applications, you might want to have a look at ”Cells” (1993/94) by Hanspeter Kyburz, discussed in the following two publications.
     
     
    Supper, M. (2001) A Few Remarks on Algorithmic Composition. Computer Music Journal. 25 (1), 48–53.  
    Holz, E. (2012) Das Wachstumprinzip von L-Systemen in der Musik von Hanspeter Kyburz. Master’s thesis. Hochschule für Musik Hanns Eisler.  Available from: http://www.eresholz.de/de/text/Eres Holz_Ausschnitt aus der Masterarbeit.pdf(Accessed 20 September 2016).  
  6. Like
    torstenanders got a reaction from lviklund in Negative Harmony Function   
    Just a brief follow-up. While Partch's book is obviously available in English, the other authors all wrote in German. More recent Neo-Riemannian theory is often pretty math-heavy, so also somewhat hard to digest for us composers. To get a taste of these harmonic theories in a highly developed form (with dualism throughout, but that is only one facet) delivered by a practicing composers, you might want to have a look at the recent English translation and discussion of Sigfrid Karg-Elert's book Acoustic Determination of Pitch, Chord and Function from 1930.
     
    Byrne, D. A. (2018) The Harmonic Theories of Sigfrid Karg-Elert: Acoustics, Function, Transformation, Perception. PhD Thesis thesis. University of Cincinnati. Online available (with a somewhat slow download speed) at https://etd.ohiolink.edu/apexprod/rws_olink/r/1501/10?p10_etd_subid=162928&clear=10   Warning: this is not for the faint of heart 🙂   Best, Torsten
  7. Thanks
    torstenanders got a reaction from JulioHerrlein in Negative Harmony Function   
    Are you simply looking for an invert function, e.g., pitch-invert? 
     
    (pitch-invert '(c4 d4 e4)) => (c4 bb3 gs3)  
    This function inverts (mirrors) around the first pitch by default. If you are looking for retaining the original ambitus, you might want to instead you my function invert-in-ambitus (https://tanders.github.io/tot/sources/pitch.html#_g251910).
     
    (invert-in-ambitus '(c4 e4 g4))  => (g4 eb4 c4)
    BTW, when you are specifically talking about a harmonic context in which you are "mirroring" chords, there exist extensive music theories based on this idea already. The notion of minor chords as the mirror image of major chords, and its implications on harmonic functions (tonic, dominant, subdominant etc.) was in detail explored under the label of dualism by theorists like Hugo Riemann, Arthur von Öttingen and Sigfrid Karg-Elert. They also already generalised this notion for microtonal music. Likely independently of these theorists exploring the notion of dualism, Harry Partch's concept of otonality and utonality is also based on this idea, now firmly in the field of microtonal music. In microtonal harmonic theory I came across this notion also elsewhere (e.g., discussed by the composers and theorists of ekmelic music like Franz Richter Herf, which may have arrived there independently as well.
     
    Anyway, this harmonic concept in general is so basic and fundamental that I would not be surprised it would have been studied by the likes of Pythagoras already...
     
    Best,
    Torsten
  8. Like
    torstenanders got a reaction from AM in Triggering event - anonymous functions (like in Javascript)   
    > but SLEEP is not very precise
     
    The Common Lisp standard actually says that the number of seconds specified as arguments for sleep is approximate:
     
    > Causes execution to cease and become dormant for approximately the seconds of real time indicated by seconds, whereupon execution is resumed. 
     
    CLHS: Function SLEEP
    WWW.LISPWORKS.COM  
    Anyway, it seems that at least on a Mac the imprecision is rather regular, see the following discussion with empirical tests.
    Time to sleep under different platforms
    LISP-HUG.LISPWORKS.NARKIVE.COM  
    Anyway, for realtime scheduling in a musical context one needs likely a proper scheduler for that. 
     
    Best,
    Torsten
  9. Like
    torstenanders reacted to JulioHerrlein in Composing with Piano Reductions   
    Dear All,
     
    I'm trying to find a suitable workflow to make my choices easier.
    One idea was to compose over a piano reduction, for easier manipulation.
    Here's a way of doing that, with comments.
    The MIDI FILE output is like this. I did NO EDITIONS at all in Musescore.This is the video of the MIDI output.
    The XML output is the piano reduction.
    Very convenient !
     
    Best,
    Julio
     

    str_4tet_opusmodus.mov ;;;SEV CHORDS Basic Functions ;;;Harmonic Functions/Sets List (setf Srm7 (pcs-transpose 9 (pcs '4-26) :pitch)) (setf S7M (pcs-transpose 4 (pcs '4-20) :pitch)) (setf Trm7 (pcs-transpose 4 (pcs '4-26) :pitch)) (setf T7M (pcs-transpose -1 (pcs '4-20) :pitch)) (setf Tam7 (pcs-transpose 11 (pcs '4-26) :pitch)) (setf D7 (pcs-transpose 11 (pcs '4-27b) :pitch)) (setf hd (pcs-transpose 9 (pcs '4-27) :pitch)) ;;;Estabilishing a Basic Progressions (setf chordprog (chordize (list Srm7 S7M Trm7 T7M Tam7 S7M))) ;;;Repeating and transposing the progression (setf chordtrp-rpt (pitch-transpose-repeat '((0 3 5 4) (0 2 -2 -1) (0 5 1 -2) (7 12 10 -3)) chordprog)) ;;; Making suitable voicings to the progression (setf chordprogdrop (chordize-list (pitch-transpose-n '(0 -12 0 0) (pitch-melodize chordtrp-rpt)))) ;;;Using these dropped chords as the source (setf chordprgtrp chordprogdrop) ;;;Opcionally with more Voice-Leading, with a smooth transition between the chords ;(setf chordprgtrp (chord-closest-path (car chordprogdrop) (gen-divide 4 chordprogdrop))) ;;;Counting the number of chords to make rhythm repetitions ;(setf times (get-count (get-count chordprgtrp))) ;;;Optionally setting manually the repetitions (setf times 24) ;;;Eachnote assigned to a voice (setf voz1 (flatten (pitch-demix 1 chordprgtrp))) (setf voz2 (flatten (pitch-demix 2 chordprgtrp))) (setf voz3 (flatten (pitch-demix 3 chordprgtrp))) (setf voz4 (flatten (pitch-demix 4 chordprgtrp))) ;;;optionally processing the ambitus of the voices ;(setf vozamb1 (ambitus '(c4 c5) voz1) vozamb2 (ambitus '(f3 c5) voz2) vozamb3 (ambitus '(g3 g4) voz3) vozamb4 (ambitus '(c2 e3) voz4)) ;;; Or setting to instrument's ranges ;(setf vozamb1 (ambitus (ambitus-instrument 'flute) voz1)vozamb2 (ambitus (ambitus-instrument 'oboe) voz2) vozamb3 (ambitus (ambitus-instrument 'clarinet) voz3) vozamb4 (ambitus (ambitus-instrument 'bassoon) voz4)) ;;;or just using the resulting drops as given (setf vozamb1 voz1 vozamb2 voz2 vozamb3 voz3 vozamb4 voz4) ;;;RIT ;;;one rhythm to all (for checking the "chorale" writing) ;(setf r1 (gen-repeat times '(q)) r2 (gen-repeat times '(q)) r3 (gen-repeat times '(q)) r4 (gen-repeat times '(q))) ;;;Doing an homorhythmic section (all instruments play the same rhythms (setf homorhy (gen-repeat times '(q -q e q e h h -s s s s)) r1 homorhy r2 homorhy r3 homorhy r4 homorhy) ;;; Articulation for the homorhytm (setf arthomo '(ten stacc ord stacc ord ord leg leg ord)) ;;;OMN ASSEMBLAGE of the Lines (setf vozomn1 (make-omn :length r1 :pitch vozamb1 :articulation arthomo :velocity (rnd-order'(p)))) (setf vozomn2 (make-omn :length r2 :pitch vozamb2 :articulation arthomo :velocity (rnd-order'(p)))) (setf vozomn3 (make-omn :length r3 :pitch vozamb3 :articulation arthomo :velocity (rnd-order'(pp)))) (setf vozomn4 (make-omn :length r4 :pitch vozamb4 :articulation arthomo :velocity (rnd-order'(pp)))) ;;;--------------------------------------------------------- ;;; SCORE ;;;---------------------------------------------------------- (def-score voices (:title "Piano-Red-4-Voices" :subtitle "Estudos Polifônicos" :composer "Julio-Herrlein" :key-signature 'atonal :time-signature '(4 4) :tempo '("Meditativo" q 60) :layout (piano-solo-layout '(pno-rh1 pno-rh2) '(pno-lh pno-lh2))) (pno-rh1 :omn vozomn1 :channel 1 :sound 'gm :program 'Violin :volume 100) (pno-rh2 :omn vozomn2 :channel 2 :sound 'gm :program 'Violin :volume 70) (pno-lh :omn vozomn3 :channel 3 :sound 'gm :program 'Viola :volume 80) (pno-lh2 :omn vozomn4 :channel 4 :sound 'gm :program 'Cello :volume 80))  
  10. Like
    torstenanders reacted to Stephane Boussuge in import pitches/chords from midi-file?   
    midi-to-omn will be super useful for me, thanks !
     
    Stéphane
     
  11. Like
    torstenanders reacted to opmo in Open Recent ... suggestion   
    To reopen the last used windows you need to go to System Preferences/General panel and uncheck the "Close windows when quitting an app".
     

  12. Like
    torstenanders reacted to opmo in Opusmodus 1.3.24952   
    – Function name changes:
    LENGTH-DIVIDE2 to LENGTH-SUBDIVISION
    LENGTH-DIVIDE3 to LENGTH-SYNCOPATE

    – Function update:
    LENGTH-DIVIDE – changes to arguments.
    LENGTH-SUBDIVISION – changes to arguments.
    LENGTH-SYNCOPATE – changes to arguments.
    POLYGON-RHYTHM – enable fixed sides polygon. 

    – Note:
    If you used any of the functions:
    LENGTH-DIVIDE, LENGTH-DIVIDE2 or LENGTH-DIVIDE3 in your scores,
    please check new documents in order to make the necessary correction.

    – New:
    Enable or disable the DO-VERBOSE macro. 
    (defparameter *do-verbose* nil "Enable or disable traces printed by do-verbose.")  
     
    length-divide
    This function is able to divide number of lengths to a given division value. The :set and :ignore option increases the control for the desired result. When processing the omn-form sequence an optional third value allows you to fill intervalic steps (a root transposition) to new length values derived from the divisions.
     
    (setf rhy '(1/4 1/4 1/4 1/4)) (length-divide '(2 2) rhy) => (1/8 1/8 1/4 1/4 1/8 1/8) (length-divide '(2 4) rhy) => (1/4 1/16 1/16 1/16 1/16 1/16 1/16 1/16 1/16 1/4)  
    Example:
    (length-divide '(1 2) '(1/4 -1/8 1/16 1/16 -1/32 -3/32 1/8 1/1) :seed 34) => (1/4 -1/8 1/16 1/32 1/32 -1/32 -3/32 1/8 1)  
    In the example above only 1 length is divided by 2 - that is the 1/16. In the example below 4 lengths are divided by 2.
    (length-divide '(4 2) '(1/4 -1/8 1/16 1/16 -1/32 -3/32 1/8 1/1) :seed 34) => (1/8 1/8 -1/8 1/16 1/32 1/32 -1/32 -3/32 1/16 1/16 1/2 1/2) (length-divide '(1 2) '(1/4 -1/8 1/16 1/16 -1/32 -3/32 1/8 1/1) :set 'min :seed 34) => (1/4 -1/8 1/32 1/32 1/16 -1/32 -3/32 1/8 1) (length-divide '(1 4) '(1/4 -1/8 1/16 1/16 -1/32 -3/32 1/8 1/1) :set 1/8 :seed 34) => (1/4 -1/8 1/16 1/16 -1/32 -3/32 1/32 1/32 1/32 1/32 1) (length-divide '((2 3) (1 2)) '((1/4 -1/8 1/16 1/16) (1/32 -3/32 1/8 1/1)) :ignore 'max :seed 45) => ((1/4 -1/8 1/48 1/48 1/48 1/48 1/48 1/48) (1/64 1/64 -3/32 1/8 1)) (length-divide '((2 4) (1 2)) '((q -e s s) (s -e. e w)) :set 'max :ignore 1 :seed 65) => ((1/16 1/16 1/16 1/16 -1/8 1/16 1/64 1/64 1/64 1/64) (1/16 -3/16 1/16 1/16 1))
    OMN:
    (setf mat1 '(q c4 d4 e4 f4 g4 a4 b4)) (length-divide '(3 4) mat1 :seed 45) => (s d4 bb3 cs4 b3 cs4 eb4 c4 e4 q s g4 e4 eb4 fs4 q g4 a4 b4)
    Symbol 'r will apply repeat function:
    (length-divide '(3 4 r) mat1 :seed 45) => (s c4 c4 c4 c4 d4 d4 d4 d4 q e4 s f4 f4 f4 f4 q g4 a4 b4)
    Here we use a set of interval values at the end of the division list:
    (length-divide '(3 4 (13 0 1 13)) mat1 :seed 45) => (s cs5 c4 cs4 cs5 eb5 d4 eb4 eb5 q e4 s fs5 f4 fs4 fs5 q g4 a4 b4) (setf mat2 '((e c4 p e4 mp g4 he c5 p) (q c4 f c4 cs4 mp - d5 p d5) (q cs5 mf = - - cs5 p =))) (length-divide '((1 4) (2 4) (2 5)) mat2 :seed 34) => ((e c4 p e4 mp t a4 f4 gs4 fs4 he c5 p) (q c4 f s b3 cs4 bb3 d4 q cs4 mp - d5 p s c5 e5 cs5 eb5) (q cs5 mf cs5 - - 5q eb5 p b4 c5 d5 eb5 c5 eb5 b4 d5 c5))
    In the example below we assign three series of division values to variables s1, s2 and s3:
    (setf s1 '(3 4 (6 12 18 24)) s2 '(3 4 ((13 1 13 0) (13 0 7 1) r)) s3 '(2 5 ((13 0 13 0 13) ?)) ) (length-divide (list s1 s2 s3) mat2 :seed 34) => ((e c4 p t bb4 mp e5 bb5 e6 cs5 g5 cs6 g6 et fs5 p c6 fs6 c7) (q c4 f s cs5 cs4 cs5 c4 q cs4 mp - s eb6 p d5 a5 eb5 d5 d5 d5 d5) (5q d6 mf cs5 d6 cs5 d6 q cs5 - - cs5 p 5q d5 eb5 c5 b4 d5))  
     
    length-subdivision
    This function is able to divide a list of lengths into a number of subdivisions derived from a given length segment value. The :type and :position option increases the control for the desired result. When processing the omn-form sequence an optional third value allows you to fill intervalic steps (a root transposition) to new length values derived from the divisions. This function is a more sophisticated version of LENGTH-DIVIDE. It produces fascinating variants on the simplest of note-lengths, as can be seen below.
     
    (setf rhy '(1/4 1/4 1/4 1/4)) (length-subdivision '(2 1/8) rhy) => (1/8 1/8 1/8 1/8 1/8 1/8 1/8 1/8)
    position 's (start):
    (length-subdivision '(2 1/16) rhy :position 's) => (1/16 1/16 1/8 1/16 1/16 1/8 1/16 1/16 1/8 1/16 1/16 1/8)
    position 'e (end):
    (length-subdivision '(2 1/16) rhy :position 'e) => (1/8 1/16 1/16 1/8 1/16 1/16 1/8 1/16 1/16 1/8 1/16 1/16)
    type 'r (rest), position 'e (end):
    (length-subdivision '(2 1/16) rhy :type 'r :position 'e) => (-1/8 1/16 1/16 -1/8 1/16 1/16 -1/8 1/16 1/16 -1/8 1/16 1/16)
    type 'r (rest), position 's (end):
    (length-subdivision '(2 s) rhy :type 'r :position 's) => (1/16 1/16 -1/8 1/16 1/16 -1/8 1/16 1/16 -1/8 1/16 1/16 -1/8)
    type at random, rest or note :
    (length-subdivision '(2 s) rhy :type '? :position 's) => (1/16 1/16 -1/8 1/16 1/16 -1/8 1/16 1/16 -1/8 1/16 1/16 1/8)
    position and type at random:
    (length-subdivision '(1 e) rhy :type '? :position '? :seed 34) => (1/16 1/8 1/16 1/8 1/8 -1/8 1/8 1/8 1/8) (length-subdivision '((2 5q) (1 3q)) rhy :type '? :position 's :seed 34) => (1/20 1/20 3/20 1/12 -1/6 1/20 1/20 3/20 1/12 -1/6) (length-subdivision '((2 5q) (1 3q) (1 e) (1 s)) rhy :seed 34) => (1/20 1/20 3/20 1/12 1/12 1/12 1/8 1/8 3/16 1/16)  
    Example:
    (setf rhy2 '((1/4 1/4 1/4 1/4) (1/4 1/4 1/4 1/4))) (length-subdivision '(1 e) rhy2 :seed 34) => ((1/8 1/8 1/16 1/8 1/16 1/8 1/8 1/8 1/8) (1/16 1/8 1/16 1/8 1/8 1/8 1/8 1/8 1/8)) (length-subdivision '((1 e) (1 3q)) rhy2 :seed 34) => ((1/8 1/8 1/12 1/12 1/12 1/8 1/8 1/6 1/12) (1/16 1/8 1/16 1/6 1/12 1/8 1/8 1/6 1/12)) (length-subdivision '(((1 e)) ((1 3q))) rhy2 :seed 34) => ((1/8 1/8 1/16 1/8 1/16 1/8 1/8 1/8 1/8) (1/12 1/12 1/12 1/6 1/12 1/12 1/6 1/6 1/12)) (length-subdivision '((3 3q) (1 e)) '((q -e e h) (s e. q h)) :seed 65) => ((1/12 1/12 1/12 -1/8 1/8 1/12 1/12 1/12 1/4) (1/16 3/16 1/8 1/8 1/8 1/12 1/12 1/12 1/8)) (length-subdivision '(((3 3q)) ((1 e))) '((q -e e h) (s e. q h)) :seed 65) => ((1/12 1/12 1/12 -1/8 1/8 1/12 1/12 1/12 1/4) (1/16 1/16 1/8 1/16 1/8 1/16 1/8 3/8)) (length-subdivision '(((2 3q)) ((1 e))) '((q -e e h) (s e. q h)) :type '? :seed 65) => ((1/12 1/12 1/12 -1/8 1/8 1/12 1/12 -1/3) (1/16 -1/16 1/8 1/8 1/8 1/8 3/8))
    OMN:
    (setf mat1 '(q c4 d4 e4 f4 g4 a4 b4)) (length-subdivision '(1 e) mat1 :seed 45) => (s cs4 e b3 s d4 e cs4 e4 s f4 e fs4 s d4 e fs4 eb4 f4 a4 bb4 gs4 bb4 a4)
    The symbol 'r (third value) will apply repeat function:
    (length-subdivision '(1 e r) mat1 :seed 45) => (s c4 e s e d4 d4 s e4 e s e f4 f4 g4 g4 a4 a4 b4 b4)
    Here we define the intervals (third value):
    (length-subdivision '(1 e (13 0 13 0)) mat1 :seed 45) => (s cs5 e c4 s cs5 e eb5 d4 s f5 e e4 s f5 e fs5 f4 gs5 g4 bb5 a4 c6 b4) (length-subdivision '(4 s (13 0 13 0)) mat1 :seed 45) => (s cs5 c4 cs5 c4 eb5 d4 eb5 d4 f5 e4 f5 e4 fs5 f4 fs5 f4 gs5 g4 gs5 g4 bb5 a4 bb5 a4 c6 b4 c6 b4) (length-subdivision '(2 3q (13 0 13 0)) mat1 :type '(r n) :seed 45 :position '(e s s s e s s)) => (-3q cs5 c4 eb5 d4 eb5 f5 e4 - fs5 f4 fs5 - gs5 g4 bb5 a4 bb5 c6 b4 -) (setf mat2 '((e c4 p e4 mp g4 he c5 p) (q c4 f c4 cs4 mp - d5 p d5) (q cs5 mf = - - cs5 p =))) (length-subdivision '((1 e (13 0 13 0)) (2 e (13 0 13 0)) (2 3q (13 0 13 0))) mat2 :type '? :seed 34) => ((e c4 p e4 mp g4 q cs6 p e c5 q cs6) (e cs5 f c4 cs5 c4 -3q d5 mp cs4 -q e eb6 p d5 eb6 d5) (-s e cs5 mf -s e d6 cs5 -q - 3e d6 p 3q cs5 d6 3e cs5 e d6 cs5)) (length-subdivision '(((1 e (13 0 13 0))) ((2 s (13 0 13 0))) ((2 3q r))) mat2 :type '? :seed 34) => ((e c4 p e4 mp g4 q cs6 p e c5 q cs6) (e cs5 f s c4 cs5 -e s cs5 c4 e d5 mp s cs4 d5 -q -s eb6 p d5 - eb6 d5 eb6 d5) (3q cs5 mf cs5 cs5 cs5 cs5 cs5 -q - 3q cs5 p cs5 - - cs5 cs5))  
    In the example below we assign three series of values to variables s1, s2 and s3:
    (setf s1 '(2 e (6 12 18 24)) s2 '(1 3q ((13 1 13 0) (13 0 7 1) r)) s3 '(3 5q ((13 0 13 0 13) ?)) ) (length-subdivision (list s1 s2 s3) mat2 :seed 23) => ((e c4 p 3e bb4 mp 3q e5 e cs6 cs5 p cs6 q.) (e fs4 f c5 3q cs5 cs4 cs5 5h mp 5q c4 g4 c4 -q e c4 p c4 3q d5 3h cs4) (e g5 mf cs6 3q d6 3h d5 -q - 5q d6 p cs5 cs5 5h e d6 cs5))  
     
     
    length-syncopate
    The function LENGTH-SYNCOPATE is a valuable way of bringing more rhythmic interest into a length list. The usual idea of syncopating rhythm is to 'choke' certain attacks so that the attack is delayed or pre-empted.
    (setf rhy '(1/4 1/4 1/4 1/4)) (length-syncopate '(1 4) rhy) => (1/4 3/16 1/16 1/4 1/4) (length-syncopate '(2 4) rhy) => (1/16 3/16 1/4 3/16 1/16 1/4)  
    Example:
    (length-syncopate '(1 4) '(1/4 -1/8 1/16 1/16 -1/8 1/8 1/1) :seed 34) => (1/4 -1/8 1/16 1/64 3/64 -1/8 1/8 1)
    In the example above only 1 length is divided by 4 (1, 3) - that is the 1/16. In the example below 2 values are divided by 3: (1, 2) and (2, 1).
    (length-syncopate '(2 3) '(1/4 -1/8 1/16 1/16 -1/8 1/8 1/1) :seed 34) => (1/4 -1/8 1/48 1/24 1/16 -1/8 1/8 2/3 1/3) (length-syncopate '(1 4) '(1/4 -1/8 1/16 1/16 -1/8 1/8 1/1) :set 1/8 :seed 34) => (1/4 -1/8 1/16 1/16 -1/8 1/32 3/32 1)
    Example with :set for each list:
    (length-syncopate '((2 3) (1 4)) '((1/4 -1/8 1/16 1/16) (1/32 -3/32 1/8 1/1)) :set '(min 1/8) :seed 45) => ((1/4 -1/8 1/24 1/48 1/24 1/48) (1/32 -3/32 3/32 1/32 1)) (length-syncopate '((2 3) (1 5)) '((q -e s s) (s -e. q h)) :set 'max :ignore 'h :seed 65 :omn t) => ((3h 3q -e s 3s 3e) (s -e. 5q 5w h))
    OMN:
    (setf mat '(q c4 d4 e4 f4 g4 a4 b4)) (length-syncopate '(3 4) mat :seed 12) => (s b3 e. cs4 q d4 e. fs4 s d4 q f4 g4 a4 e. bb4 s c5)  
    Here we use a set of interval values:
    (length-syncopate '(3 4 ((13 0) (0 14) (1 13))) mat :seed 23) => (s cs5 e. c4 d4 s e5 q e4 f4 s gs4 e. gs5 q a4 b4) (setf mat2 '((e c4 p e4 mp g4 he c5 p) (q c4 f c4 cs4 mp - d5 p d5) (q cs5 mf = - q cs5 stacc p = =)) (length-syncopate '((1 3 (-3 6)) (2 4 (6 0)) (2 5 (11 13))) mat2 :seed 34) => ((e c4 p e4 mp 3e 3q cs5 he c5 p) (q c4 f s fs4 e. c4 q cs4 mp - e. gs5 p s d5 q) (q cs5 mf cs5 - 5w c6 stacc 5q d6 stacc q cs5 p 5q c6 5w d6 q cs5))
     
     
    polygon-rhythm
    In the next three examples below we use a list of fixed polygon sides (non-symmetrical):
    (circle-rhythm-plot (polygon-rhythm '(1 6 10) 16 1) :points 16) To rotate the polygon we change the starting point value:
    (circle-rhythm-plot (polygon-rhythm '(1 6 10) 16 2) :points 16) (circle-rhythm-plot (polygon-rhythm '(0 2 5 7 10 12 13 15 16 18 19 21 23) 24 0) :points 24 :value 1/24)  
    Best wishes,
    JP
  13. Thanks
    torstenanders got a reaction from opmo in Providing code examples to students   
    >> While I can create a canon, counterpoint and a fugue myself with a bit of time, it would be much less time-consuming for me if I were able to use existing examples. Is there an existing library of OMN examples of these types of compositions?
    > I cannot offer ready-made examples, but a constraint-based library with various counterpoint (and also harmony) rules ready-made.  
     
    Following up my own comments, some entry level introduction to the libraries Cluster Engine and Cluster rules is offered by a video I prepared for my students last autumn.
     
    https://www.youtube.com/watch?v=xPXIRmH9rZc&list=PLmbpscTxjn_DrdDXD5v7z0GzQRNKM5VyQ&index=9
     
    This video uses PWGL instead of Openmusic, but you only need to mentally replace PWGL boxes with Lisp functions of the same name to get pretty much the equivalent Opusmusic code. Also, this tutorial only scratches the surface of what can be done with these libraries, but I hope it can give an initial idea how things are approached in these libraries and for going beyond that a relatively easy approach is simply to study the pre-programmed rules in the Cluster Rules library and trying to combine rules for your own purposes. Once you miss a specific rule you would like to have, the library Cluster Engine provides the tools for defining your own rules on a high level of abstraction (specifically, it provides many abstractions that help to easily apply your rule to a specific score context, like the pitches of simultaneous notes of certain parts). 
     
    This video is the last of a series of introduction-level videos on algorithmic composition with PWGL... 
     
    https://www.youtube.com/playlist?list=PLmbpscTxjn_DrdDXD5v7z0GzQRNKM5VyQ
     
  14. Like
    torstenanders reacted to opmo in Lisp function for stopping playback?   
    Here it is:
    (sequencer:sequencer-stop *audition-sequencer*) JP
  15. Like
    torstenanders got a reaction from AM in Opposite of gen-swallow for functions that add notes like length-divide?   
    Do you mean as an option for the function length-divide? That would be great, but my preferred solution would be to have some extra function complementing gen-swallow for added notes -- which then could be called within functions like length-divide -- because that would be a generic solution for all sorts of functions that somehow add notes. The slightly tricky bit would perhaps be for the function to notice which are the new notes, so it should likely get as an input both the original material and the material with the added notes to find out... 
    I would be happy to help sketching such a function...
    One approach might also be if functions adding notes would somehow mark such notes with some custom articulation only used for that purpose, but that would only work for full OMN results, not single parameters (e.g., length-divide supports single length values). An alternative idea would be for functions adding notes to simply specify the positions in the resulting list that they added (with some special notation for nested lists). 
    Anyway, if it would be much more simply to refactor only length-divide and friends, that would be welcome too...
  16. Like
    torstenanders got a reaction from JulioHerrlein in Opposite of gen-swallow for functions that add notes like length-divide?   
    The function LENGTH-DIVIDE and friends are a useful device for introducing some rhythmic variation to some material. However, when the processed sequence is a full OMN expression (see example below), then the added notes cause all other parameters to shift forward (additional parameters are added at the end by looping). For introducing only a slight variation to some existing material (e.g., motif) these functions are therefore not so useful, because this shift of all parameters to basically "fill" the new added notes with pitches etc. greatly change the varied material for a listener.
    (length-divide 1 2 '(q f3 leg+m1 q ab3 leg e c4 leg bb3 leg ab3 leg g3))  
    Basically, this is the opposite situation of the situation addressed by swallowing. Swallowing (e.g., with GEN-SWALLOW and the swallow argument of many other functions) avoids the shift of parameters like pitch etc. that would result from removing notes and turning them into rests. For addressing the situation above properly we would need something like the opposite of swallowing, some way to fill in parameters like pitch etc. for new notes to avoid shifting existing notes. I hope my explanation makes sense and you can see why something like the opposite of swallowing would be useful for functions that add notes to some input material.
     
    Now, the tricky question is of course, what parameters (pitch etc.) should be added in such cases. Musically useful and common in the classical literature would be, e.g., repeating the parameters (pitch etc.) of the predecessor note (though that might be a bit too simplistic and annoying at times) or somehow interpolating some pitch gap between the previous and next note with a little scale or arpeggio and only repeating the other parameters like articulations (resulting in some variation that is likely most similar to the input material, so it would be good to have that as an option).  If the pitch interval between the two original notes is too small to add some pitch in between for the new now (or as an option in general for variety), it would also be good  to add some ornamentation (e.g., using PITCH-ORNAMENT), but for a close similarity between the original material and the variation it would be best as an option to apply such ornamentation only to the newly added notes, not all notes. Of course, other options could also be useful for variations that vary the input material a bit more strongly, e.g., some random pitch for the new notes within certain interval bounds.
     
    Does some function that kind of is the opposite of GEN-SWALLOW in that it adds parameters like pitches for subdivided rhythmic values (to avoid the shifting) sound like a good idea?
     
    The idea with the interpolation of gaps could be implemented by turning the original duration values and pitches into some envelope and then reading that envelope with the new rhythmic values. So, that is rather strait forward. However, that would not allow for some ornamentation, because such algorithm would not recognise which notes are new that should be ornamented.
     
    Any other idea perhaps? Thanks! 
  17. Like
    torstenanders reacted to opmo in Music xml import, convert to Score?   
    At the moment you can't convert musicxml file into omn score.
    But it is in our TODO list.
  18. Like
    torstenanders got a reaction from AM in Opposite of gen-swallow for functions that add notes like length-divide?   
    The function LENGTH-DIVIDE and friends are a useful device for introducing some rhythmic variation to some material. However, when the processed sequence is a full OMN expression (see example below), then the added notes cause all other parameters to shift forward (additional parameters are added at the end by looping). For introducing only a slight variation to some existing material (e.g., motif) these functions are therefore not so useful, because this shift of all parameters to basically "fill" the new added notes with pitches etc. greatly change the varied material for a listener.
    (length-divide 1 2 '(q f3 leg+m1 q ab3 leg e c4 leg bb3 leg ab3 leg g3))  
    Basically, this is the opposite situation of the situation addressed by swallowing. Swallowing (e.g., with GEN-SWALLOW and the swallow argument of many other functions) avoids the shift of parameters like pitch etc. that would result from removing notes and turning them into rests. For addressing the situation above properly we would need something like the opposite of swallowing, some way to fill in parameters like pitch etc. for new notes to avoid shifting existing notes. I hope my explanation makes sense and you can see why something like the opposite of swallowing would be useful for functions that add notes to some input material.
     
    Now, the tricky question is of course, what parameters (pitch etc.) should be added in such cases. Musically useful and common in the classical literature would be, e.g., repeating the parameters (pitch etc.) of the predecessor note (though that might be a bit too simplistic and annoying at times) or somehow interpolating some pitch gap between the previous and next note with a little scale or arpeggio and only repeating the other parameters like articulations (resulting in some variation that is likely most similar to the input material, so it would be good to have that as an option).  If the pitch interval between the two original notes is too small to add some pitch in between for the new now (or as an option in general for variety), it would also be good  to add some ornamentation (e.g., using PITCH-ORNAMENT), but for a close similarity between the original material and the variation it would be best as an option to apply such ornamentation only to the newly added notes, not all notes. Of course, other options could also be useful for variations that vary the input material a bit more strongly, e.g., some random pitch for the new notes within certain interval bounds.
     
    Does some function that kind of is the opposite of GEN-SWALLOW in that it adds parameters like pitches for subdivided rhythmic values (to avoid the shifting) sound like a good idea?
     
    The idea with the interpolation of gaps could be implemented by turning the original duration values and pitches into some envelope and then reading that envelope with the new rhythmic values. So, that is rather strait forward. However, that would not allow for some ornamentation, because such algorithm would not recognise which notes are new that should be ornamented.
     
    Any other idea perhaps? Thanks! 
  19. Like
    torstenanders got a reaction from Stephane Boussuge in Opposite of gen-swallow for functions that add notes like length-divide?   
    The function LENGTH-DIVIDE and friends are a useful device for introducing some rhythmic variation to some material. However, when the processed sequence is a full OMN expression (see example below), then the added notes cause all other parameters to shift forward (additional parameters are added at the end by looping). For introducing only a slight variation to some existing material (e.g., motif) these functions are therefore not so useful, because this shift of all parameters to basically "fill" the new added notes with pitches etc. greatly change the varied material for a listener.
    (length-divide 1 2 '(q f3 leg+m1 q ab3 leg e c4 leg bb3 leg ab3 leg g3))  
    Basically, this is the opposite situation of the situation addressed by swallowing. Swallowing (e.g., with GEN-SWALLOW and the swallow argument of many other functions) avoids the shift of parameters like pitch etc. that would result from removing notes and turning them into rests. For addressing the situation above properly we would need something like the opposite of swallowing, some way to fill in parameters like pitch etc. for new notes to avoid shifting existing notes. I hope my explanation makes sense and you can see why something like the opposite of swallowing would be useful for functions that add notes to some input material.
     
    Now, the tricky question is of course, what parameters (pitch etc.) should be added in such cases. Musically useful and common in the classical literature would be, e.g., repeating the parameters (pitch etc.) of the predecessor note (though that might be a bit too simplistic and annoying at times) or somehow interpolating some pitch gap between the previous and next note with a little scale or arpeggio and only repeating the other parameters like articulations (resulting in some variation that is likely most similar to the input material, so it would be good to have that as an option).  If the pitch interval between the two original notes is too small to add some pitch in between for the new now (or as an option in general for variety), it would also be good  to add some ornamentation (e.g., using PITCH-ORNAMENT), but for a close similarity between the original material and the variation it would be best as an option to apply such ornamentation only to the newly added notes, not all notes. Of course, other options could also be useful for variations that vary the input material a bit more strongly, e.g., some random pitch for the new notes within certain interval bounds.
     
    Does some function that kind of is the opposite of GEN-SWALLOW in that it adds parameters like pitches for subdivided rhythmic values (to avoid the shifting) sound like a good idea?
     
    The idea with the interpolation of gaps could be implemented by turning the original duration values and pitches into some envelope and then reading that envelope with the new rhythmic values. So, that is rather strait forward. However, that would not allow for some ornamentation, because such algorithm would not recognise which notes are new that should be ornamented.
     
    Any other idea perhaps? Thanks! 
  20. Thanks
    torstenanders reacted to opmo in Opusmodus 1.3.24912   
    – Additions:
    ADD-TEXT-ATTRIBUTS – Optional attribute type: :sticky and :non-sticky

    – Fixed:
    Typo error in 'GM Instrument Set.lisp' file.
     
    Best wishes,
    Janusz
  21. Thanks
    torstenanders got a reaction from Stephane Boussuge in Getting precompiled code (e.g., quicklisp, quicklisp libraries, swank, own libraries) running again on recent Opusmodus versions   
    Dear all,
     
    After updating to a recent Opusmodus version 1.3, I ran into some errors when loading code that had been loaded and compiled before, e.g., quicklisp, quicklisp libraries, swank (the interface that allows using Emacs Slime with Opusmodus), and my own Lisp libraries. The errors I saw were rather cryptic, like the following:
     
    Error: The value "CL" is not of the expected type list.
    While executing: (:internal ccl::operation-on-all-specs ccl::%define-package), in process Listener-1(7).
     
    After exchanges with Janusz (thanks a lot for your help!) I learnt that the underlying Common Lisp version of Opusmodus had been upgraded to CCL version 1.12, and the format of compiled files (fasl files or dx64fsl files) of this version had changed.
     
    So, in case you run into similar problems, these can be fixed simply by deleting all previously compiled files (which Lisp stores if they do not change to speed up the load process), so that the Lisp compiler has to compile them again. In the folder  ~/.cache/common-lisp just delete any folders starting with ccl-, so that all compiled files in this directory are compiled again.
     
    Best,
    Torsten
  22. Like
    torstenanders reacted to AM in conTimbre library + pitchbend   
    dear all
     
    conTimbre-library works (in the next update) perfect with TUNING  (midi-pitchbend) and PAN now. thanx to thomas hummel and janusz!
    here are some simple sound examples...
     
    ct-micro+pan2.aiff
    ct-micro+pan3.aiff
    ct-micro+pan.aiff
    ct-micro+pan4.aiff
  23. Like
    torstenanders got a reaction from ydepps in Getting precompiled code (e.g., quicklisp, quicklisp libraries, swank, own libraries) running again on recent Opusmodus versions   
    Dear all,
     
    After updating to a recent Opusmodus version 1.3, I ran into some errors when loading code that had been loaded and compiled before, e.g., quicklisp, quicklisp libraries, swank (the interface that allows using Emacs Slime with Opusmodus), and my own Lisp libraries. The errors I saw were rather cryptic, like the following:
     
    Error: The value "CL" is not of the expected type list.
    While executing: (:internal ccl::operation-on-all-specs ccl::%define-package), in process Listener-1(7).
     
    After exchanges with Janusz (thanks a lot for your help!) I learnt that the underlying Common Lisp version of Opusmodus had been upgraded to CCL version 1.12, and the format of compiled files (fasl files or dx64fsl files) of this version had changed.
     
    So, in case you run into similar problems, these can be fixed simply by deleting all previously compiled files (which Lisp stores if they do not change to speed up the load process), so that the Lisp compiler has to compile them again. In the folder  ~/.cache/common-lisp just delete any folders starting with ccl-, so that all compiled files in this directory are compiled again.
     
    Best,
    Torsten
  24. Thanks
    torstenanders got a reaction from lviklund in Getting precompiled code (e.g., quicklisp, quicklisp libraries, swank, own libraries) running again on recent Opusmodus versions   
    Dear all,
     
    After updating to a recent Opusmodus version 1.3, I ran into some errors when loading code that had been loaded and compiled before, e.g., quicklisp, quicklisp libraries, swank (the interface that allows using Emacs Slime with Opusmodus), and my own Lisp libraries. The errors I saw were rather cryptic, like the following:
     
    Error: The value "CL" is not of the expected type list.
    While executing: (:internal ccl::operation-on-all-specs ccl::%define-package), in process Listener-1(7).
     
    After exchanges with Janusz (thanks a lot for your help!) I learnt that the underlying Common Lisp version of Opusmodus had been upgraded to CCL version 1.12, and the format of compiled files (fasl files or dx64fsl files) of this version had changed.
     
    So, in case you run into similar problems, these can be fixed simply by deleting all previously compiled files (which Lisp stores if they do not change to speed up the load process), so that the Lisp compiler has to compile them again. In the folder  ~/.cache/common-lisp just delete any folders starting with ccl-, so that all compiled files in this directory are compiled again.
     
    Best,
    Torsten
  25. Thanks
    torstenanders got a reaction from loopyc in Getting precompiled code (e.g., quicklisp, quicklisp libraries, swank, own libraries) running again on recent Opusmodus versions   
    Dear all,
     
    After updating to a recent Opusmodus version 1.3, I ran into some errors when loading code that had been loaded and compiled before, e.g., quicklisp, quicklisp libraries, swank (the interface that allows using Emacs Slime with Opusmodus), and my own Lisp libraries. The errors I saw were rather cryptic, like the following:
     
    Error: The value "CL" is not of the expected type list.
    While executing: (:internal ccl::operation-on-all-specs ccl::%define-package), in process Listener-1(7).
     
    After exchanges with Janusz (thanks a lot for your help!) I learnt that the underlying Common Lisp version of Opusmodus had been upgraded to CCL version 1.12, and the format of compiled files (fasl files or dx64fsl files) of this version had changed.
     
    So, in case you run into similar problems, these can be fixed simply by deleting all previously compiled files (which Lisp stores if they do not change to speed up the load process), so that the Lisp compiler has to compile them again. In the folder  ~/.cache/common-lisp just delete any folders starting with ccl-, so that all compiled files in this directory are compiled again.
     
    Best,
    Torsten
×
×
  • Create New...

Important Information

Terms of Use Privacy Policy