Jump to content

torstenanders

Members
  • Posts

    496
  • Joined

  • Last visited

Reputation Activity

  1. Like
    torstenanders got a reaction from lviklund in alternate-omns   
    Below is a function that might be interesting for others as well. When I starting writing this function it was much more complicated, but it got more simple by and by 🙂 A formatted version as an RTF file of the documentation is attached, below is a plain text version.
     
    For completeness I also attached the documentation of the function circle-repeat, used by the function below. Unfortunately, the file names are destroyed by the software of this forum, sorry.
     
    Best,
    Torsten
     
    alternate-omns ids omns
     
    Arguments and Values
     
    ids       a list of integers, indicating the position of OMN expressions in omns.
    omns     a list of OMN expressions (can also be plain lengths, or pitches etc.) between which to switch.
     
    Description
    This function alternates between sublists of multiple OMN expressions.
    This function can be useful, e.g., to switch between different musical characteristics. Each characteristic (e.g., gesture) and its development can be specified by a combination of parameters (rhythm, pitches, dynamics, and playing techniques) in a sequence of OMN expressions. The output of the function switches between these characteristics as specified in the first argument to the function. The following example demonstrates this.
     
    (alternate-omns  (gen-eval 10 '(rnd-pick '(0 1)))  (list   (make-omn    :length (length-rest-series (rnd-sample 7 '(7 8 9))             (length-divide 3 2                            (rnd-sample 7 '((q q q) (h e e) (h.) (h q)))))    :pitch '(d4 e4 f4 g4)    :velocity '(pp))   (make-omn    :length '(s s s s)    :pitch (gen-rotate :right '(c5 d5 f5 a5 g5 e5) :type :seq)    :velocity '(ff)    :span :pitch)))
    Alternatively, one can switch between plain sequences of OMN lengths, or pitches etc.
    (alternate-omns   '(0 0 1 0 1 0 1 1 0 0 1 1 1)   (list     (gen-rotate :left '(-1/20 1/20 1/20 1/20 1/20) :type :seq)    '((q e e))))  
    Examples
    Remember that resulting OMN expressions can be “re-barred”.
    (omn-to-time-signature  (alternate-omns   '(0 0 1 0 1 0 1 1 0 0 1 1 1)   (list    (make-omn     :length (gen-rotate :left '(-1/20 1/20 1/20 1/20 1/20) :type :seq)     :pitch '(d4 e4 f4 g4)     :velocity '(ff))    (make-omn     :length '(q e e)     :pitch (gen-rotate :left '(c5 e5 f5) :type :seq)     :velocity '(pp pp)     :attribute '(ten stacc stacc)     :span :pitch)))  '(4 4))  
    Implementation
    (defun alternate-omns (ids omns) "This function alternates between sublists of multiple omn expressions. It can be useful, e.g., to switch between different musical characteristics. Args: ids: a list of integers, indicating the position of OMN expressions in omns. omns: a list of OMN expressions (can also be plain lengths, or pitches etc.) between which to switch." (let ((omn-no (length omns))) (assert (every #'(lambda (x) (and (integerp x) (< x omn-no))) ids) (ids) "alternate-omns: must be a list of integers between 0 and (1- (length omns)): ~A" ids) (let ((hash (make-hash-table))) (loop for i from 0 to (1- omn-no) for my-omn in omns ;; span (circular repeat if necessary) omn sublists to number of occurences in specs ;; and fill hash table with that as side effect do (setf (gethash i hash) (circle-repeat my-omn (count i ids)))) (alternate-omns-aux ids hash)))) (defun alternate-omns-aux (ids hash) (loop for id in ids collect (pop (gethash id hash)))) (defun circle-repeat (pattern n) "Circle through elements in pattern (a list) until n elements are collected. NOTE: only supports flat list so far." (let ((l (length pattern))) (loop for i from 0 to (- n 1) collect (nth (mod i l) pattern))))  
    TXT.rtf
    TXT.rtf
  2. Like
    torstenanders got a reaction from lviklund in replace/map & datastructure   
    Dear André,
     
    Below is an alternative approach to do the same. The actual user-level code is more concise here, so this might be preferable if you have lots of such variations that should be easy to comprehend later.
     
    Best,
    Torsten
     
    ;;; ;;; Definition of map-omn ;;; (defun mat-trans (in-list) "Quasi a matrix transformations: transforms a list of form ((a1 a2 a3) (b1 b2 b3) (c1 c2 c3) ...) into ((a1 b1 c1 ...) (a2 b2 c2 ...) (a3 b3 c3 ...))." (apply #'mapcar #'(lambda (&rest all) all) in-list)) (defun map-omn (fn omn-expr) "Variant of mapcar for omn expressions, intended for creating variations of these. Applies function fn to every note in omn-expr (a flat OMN list). fn must exect four arguments (a length, pitch, velocity and articution) and returns a list of four values (a length, pitch, velocity and articution)." (destructuring-bind (lengths pitches velocities articulations) (mat-trans (funcall #'mapcar fn (omn :length omn-expr) (omn :pitch omn-expr) (omn :velocity omn-expr) (omn :articulation omn-expr))) (make-omn :length lengths :pitch pitches :velocity velocities :articulation articulations)))  
    The user-level code starts here.
    ;;; ;;; Actual program ;;; (setf my-data '(e. c4 pppp tasto d4 ponte e4)) (map-omn #'(lambda (l p v a) (list l p ;; replace tasto dynamics by fff (if (equal a 'tasto) 'fff v) a)) my-data) ; => (e. c4 fff tasto d4 pppp ponte e4)  
  3. Like
    torstenanders got a reaction from AM in replace/map & datastructure   
    Dear André,
     
    Below is an alternative approach to do the same. The actual user-level code is more concise here, so this might be preferable if you have lots of such variations that should be easy to comprehend later.
     
    Best,
    Torsten
     
    ;;; ;;; Definition of map-omn ;;; (defun mat-trans (in-list) "Quasi a matrix transformations: transforms a list of form ((a1 a2 a3) (b1 b2 b3) (c1 c2 c3) ...) into ((a1 b1 c1 ...) (a2 b2 c2 ...) (a3 b3 c3 ...))." (apply #'mapcar #'(lambda (&rest all) all) in-list)) (defun map-omn (fn omn-expr) "Variant of mapcar for omn expressions, intended for creating variations of these. Applies function fn to every note in omn-expr (a flat OMN list). fn must exect four arguments (a length, pitch, velocity and articution) and returns a list of four values (a length, pitch, velocity and articution)." (destructuring-bind (lengths pitches velocities articulations) (mat-trans (funcall #'mapcar fn (omn :length omn-expr) (omn :pitch omn-expr) (omn :velocity omn-expr) (omn :articulation omn-expr))) (make-omn :length lengths :pitch pitches :velocity velocities :articulation articulations)))  
    The user-level code starts here.
    ;;; ;;; Actual program ;;; (setf my-data '(e. c4 pppp tasto d4 ponte e4)) (map-omn #'(lambda (l p v a) (list l p ;; replace tasto dynamics by fff (if (equal a 'tasto) 'fff v) a)) my-data) ; => (e. c4 fff tasto d4 pppp ponte e4)  
  4. Like
    torstenanders got a reaction from AM in L-Lisp   
    Are rewrite-lsystem and its friends based on L-Lisp by Knut Arild Erstad (Erstad, 2002; http://www.ii.uib.no/~knute/lsystems/llisp.html)
    If not, they look and work surprisingly similar. For example, I can just use complex examples as the following from Erstad's documentation, and they work in OM.
     
    ;; Mycelis muralis (from ABoP, p. 87--90) (defclass mycelis (l-system) ((axiom :initform '((I 20) Fa (A 0))) (ignore-list :initform '(+ /)) (homomorphism-depth :initform 10) (frame-delay :initform 0.5) (frame-list :initform '((0 100))) (limits :initform '((-2 -1 -1) (2 14 1))))) (defmethod l-productions ((ls mycelis)) (choose-production ls ;; Growing apex ((A x) (with-lc (S) (--> (T 0))) (if (> x 0) (--> (A (1- x))) (--> [ (+ 30) Fb ] Fa (/ 180) (A 2)))) ;; Stem segment: propagates signals (Fa (with-lc (S) (--> Fa S)) (with-rc ((T c)) (--> (T (1+ c)) Fa))) ;; Undeveloped branch segment (Fb (with-lc ((T c) Fa) (--> (I (1- c)) Fa (A 3)))) ;; Delayed signal ((I c) (if (zerop c) (--> S) (--> (I (1- c))))) ;; Signals disappers (S (--> nil)) ((T c) (--> nil)) )) (rewrite-lsystem 'mycelis :depth 7)  
    If this is Erstad's code, then it would be appropriate to acknowledge this in the documentation etc., and helpful for users to point at the much more extensive documentation of the original software. There are very many more features of this generator that users cannot guess from the existing documentation.
     
    Thanks!
     
    Torsten
     
    Erstad, K. A. (2002) L-systems, twining plants, Lisp. Master’s thesis thesis. University of Bergen. [online]. Available from: http://www.vcn.bc.ca/~griffink/lisp_lsystems.pdf (Accessed 21 December 2016).
  5. Like
    torstenanders reacted to Wim Dijkgraaf in VSL converter -> Sibelius Sound Set to Opusmodus Sound Set   
    Hi Torsten,
     
    I've adjusted the source code and checked if it still works .. it does.
     
    Just a short explanation of what I did to write the converter:
    - used Microsoft XSD tool (included as xsd.exe) to auto generate a C# class from an XML file, with one of the Sibelius soundset files as input.
    - I don't know to what degree that format is standardized. Might be that you encounter issues with EastWest files ... or maybe it just works. If both VSL and EastWest use the same XML elements, it should work.
    -  Wrote some classes with the logic to create Opusmodus Soundsets
    - Added a console project that does the reading of Sibelius soundsets, calls the converter and serializes the result back to disc as an opusmodus soundset file.
     
    The output from the converter is not 100% correct; meaning that you'll have to do some manual adjustments in Opusmodus to make sure that the soundset file is 100% Common Lisp 'compatible'. This due to some special characters that the converter doesn't handle correctly (yet) and which can't be used in Common Lisp symbols.
     
    There is also some logic that maps VSL names to standard Opusmodus names that you'll have to adjust in order to be correct for the EastWest library.
     
    I included the SibeliusSoundSet files for your convenience so you can make sure the solution works on your machine. It should be hassle free under Microsoft Visual Studio Community edition and above.
     
    If I can be of some help, please let me know.
     
    Big hug,
     
    Wim Dijkgraaf
     
    p.s. Wrote the code under time pressure and wanted to make sure first that the concept is viable. Should refactor the code :-) Even better ... re-write this code in Common Lisp running in Opusmodus ... :-)
  6. Like
    torstenanders reacted to Stephane Boussuge in A few sound-set related issues   
    Some SoundBanks like XSample chamber Ensemble use two Keyswitch.
     
    i attach here my soundset for EWSO, i use them every days. i never share them because they are sometimes incomplete  but could help you...
     
    SB.
     
    EWSOSoundsetSB.zip
  7. Like
    torstenanders got a reaction from Stephane Boussuge in Looking for teacher / coach in Lisp Programming with Opusmodus   
    Finally it is the question whether you want to generate music with the help of blackboxes/tools (whether open source or OM)... or you want to think, to reflect and to program your own ideas, and not to take what tools can easily generate (in this case you are not/less "independent").
     
    Actually, I don't see this necessarily as an either-or. As someone who spend many years developing a composition system from scratch on my own I would say that -- if your main goal is actually composing and not developing -- then you should welcome the tools that are useful for your purposes, and not necessarily trying to stay "pure". For own functions I would try to avoid any dependency on software not freely available, but not for a composition project.
     
    Best,
    Torsten
  8. Like
    torstenanders got a reaction from lviklund in Neo-Riemannian approach (Tonnetz, etc.)   
    Would it help to have your transformation functions be related to explicit scales and its scale degrees (instead of measuring intervals in semitones)? That is what I did in my own computational harmony model. That allowed me to use arbitrary scales and the chords that belong to those scales. 
     
    The tricky bit is that I am using constraint programming, where each variable can be controlled by multiple restrictions (constraints). So, I can restrict both intervals measured in semitones and in scale degrees independently. Would be tricky to translate that into plain functions.
     
    Attached is a related (unpublished) paper that outlines the approach in principle, though many details are missing in that paper. Tricky to share the code on that, because there is lots. Some core functionality (the data structure) is defined here (Oz programming language).
    https://github.com/tanders/strasheela/blob/master/strasheela/contributions/anders/HarmonisedScore/source/Score.oz
     
    Constraint programming is also possible within Common Lisp (e.g., with Screamer, https://nikodemus.github.io/screamer/, and other constraint solvers exist as well), and for mere harmony modelling (in contrast to modelling polyphonic music composition in general) this might be rather fast.
     
    Best,
    Torsten
     
    TorstenAnders-HarmonyModel-CP2016.pdf
  9. Like
    torstenanders reacted to Wim Dijkgraaf in Neo-Riemannian approach (Tonnetz, etc.)   
    I think it's working now. Have also removed workspace from source control. Guess that those paths to my file system are of no help to others :-)
     
  10. Like
    torstenanders got a reaction from lviklund in Microtonal notations   
    Dear Janusz,
     
    We were recently discussing potential microtonal support for Opusmodus. I understand that you suggested a representation based on 12-tone equal division of the octave (EDO) with free cent deviations as a flexible and generic solution. I agree that this could be a sufficient solution in the background, because all microtonal pitches, intervals, chords and scales can be specified that way.
     
    However, in my view it would be an insufficient solution as the only microtonal representation at the user-level, because it would be highly cumbersome. Imagine composing a melody in C-major by writing and reading only frequency values in Hz. Of course every tone in C-major can be expressed as a frequency in principle, but as a musician you rarely want to think in such numeric detail. Besides, a slight tuning variation would change all the figures. Composing microtonal music in cent values is equally awkward. 
     
    I understand that for a CAC environment like Opusmodus it is important to have a generic representation, but there are so many microtonal tunings and notations. Luckily some efforts have been done my the community already towards more generic representations. 
     
    Basically, there are three main microtonal directions in Western music:
     
    Just intonation (JI): Multidimensional tuning approach, where intervals can be represented as whole number frequency ratios, with theoretically an unlimited number of tones per octave. Examples for JI intervals are 3:2 (perfect fifth), 5:4 (major third), 7:4 (harmonic seventh), 7:6 (subminor third) etc. JI thinking is important, e.g., for extending harmony beyond traditional boundaries by intervals that musicians can intonate by ear, and it was useful for that already centuries ago. The Common Lisp support of fractions makes JI support particularly interesting for Opusmodus. Equal temperaments: Equal divisions of the octave (or other intervals). Some equal temperaments are particularly widely used and researched, because they approximate certain just intonation intervals particularly well, including 19-EDO, 22-EDO, 24-EDO (quartertones), 31-EDO (almost quarter comma extended meantone), 41-EDO (almost Pythagorean tuning), 53-EDO and 72-EDO.  Other temperaments: Designed to reduce the total number of tones and that the cognitive workload using them, which approximate JI intervals. Examples are the various meantone temperaments, or well temperaments.  
    My explanation already suggested that these different schools of thought are related. Various equal temperaments are widely used, because they approximate certain JI intervals rather well, while at the same time allowing for arbitrary transpositions within a limited number of tones overall. For example, our standard 12-EDO approximates 3:2 and its relatives (4:3 -- 3-limit intervals) almost perfectly, and 5:4 and its relatives (5:6 etc.  -- 5-limit) reasonably well, while 7:4 (7-limit) or 11:8 ( 11-limit) are not part of 12-EDO. 
     
    Some notations aim to present a unified format for multiple approaches. Such notations could be a useful foundation for a microtonal representation of Opusmodus.
    A relatively simple example of such an approach is the HEWM notation, which stands for Helmholtz / Ellis / Wolf / Monzo notation (Monzo, 2005a and 2005b). This staff notation is an extension of the common music notation designed to support both 72-EDO (a superset of 12-EDO, 24-EDO, and also 36-EDO), and 11-limit just intonation. The notation exists both as staff notation, and ASCII for written communication in emails (and potentially programming code). 
     
    In this notation, all nominals (pitches without accidentals, like a, b, c, d...) are considered to be tuned in fifth (Pythagorean tuning, 3-limit). In other words, the interval C, E is considered a Pythagorean major third, not a just major third. For each higher limit, the notation introduces a pair of accidentals to raise or lower the pitch accordingly. For example, the JI major third is notated C, E-, where the minus sign (-) represents a transposition by a syntonic comma downwards. That way, the notation can distinguish between a Pythagorean major third and a just major third. In a performance situation, this interval can either be tuned in 72-EDO or justly -- but the notation is the same.
     
    Particularly comprehensive notations based on the same principles are Sagittal notation (Secor and Keenan, 2004) and the Extended Helmholtz-Ellis JI Pitch Notation (Sabat and Schweinitz, 2005). Sagittal is explicitly designed to support both just intonation (including highly complex intervals) and many equal temperaments, but Extended Helmholtz-Ellis JI Pitch could do that in principle as well to a certain degree. It is more simple than Sagittal (while more complex and HEWM), and could therefore be preferable. However, only Sagittal offers also ASCII representations for all its accidentals, so for a programming environment it could be a more natural choice. 
     
    If Opusmodus would support any of these notations both in OMN and the resulting notation, then it would offer a highly flexible environment for composers interested in microtonal music, and it would allow for a variety of tunings with a single notation. The existing ASCII representations could likely not be directly translated into OMN, because many special characters are reserved in Common Lisp, but having them would be a starting point.  
     
    I would be happy to help designing a notation suitable for Opusmodus, i.e., taking the restrictions of Lisp syntax into account. 
     
    What do you think? 
     
    Best,
    Torsten
     
    PS: If you also want to support other temperaments beyond equal temperaments and JI then we should discuss how to represent regular temperaments (Milne et al. 2007), but then the notation gets even more tricky.
     
    References
     
    Milne, A., W. Sethares & J. Plamondon (2007) Isomorphic Controllers and Dynamic Tuning: Invariant Fingering over a Tuning Continuum. Computer Music Journal. 31(4), 15–32.
    Monzo, J. (2005a) 72-tone equal-temperament / 72-edo. In: Encyclopedia of Microtonal Music Theory. Available from: http://tonalsoft.com/enc/number/72edo.aspx
    Monzo, J. (2005b) HEWM notation. In: Encyclopedia of Microtonal Music Theory. Available from: http://tonalsoft.com/enc/h/hewm.aspx
    Sabat, M. & Schweinitz, W. von (2005) The Extended Helmholtz-Ellis JI Pitch Notation. [online]. Available from: http://www.marcsabat.com/pdfs/notation.pdf
    Secor, G. D. & Keenan, D. C. (2004) Sagittal. A Microtonal Notation System. Xenharmonikôn, An Informal Journal of Experimental Music. 18. Available from: http://sagittal.org/sagittal.pdf
     
    Torsten Anders
    http://www.torsten-anders.de
  11. Like
    torstenanders got a reaction from Shahriyar in Spectral Tools/Partials Documentation   
    Concerning general literature on algorithmic composition and spectral music consider the following book. It contains a nicely detailed article by Rozalie Hirs on Tristan Murail's use of OpenMusic for a specific composition, which Rozalie wrote while or after she was his pupil. 
     
    Hirs, R. & Gilmore, B. (eds.) (2009) Contemporary Compositional Techniques and OpenMusic. Collection Musique/Sciences. IRCAM/Delatour.
  12. Like
    torstenanders got a reaction from hujairi in Spectral Tools/Partials Documentation   
    Concerning general literature on algorithmic composition and spectral music consider the following book. It contains a nicely detailed article by Rozalie Hirs on Tristan Murail's use of OpenMusic for a specific composition, which Rozalie wrote while or after she was his pupil. 
     
    Hirs, R. & Gilmore, B. (eds.) (2009) Contemporary Compositional Techniques and OpenMusic. Collection Musique/Sciences. IRCAM/Delatour.
×
×
  • Create New...

Important Information

Terms of Use Privacy Policy