Jump to content

torstenanders

Members
  • Posts

    496
  • Joined

  • Last visited

Reputation Activity

  1. Like
    torstenanders reacted to loopyc in tutorial guide   
    SB:
     
    https://opusmodus.com/forums/tutorials/tutorial-guide/
  2. Like
    torstenanders reacted to opmo in [SOLVED] Midi In Collect (now Opusmodus have MIDI input)   
    Ver 2. will be able to import musicXML files and convert to omn.
  3. Like
    torstenanders reacted to Stephane Boussuge in Group orchestration / instrumentation example   
    I am a bit overbooked actually and didn't took the time to comment it correctly, but you've made it :-)
    Thank you Torsten !
     
    In fact the variables grp1, grp2 etc.. are like orchestration presets and can be (for example) stored in a library file to be recalled algorithmically.
    S.
     
  4. Like
    torstenanders got a reaction from Stephane Boussuge in Group orchestration / instrumentation example   
    Just helping others to read this code: the key data here are the variables after the comment ;; Group orchestration. Each variable grp1, grp2, etc. set for each part in a single bar whether that part should play in the end or not. The order of those groups (bars specifying which voice is playing) is then randomised. 
     
    Best,
    Torsten
  5. Thanks
    torstenanders got a reaction from opmo in Group orchestration / instrumentation example   
    Just helping others to read this code: the key data here are the variables after the comment ;; Group orchestration. Each variable grp1, grp2, etc. set for each part in a single bar whether that part should play in the end or not. The order of those groups (bars specifying which voice is playing) is then randomised. 
     
    Best,
    Torsten
  6. Like
    torstenanders got a reaction from loopyc in Translating MIDI velocities into OMN velocities   
    Ah, great!
     
    The documentation does not mention that the input can also be MIDI velocity integers, so I missed that. 
     
    Best,
    Torsten
    added 2 minutes later BTW: I needed that to translate values from OpenMusic data objects into Opusmodus. I am currently working on a library that will bring OpenMusic functions/methods to Opusmodus...
     
    Best,
    Torsten
  7. Like
    torstenanders got a reaction from Stephane Boussuge in Translating MIDI velocities into OMN velocities   
    Ah, great!
     
    The documentation does not mention that the input can also be MIDI velocity integers, so I missed that. 
     
    Best,
    Torsten
    added 2 minutes later BTW: I needed that to translate values from OpenMusic data objects into Opusmodus. I am currently working on a library that will bring OpenMusic functions/methods to Opusmodus...
     
    Best,
    Torsten
  8. Like
    torstenanders got a reaction from lviklund in Translating MIDI velocities into OMN velocities   
    Ah, great!
     
    The documentation does not mention that the input can also be MIDI velocity integers, so I missed that. 
     
    Best,
    Torsten
    added 2 minutes later BTW: I needed that to translate values from OpenMusic data objects into Opusmodus. I am currently working on a library that will bring OpenMusic functions/methods to Opusmodus...
     
    Best,
    Torsten
  9. Like
    torstenanders got a reaction from JulioHerrlein in Crazy behavior   
    > Maybe a good idea would be some kind of FLUSH function that cleans the environment,
    > so we don't need to close and reopen the program ;)
     
    Setting (and overwriting!) "global variables" with setf results in side effects, which can be difficult to control. 
     
    Because of that, experienced Lisp programmers use side effects like overwriting "global variables" only rarely and when really necessary, and instead work with constants and "local variables". 
     
    For quick hacking or testing using setf is very convenient and should not be dismissed, but if you are looking for a way to avoid restarting to create a clean slate then use "local variables".
     
    Best,
    Torsten 
     
    In Lisp parlance, these are dynamic and lexical variables, not quite the same thing as local and global variables in other languages, but perhaps these terms are more easy to understand :)
  10. Thanks
    torstenanders reacted to opmo in Constructing and deconstructing scores   
    The OMN-PLIST and OMN-PROCESS function is not documented because is a not part of the release yet. (work in progress).
     I have created the new function in order to get all the attributes and articulations symbols into one list:
    :leg
    :ped :ped1 :half-ped :half-ped1 :sost-ped :sost-ped1 :una-corda :una-corda1
    :15mb :15ma :8vb :8va
    :kgliss-ch :kgliss :gliss4 :gliss3 :gliss2 :gliss
     
    The OMN function will stay as it is for now.
    The OMN-PLIST function has 5 types: length, pitch, velocity, duration and articulation.
    The NIL will return all types.
    (setf omn '((-3h fs4 pp leg g4 leg) (h a4) (-q cs5 mp< ord) (q c5 f stacc -) (-5h - c5 pp leg e5 < leg f5 < leg) (h gs4 pp))) (omn-plist nil omn) => (:length ((-1/6 1/6 1/6) (1/2) (-1/4 1/4) (1/4 -1/4) (-1/10 -1/10 1/10 1/10 1/10) (1/2)) :pitch ((fs4 g4) (a4) (cs5) (c5) (c5 e5 f5) (gs4)) :velocity ((pp pp) (pp) (mp<) (f) (pp < <) (pp)) :articulation ((leg leg) (-) (ord) (stacc) (leg leg leg) (-)))  
    grace-note will produce :duration parameters
    (setf omn2 '((-3h fs4 pp leg g4 leg) (h a4) (-q cs5 mp< ord s c4 app e cs5) (q c5 f stacc -) (-5h - c5 pp leg e5 < leg f5 < leg) (h gs4 pp))) (omn-plist nil omn2) => (:length ((-1/6 1/6 1/6) (1/2) (-1/4 1/4 0 1/8) (1/4 -1/4) (-1/10 -1/10 1/10 1/10 1/10) (1/2)) :pitch ((fs4 g4) (a4) (cs5 c4 cs5) (c5) (c5 e5 f5) (gs4)) :velocity ((pp pp) (pp) (mp< mf mf) (f) (pp < <) (pp)) :duration ((1/6 1/6) (1/2) (1/4 1/16 1/8) (1/4) (1/10 1/10 1/10) (1/2)) :articulation ((leg leg) (-) (ord app -) (stacc) (leg leg leg) (-)))  
    Test:
    (setf plist (omn-plist nil omn)) (apply #'make-omn plist) => ((-3h fs4 pp leg g4 leg) (h a4 pp) (-q cs5 mp< ord) (q c5 f stacc -) (-5h - c5 pp leg e5 < leg f5 < leg) (h gs4 pp))  
    The OMN-PROCESS function still needs more work.

     
  11. Thanks
    torstenanders got a reaction from JulioHerrlein in Argument Question (simple problem)   
    You can define local variables within and outside functions with let.
     
    In principle, you can also use setf within a function, but then you are overwriting the value of a global variable. In most cases you want to avoid that. Functions that do not change anything outside them (so called side effects) are much safer. 
     
    Both let and setf are explained in detail in the very informative online textbook Practical Common Lisp, chapter 6: http://www.gigamonkeys.com/book/variables.html. There you will also learn that Lisp actually distinguishes between lexical and dynamic variables; I was talking here about local and global variables instead for simplicity. In case this chapter covers something you don't follow, just go back a chapter or two and you will learn a lot :)
     
    Simple example:

    (defun my-function (x)
      (let ((y (+ x 1)))
        y)) 
    (my-function 42)
    ; => 43
     
    Best,
    Torsten 
  12. Thanks
    torstenanders reacted to loopyc in 'Stages 13' Typo?   
    I wouldn't want to (again) presume an actual app bug at this point in my learning cycle, but I have come across a number of small typos and incorrect sentence structures in the 'Assistant materials.
     
    I will cut/paste those into a master document going forward, and when I get enough to justify...will send along via'Request Support' in a single document ;-)
     
    Thank you for the info, patience, and replies...it's been a challenging but incredibly rewarding first week with Opusmodus, and the conversations and sharing in this forum (along with YouTube/blog links) have played no small part in my learning what it is I need to learn! 
     
    Thank you all for your spirit of community and knowledge :)
  13. Like
    torstenanders got a reaction from Stephane Boussuge in edit-omn update: 'dynamic' arguments supported   
    There was a bug for processing OMN lists that are not nested. That has now been fixed, and the updated version is at GitHub.
     
    Best,
    Torsten
  14. Like
    torstenanders got a reaction from loopyc in rotate-omn   
    Here is a rather simple function that might be useful for others as well. 
     
    The function rotate-omn rotates a sequence by the given number of positions, much like gen-rotate. However, you can specify which parameter you want to rotate, whether you want to rotate the flattened sequence or subsequences separately, or only certain subsequences. 
    (setf melody '((-h q c4) (q. f4 e g4 q a4) (h. g4))) (rotate-omn :right melody)  ; => ((-h q g4) (q. c4 e f4 q g4) (h. a4)) (rotate-omn :left melody :parameter :length)  ; => ((q c4 q. f4 e g4) (q a4 h g4 tie) (q g4 -h)) (rotate-omn 2 melody :section '(1) :flat nil) ; => ((-h q c4) (q. g4 e a4 q f4) (h. g4))   
    The function is part of my tot library (http://github.com/tanders/tot). It is a generalisation of the built-in gen-rotate, again with a short definition calling my function edit-omn. 
     
    Best,
    Torsten
     
  15. Thanks
    torstenanders reacted to opmo in 'Stages 13' Typo?   
    I will open the Bug Report forum to all.
    Reporting a bug must come with an example how to reproduce it.
  16. Like
    torstenanders got a reaction from loopyc in Looking for a function that could do that   
    Here is another approach to implement the same thing, but a but more concisely in just one line (most of the code below is the documentation :)
    (defun mat-trans (lists)   "Matrix transformation.    (mat-trans '((a1 a2 a3) (b1 b2 b3) (c1 c2 c3) ...))    => ((a1 b1 c1 ...) (a2 b2 c2 ...) (a3 b3 c3 ...))"   (apply #'mapcar #'(lambda (&rest all) all) lists))  
  17. Thanks
    torstenanders reacted to loopyc in 'Stages 13' Typo?   
    Not sure where to report this (if at all) but since I am working myself through the basic documentation, just thought I would let you know FWIW about what I think is a typo? (as it won't evaluate as written).
     
    Please let me know if there is a more covert way to report these as i don't want to clutter this forum if you prefer direct contact for little  things like this ;-)
     
    "Working with Binary Rhythmics
     
    This piece demonstrates the use of binary lists as an ingenious way to create and modify rhythm: 0 is a rest-length, 1 is a note-length.
     
    (setf bin-rhythm (gen-binary-rnd 5 5 2 1 0 :seed 41))
     
    => ((0 0 1 1 0) (1 0 0 1 1) (0 0 1 0 1)
        (1 1 0 1 1) (0 1 0 0 1))"
     
    Should omit '0' right before ' :seed' yes? (gen-binary-rnd 5 5 2 1 0 :seed 41))
     
  18. Like
    torstenanders got a reaction from lviklund in edit-omn update: 'dynamic' arguments supported   
    Stephane Boussuge wrote on 23 October
    > your edit-omn function is definitively super-mega useful !!
     
    I updated my function edit-omn. Remember that this function is for turning relatively simple functions processing some OMN parameter sequence (e.g., pitch or length lists) quasi automatically into much more expressive functions processing arbitrary OMN expressions, including nested expressions, and automatically supporting typical Opusmodus arguments like section and flat.
     
    I now added support for creating functions with 'dynamic' arguments, i.e. arguments where different values are used for processing different sublists of OMN expressions. For example, again consider a generalisation of the builtin Opusmodus function gen-rotate,which represents a very useful compositional concept, but its current implementation is rather restricted. I already showed how the new and generalised function rotate-omn expands the existing gen-rotate by introducing arguments like flat and section as shown below.   
     
    (setf melody '((-h e c4 e4) (q. f4 e g4 q a4) (q g4 f4 e e4 d4)))
    ;; Rotate default parameter pitch of 2nd bar (section 1) to the right.
    ;; The link above shows how to alternatively rotate length values etc.
    (rotate-omn 1 melody :section '(1) :flat nil)
    ; => ((-h e c4 e4) (q. a4 e f4 q g4) (q g4 f4 e e4 d4)) 
     
    Using a new version of rotate-omn defined with the revised edit-omn we can now also specify different rotation amounts for different bars. The first argument of the function is given a list of rotation amounts (0 1 2), so the pitches of the first bar are not rotated at all, the pitches of the first bar are rotated 1 step to the right, and the pitches of the second bar 2 steps.
     
    (rotate-omn '(0 1 2) melody :flat nil)
    => ((-h e c4 e4) (q. a4 e f4 q g4) (q e4 d4 e g4 f4))
     
    Such 'dynamic' function arguments can be combined with the section argument to limit the processing of the input music to only certain bars. The following call rotates the bars 2 and 3 only (section is (1 2)), the first bar of this selection by 2 steps to the right, and the next by 1 step.
     
    (rotate-omn '(2 1) melody :section '(1 2) :flat nil)
    ; => ((-h e c4 e4) (q. g4 e a4 q f4) (q d4 g4 e f4 e4))
     
    Now, remember that this post is actually about simplifying the definition of functions like rotate-omn. The definition of this function is pretty short, as the actual rotation is already implemented by gen-rotate, and all support of arguments like section, flat and now also 'dynamic' arguments is automatically implemented by edit-omn. For getting dynamic arguments, all we need to do is the following. First, we test whether the argument we want to turn into a 'dynamic' argument is a list. If not, we want to use it as a static value. The result of that test (using listp) is bound to the local variable n-list-arg?, because we need to use this value at two places. The argument additional-args on the last line gets our argument n if it is a list.
     
    We tell edit-omn how to actually transform the input music (e.g., sublists) by handing it a function -- that is another program that does the actual transformation. In the case below this function is an anonymous function (it has no name). Such functions are defined with lambda, which is pretty much like defun but without expecting a function name. Our anonymous function basically just calls gen-rotate, but if n is a list, then we first need to extract the OMN data to rotate and the amount by which to rotate it from the single argument xs of our anonymous function.
     
    (defun rotate-omn (n sequence &key (parameter :pitch) (flat T) (section nil))
      (let ((n-list-arg? (listp n)))
        (edit-omn parameter sequence
                  #'(lambda (xs)
                     (if n-list-arg?
                         (gen-rotate (second xs) (first xs))
                         (gen-rotate n xs)))
                  :section section
                  :flat flat
                  :additional-args (when n-list-arg? n))))
     
    With this approach you can write relatively simply functions for processing individual parameters, and then turn that relatively simple function into a much more fancy function processing arbitrary OMN expressions, including nested expressions, and automatically supporting typical Opusmodus arguments like section and flat, and now also with dynamic arguments. 
     
    As mentioned in other posts, the function edit-omn can be found as part of my tot library at GitHub (and yes, that library has a buch of dependencies, and is therefore a bit tricky to install the first time; updates are a bit more easy).  I also cleaned up the definition of edit-omn and fixed some bug that way.  
     
    Best,
    Torsten
  19. Like
    torstenanders got a reaction from AM in edit-omn update: 'dynamic' arguments supported   
    Stephane Boussuge wrote on 23 October
    > your edit-omn function is definitively super-mega useful !!
     
    I updated my function edit-omn. Remember that this function is for turning relatively simple functions processing some OMN parameter sequence (e.g., pitch or length lists) quasi automatically into much more expressive functions processing arbitrary OMN expressions, including nested expressions, and automatically supporting typical Opusmodus arguments like section and flat.
     
    I now added support for creating functions with 'dynamic' arguments, i.e. arguments where different values are used for processing different sublists of OMN expressions. For example, again consider a generalisation of the builtin Opusmodus function gen-rotate,which represents a very useful compositional concept, but its current implementation is rather restricted. I already showed how the new and generalised function rotate-omn expands the existing gen-rotate by introducing arguments like flat and section as shown below.   
     
    (setf melody '((-h e c4 e4) (q. f4 e g4 q a4) (q g4 f4 e e4 d4)))
    ;; Rotate default parameter pitch of 2nd bar (section 1) to the right.
    ;; The link above shows how to alternatively rotate length values etc.
    (rotate-omn 1 melody :section '(1) :flat nil)
    ; => ((-h e c4 e4) (q. a4 e f4 q g4) (q g4 f4 e e4 d4)) 
     
    Using a new version of rotate-omn defined with the revised edit-omn we can now also specify different rotation amounts for different bars. The first argument of the function is given a list of rotation amounts (0 1 2), so the pitches of the first bar are not rotated at all, the pitches of the first bar are rotated 1 step to the right, and the pitches of the second bar 2 steps.
     
    (rotate-omn '(0 1 2) melody :flat nil)
    => ((-h e c4 e4) (q. a4 e f4 q g4) (q e4 d4 e g4 f4))
     
    Such 'dynamic' function arguments can be combined with the section argument to limit the processing of the input music to only certain bars. The following call rotates the bars 2 and 3 only (section is (1 2)), the first bar of this selection by 2 steps to the right, and the next by 1 step.
     
    (rotate-omn '(2 1) melody :section '(1 2) :flat nil)
    ; => ((-h e c4 e4) (q. g4 e a4 q f4) (q d4 g4 e f4 e4))
     
    Now, remember that this post is actually about simplifying the definition of functions like rotate-omn. The definition of this function is pretty short, as the actual rotation is already implemented by gen-rotate, and all support of arguments like section, flat and now also 'dynamic' arguments is automatically implemented by edit-omn. For getting dynamic arguments, all we need to do is the following. First, we test whether the argument we want to turn into a 'dynamic' argument is a list. If not, we want to use it as a static value. The result of that test (using listp) is bound to the local variable n-list-arg?, because we need to use this value at two places. The argument additional-args on the last line gets our argument n if it is a list.
     
    We tell edit-omn how to actually transform the input music (e.g., sublists) by handing it a function -- that is another program that does the actual transformation. In the case below this function is an anonymous function (it has no name). Such functions are defined with lambda, which is pretty much like defun but without expecting a function name. Our anonymous function basically just calls gen-rotate, but if n is a list, then we first need to extract the OMN data to rotate and the amount by which to rotate it from the single argument xs of our anonymous function.
     
    (defun rotate-omn (n sequence &key (parameter :pitch) (flat T) (section nil))
      (let ((n-list-arg? (listp n)))
        (edit-omn parameter sequence
                  #'(lambda (xs)
                     (if n-list-arg?
                         (gen-rotate (second xs) (first xs))
                         (gen-rotate n xs)))
                  :section section
                  :flat flat
                  :additional-args (when n-list-arg? n))))
     
    With this approach you can write relatively simply functions for processing individual parameters, and then turn that relatively simple function into a much more fancy function processing arbitrary OMN expressions, including nested expressions, and automatically supporting typical Opusmodus arguments like section and flat, and now also with dynamic arguments. 
     
    As mentioned in other posts, the function edit-omn can be found as part of my tot library at GitHub (and yes, that library has a buch of dependencies, and is therefore a bit tricky to install the first time; updates are a bit more easy).  I also cleaned up the definition of edit-omn and fixed some bug that way.  
     
    Best,
    Torsten
  20. Like
    torstenanders got a reaction from JulioHerrlein in Set Theory: Retrieving Pitch Class sets from collections of notes   
    > Given some UNORDERED amount of pitches, how retrive the prime form and/or Forte Number.
     
    Check out function pcs-analysis. The problem is that this function does not return, but only print that data, so it is difficult to apply such analysis on a sequence/list of interval sets etc. 
     
    > How to do this from an existing midi file or XML ? Is t possible to retrive the forte number of every "n" notes of the pitch collection (melody or chord)?
     
    You can import MIDI files with function midi-to-score, but not (yet?) MusicXML file. 
     
    > Can you circunscribe some notes for analysis in a large file ?
     
    What do you mean?
     
    BTW, for music analysis you may want to have a look at systems designed for that, like the free music21 (http://web.mit.edu/music21/), based on Python. music21 can import music in various formats, including MIDI and MusicXML (the latter is preferable). The kind of analysis you are after is documented in the tutorial, e.g., at http://web.mit.edu/music21/doc/usersGuide/usersGuide_25_postTonalTools1.html?highlight=forte, which shows how you can add, e.g., the Forte class analysis as text (lyrics) to the score, which in turn you could export as MusicXML. With some Python programming you could also export your analysis data in a format that Lisp and thus could in turn import. E.g., you could export it from Python to JSON format (https://docs.python.org/2/library/json.html), and then import that data into Common Lisp (e.g., https://common-lisp.net/project/cl-json/).
     
    Best,
    Torsten 
     
     
  21. Like
    torstenanders got a reaction from Stephane Boussuge in rotate-omn   
    Here is a rather simple function that might be useful for others as well. 
     
    The function rotate-omn rotates a sequence by the given number of positions, much like gen-rotate. However, you can specify which parameter you want to rotate, whether you want to rotate the flattened sequence or subsequences separately, or only certain subsequences. 
    (setf melody '((-h q c4) (q. f4 e g4 q a4) (h. g4))) (rotate-omn :right melody)  ; => ((-h q g4) (q. c4 e f4 q g4) (h. a4)) (rotate-omn :left melody :parameter :length)  ; => ((q c4 q. f4 e g4) (q a4 h g4 tie) (q g4 -h)) (rotate-omn 2 melody :section '(1) :flat nil) ; => ((-h q c4) (q. g4 e a4 q f4) (h. g4))   
    The function is part of my tot library (http://github.com/tanders/tot). It is a generalisation of the built-in gen-rotate, again with a short definition calling my function edit-omn. 
     
    Best,
    Torsten
     
  22. Like
    torstenanders reacted to Deb76 in Opuspianotimbres for Pianoteq Video Contest 2017   
    Hello, 
    This is my participation at Pianoteq Video Contest 2017. The composition was written with Opusmodus and played in Ableton Live with seven instances of Pianoteq (modified TubularBells, modified ConcertArp recording, Steinway D Classical Recording A, modified Celesta, modified Cinbalom, modified original ChurchBells, Steinway D Classical Recording BA and completed with a Ircam Solo Instruments bank instance (flute, Horn, Cello) read via the UVI Workstation :
     
    and the list of videos in competition : http://www.forum-pianoteq.com/viewtopic.php?id=5301
    Do not hesitate to tell me what you think.
    Didier
    PS : It is advisable to play the video in 1080p HD and listen to the headphone for panoramic movements. 
  23. Thanks
    torstenanders got a reaction from AM in Improving length-rest-series   
    I sometimes like to turn certain notes into rests. The built-in function length-rest-series is great for that, but it only works with lengths, not full OMN expressions. So, I generalised that function. I can do now, e.g., the following. 
     
    (setf melody '((s eb6 < leg f5 < leg c5 < leg f5 < leg) (e e6 f - -q)))
    (note-rest-series '(1 1) melody :swallow T :section '(0))
    ; => ((-s - c5 < leg f5 < leg) (e e6 f - -q))
     
    Note that in contrast to the original function length-rest-series, the new function note-rest-series does not only support OMN expressions, but also extra arguments like swallow and section.
     
    The definition of this function uses length-rest-series and my function edit-omn for writing such generalisations, and it can therefore be rather short. In fact, the documentation string of the function is much longer than the definition itself :)  Please see below.
     
    The function edit-omn is part of my tot library, which is available at GitHub. You can see its definition at starting at (currently) line 24 at https://github.com/tanders/tot/blob/master/sources/OMN-utils.lisp. 
     
    Note that with edit-omn you can also easily turn other functions that expect just a single parameter list (e.g., pitches, or lengths) into functions for OMN expressions by automatically preserving the time signature and very conveniently adding standard arguments like flat or section. 
     
    Best,
    Torsten
     
    (defun note-rest-series (positions sequence &key (flat nil) (swallow nil) (section nil)) "This function is like the Opusmodus built-in length-rest-series, but supports arbitrary OMN expressions as input and additionally the arguments swallow and section. Args: - positions (list of ints): positions of notes to be turned into rests - sequence (list of lengths or OMN expression): music to process - flat (Boolean): whether positions count for sublists (nil) or the whole list (T) - swallow (Boolean): whether the pitches of notes turned into rests should be shifted to the next note or omitted (swallowed) - section (list of ints): positions of sublists to process. This argument is ignored if flat is T. Example: ;;; (setf melody '((s eb6 < leg f5 < leg c5 < leg f5 < leg) (e e6 f - -q))) ;;; (note-rest-series '(1 1) melody :swallow T :section '(0)) " (edit-omn :length sequence #'(lambda (ls) (length-rest-series positions ls)) :swallow swallow :section section :flat flat))  
  24. Thanks
    torstenanders got a reaction from lviklund in Improving length-rest-series   
    I sometimes like to turn certain notes into rests. The built-in function length-rest-series is great for that, but it only works with lengths, not full OMN expressions. So, I generalised that function. I can do now, e.g., the following. 
     
    (setf melody '((s eb6 < leg f5 < leg c5 < leg f5 < leg) (e e6 f - -q)))
    (note-rest-series '(1 1) melody :swallow T :section '(0))
    ; => ((-s - c5 < leg f5 < leg) (e e6 f - -q))
     
    Note that in contrast to the original function length-rest-series, the new function note-rest-series does not only support OMN expressions, but also extra arguments like swallow and section.
     
    The definition of this function uses length-rest-series and my function edit-omn for writing such generalisations, and it can therefore be rather short. In fact, the documentation string of the function is much longer than the definition itself :)  Please see below.
     
    The function edit-omn is part of my tot library, which is available at GitHub. You can see its definition at starting at (currently) line 24 at https://github.com/tanders/tot/blob/master/sources/OMN-utils.lisp. 
     
    Note that with edit-omn you can also easily turn other functions that expect just a single parameter list (e.g., pitches, or lengths) into functions for OMN expressions by automatically preserving the time signature and very conveniently adding standard arguments like flat or section. 
     
    Best,
    Torsten
     
    (defun note-rest-series (positions sequence &key (flat nil) (swallow nil) (section nil)) "This function is like the Opusmodus built-in length-rest-series, but supports arbitrary OMN expressions as input and additionally the arguments swallow and section. Args: - positions (list of ints): positions of notes to be turned into rests - sequence (list of lengths or OMN expression): music to process - flat (Boolean): whether positions count for sublists (nil) or the whole list (T) - swallow (Boolean): whether the pitches of notes turned into rests should be shifted to the next note or omitted (swallowed) - section (list of ints): positions of sublists to process. This argument is ignored if flat is T. Example: ;;; (setf melody '((s eb6 < leg f5 < leg c5 < leg f5 < leg) (e e6 f - -q))) ;;; (note-rest-series '(1 1) melody :swallow T :section '(0)) " (edit-omn :length sequence #'(lambda (ls) (length-rest-series positions ls)) :swallow swallow :section section :flat flat))  
  25. Like
    torstenanders reacted to opmo in DADA Quartet   
    Algorithmic avant garde jazz improvisation for tenor saxophone, piano, bass and drums.
    I thought it is time to add something new to our 'Made in Opusmodus' forum.
     
       
     
    Samples: VSL Ensemble Pro with Vienna Instruments Pro.
     
    If you like to study the score, here it is:
    DADA Quartet.opmo
×
×
  • Create New...

Important Information

Terms of Use Privacy Policy