Jump to content

torstenanders

Members
  • Posts

    489
  • Joined

  • Last visited

Everything posted by torstenanders

  1. > i'm musician but only an "amateur programmer" I think the most important part is the musical knowledge encoded, and that your definitions work as described. How that is implemented is secondary for its use for others. (Clean implementations can make a big difference, though, for the maintainability of your code.) > I have no idea how to do that professionally with GitHub I am pretty busy at this stage of the academic year, but in a few weeks, I would be happy to help you with that, if you want. What I cannot do, is documenting your definitions, but I can also show you, once you added some documentation in the form of doc strings added to your function etc. defs, how to automatically turn that into HTML docs. > as ORDINARY text - no problem. perhaps i will share it like that on my website... If such a straightforward approach makes you feel you are more in control, then why not? However, in your place, I would add some doc strings that explain what a function is supposed to do. That makes it also more easy for yourself to re-use these functions at some later time. Best, Torsten
  2. I agree that this is useful, and therefore I also implemented a similar functionality in my function rotate-omn You can find its documentation at https://tanders.github.io/tot/sources/form.html#_g229430 and download the whole library at https://github.com/tanders/tot. BTW: You meanwhile should also have quite a sizeable collection of custom functions for Opusmodus. While not sharing them together in some kind of library as well? Best, Torsten
  3. > the value of the number attached to the "glued side" is arbitrary No, it is not, it depends on the implementation of the random generator used. However, this is far from being intuitive to understand, and beyond that, for several functions, the seed controls multiple random generators, where basically the seed for their seed is then computed randomly. So, for practical uses, you can consider the choice of seed values random. Just for background, in a simple random number generator, the seed can be used in an integer division where the resulting random value is the modulus (see https://en.wikipedia.org/wiki/Lehmer_random_number_generator). So, there is no indexing... Best, Torsten
  4. Forget to mention: for better readable code you should indent your code appropriately, but again, the editor does that automatically for you. Just hit ENTER where you want to insert a line break and then press TAB, and the editor does then context-dependent indenting for you. Best, Torsten
  5. It seems that some attributes (e.g., the pause/fermata sign) can be assigned to rests, but not all. '(-q -q fermata -h) It might make sense that some attributes cannot be assigned to a rest, e.g., the following instead creates an additional note. '(-q -q stacc -h) However, I would agree that it would be useful to be able to assign user-defined attributes to rests. Best, Torsten
  6. > but ((((((( ))))))))) drives me nuts! Actually, the editor helps you there. Just place the cursor directly before an opening or after a closing parenthesis, and the matching parenthesis is shown. Now, I am probably biased after using Lisp for quite some time, but I actually appreciate this simple syntax. I also programmed in various other languages, and I meanwhile prefer the Lisp syntax... Best, Torsten
  7. > the random state number. Seed values are only relevant for functions that do some random operations. In layman's terms, think of rolling a dice. You want to ensure that the dice always rolls the same number, and for that purpose, you put some glue on one of its sides. The seed number effectively controls on which side of your dice you put the glue. It is not the same as the number that is the result, but controls which number will be the result. Now think of having some more complex algorithm than just a dice, where you have a similar mechanism to control what the output should be and that way fixing the output to a static value that can be re-computed multiple times.
  8. EQUALP is part of the Common Lisp standard. You can find its documentation at http://www.lispworks.com/documentation/HyperSpec/Body/f_equalp.htm Note that Common Lisp has a whole zoo of equality comparison functions, see eq, eql, equal, =, string=, string-equal, char=, char-equal in that documentation. Best, Torsten
  9. I have not tried to send pitch bend messages via Opusmodus' :controllers output yet, but I remember the following from the MIDI standard. Pitch bend messages are not CC messages. This is partly, because the pitch bend range is not only 7 bit (128 values) like CC messages, but instead 14 bit (16,384 values). What those pitch bend values actually mean depends on the pitch bend range set in your sound generator. You might want to check some seminal reference on this subject, like https://books.google.co.uk/books?id=ajDaXh-qgDUC&printsec=frontcover&redir_esc=y#v=onepage&q&f=false Someone else (Janusz?) would need to respond how to send actual pitch bend messages from within Opusmodus. I can't say whether controller actually supports that, but you cannot send pitchbend messages by sending certain CC messages, these are different things with different formats in the MIDI standard. Best, Torsten
  10. > all your hard work to document I actually do such detailed documentation for my own benefit as well. I once spent several months on developing some personal library that I used for composing some piece, but when I wanted to re-use it some two years later, I could not really understand my own functions anymore. Since then I better err on the side of overdoing the docs Best, Torsten
  11. > I got just four 16th notes. This function allows for various controls that you did not use – Of course this function also allows for plain sequences of 1/16-notes, when you select its arguments accordingly I am interested in CAC as a means of control on a higher level instead of some automatic "magic". You might want to run the examples below in Opusmodus to get music notation outputs, which are likely more easy to read than the OMN expressions, but nevertheless I provide the OMN expressions for completeness as well. The argument position (3rd argument) controls the kind of rhythmic cell that you get, see the doc for details. Here is an example where different rhythmic cells are returned. Note that by default all returned cells carry potentially a durational accent. (gen-karnatic-cell 4 4 '(0 4 3 2 1 0)) => ((1/4) (1/16 1/16 1/16 1/16) (1/8 1/16 1/16) (1/8 1/8) (3/16 1/16) (1/4)) Now, if you use the same positions but different gati or jathi settings then you get a somewhat similar rhythm in that different gati/jathi. Below I slightly adapted the positions to make the results even more similar. (gen-karnatic-cell 4 5 '(0 6 3 2 1 0)) => ((5/16) (1/16 1/16 1/16 1/16 1/16) (3/16 1/16 1/16) (3/16 1/8) (1/4 1/16) (5/16)) You can, of course, use these in a different time signature (e.g., the tala of your choice). (omn-to-time-signature (gen-karnatic-cell 4 5 '(0 6 3 2 1 0)) '(4 4)) => ((q c4 tie s s s s s s e. s s s tie) (e c4 c4 q s q tie s)) If you want to keep track of where the accents are located, you could mark them before this transformation (the function articulate-phrase is defined below this post). You could then manually later revise the notation to instead you the beam-breaking that Reina recommends. (omn-to-time-signature (articulate-phrase (gen-karnatic-cell 4 5 '(0 6 3 2 1 0)) :accent 'marc) '(4 4)) => ((q c4 tie+marc s marc s marc s s s s e. marc s s s tie+marc) (e c4 c4 q marc s q tie+marc s marc)) After the changed jathi above, here is a different gati. Results are more similar, because the underlying data is the same with different gati but the same jathi. Here is an example with quintuplets. (gen-karnatic-cell 5 4 '(0 4 3 2 1 0)) => ((1/5) (1/20 1/20 1/20 1/20) (1/10 1/20 1/20) (1/10 1/10) (3/20 1/20) (1/5)) Here is the same with triplets -- exactly the same, only slower. (gen-karnatic-cell 3 4 '(0 4 3 2 1 0)) => ((1/3) (1/12 1/12 1/12 1/12) (1/6 1/12 1/12) (1/6 1/6) (1/4 1/12) (1/3)) You can also change the jathi (or even gati) on the fly in a phrase. The given pattern is then 'cycled through'. (gen-karnatic-cell 4 '(5 5 3 3) '(0 6 3 2 1 0)) => ((5/16) (1/16 1/16 1/16 1/16 1/16) (1/16 1/16 1/16) (1/16 1/16 1/16) (1/4 1/16) (5/16)) You can also randomise your position (gen-karnatic-cell 4 5 '(0 1 ? ? 0)) => ((5/16) (1/4 1/16) (3/16 1/8) (3/16 1/16 1/16) (5/16)) And I did not even start discussing the other parameters yet. For example, you can set whether or not cells start with a durational accent (not a karnatic concept, but very useful notion for Western ears when dealing with rhythm). (gen-karnatic-cell 4 5 '(3 3 3 3) :accented? '(T nil nil T)) => ((3/16 1/16 1/16) (1/16 3/16 1/16) (1/16 3/16 1/16) (3/16 1/16 1/16)) You can filter in various ways want kind of rhythm you want, e.g., set the minimum or maximum number of notes per cell. (gen-karnatic-cell 4 5 '(? ? ? ?) :min-number '(3 3 3 3) :seed 1) =>((1/8 1/8 1/16) (3/16 1/16 1/16) (1/16 1/16 1/16 1/16 1/16) (1/8 1/8 1/16)) EDIT: Oops, that are is seemingly not fully working as expected. I stop here and refer you do the documentation for more details: there are several more arguments that I did not even mention yet. I know that my documentation is rather concise and not a textbook, but it briefly discusses every detail. I said from the beginning, I wrote this for myself, so you might want to first spend a bit of time with the doc As you hopefully can see, this function alone allows for a rather rich world of rhythm with rather precise control that allows varying some rhythmic idea in various ways. I am interested here in clearly perceivable rhythmic similarities, e.g., between rhythms in different gati and jathi combinations in the Western tradition of thematic variation. Of course, you can also process the result further in various ways. E.g., I am adding ties after long notes and/or subdivide short notes to increase the rhythmic contrast, and I am turning certain notes into rests... Best, Torsten (defun articulate-phrase (sequence &key (accent 'marc)) "Add articulations to phrase for more clear rhythmic accents, e.g, an accent on every first beat. NOTE: This function assumes that `sequence' is a purely rhythmic OMN expression with only length values and perhaps ties. However, a sequence with (constant) pitches is returned, because certain Opusmodus functions do not support an OMN sequence without pitches. Examples: (articulate-phrase '((h h) (q q q q tie) (q q q q) (-q q) (q q q q)) :accent 'marc) => ((h marc h) (q marc q q q tie) (q q q q) (-q q) (q marc q q q)) " (cons ;; First bar ;;; NOTE: code repetition... (let ((bar1 (first sequence))) (if (length-notep (first bar1)) (if (and (= (count-notes bar1) 1) (eql (first (last bar1)) 'tie)) (tu:replace-element (merge-articulations (list accent 'tie)) 1 bar1) (tu:insert-after bar1 0 accent)) bar1)) ;; other bars (loop :for (bar1 bar2) :on sequence :while bar2 ;;; NOTE: code repetition :collect (if (and (length-notep (first bar2)) (not (eql (first (last bar1)) 'tie))) (if (and (= (count-notes bar2) 1) (eql (first (last bar2)) 'tie)) (tu:replace-element (merge-articulations (list accent 'tie)) 1 bar2) (tu:insert-after bar2 0 accent)) bar2))))
  12. > I like the Carnatic Stuff. To best understand what those functions offer I recommend the book referenced in the doc (Reina, 2016), which was quite an eye-opener for me. There is a partial preview at Google Books (https://books.google.co.uk/books?id=4RSrCwAAQBAJ&printsec=frontcover#v=onepage&q&f=false), and further information is available at the associated websites (http://www.contemporary-music-through-non-western-techniques.com and http://www.rafaelreina.org/book-online-material.html). Best, Torsten References Reina, R. (2016) Applying Karnatic Rhythmical Techniques to Western Music. Routledge. added 8 minutes later I just noticed the perhaps most important Karnatic function so far, gen-karnatic-cell, is not contained in the automatically generated documentation, because the documentation tool seemingly skips functions that are not defined at the top level. I may fix that at some stage, but for now you can read the documentation in the doc string of the function in its source file (rhythm.lisp), or you evaluate the following line and read it in the listener. (documentation 'gen-karnatic-cell 'function) Best, Torsten
  13. Good to hear things are working for you Note that dependencies of this library are of interest on their own for computer-aided composition. This is particularly true for the constraint library cluster engine and its extension cluster rules, as well as the library fenv. Torsten
  14. Actually, these are warnings and not errors. They point out various issues in the code that could be improved (in particular in the library cluster engine, as you may have noticed), but the code should still work overall. Also, you should see these compilation and warning messages only once (if you never change the code of the relevant library). Just try to go on and actually run some examples of these libraries. Please let me know if you run into an actual error message. (There are some minor bugs of course, but at least for my tot library I try to make them explicit in the documentation as well.) Best, Torsten
  15. Dear Julio, As the link you copied said, "ASDF is the de facto standard build facility for Common Lisp." In other words, it is the standard software for organising, compiling, loading etc. Common Lisp programs that consist of more than just one file. I think it is already built into CCL, the compiler used by Opusmodus. Have you tried after the installation to simply run the given Common Lisp command to load the library? (require :tot) > When I update to next Opusmodus release, do I have to reinstall it ? Not if you follow the installation instructions and install it in ~/common-lisp/. Best, Torsten
  16. Dear all, I updated my library tot (https://github.com/tanders/tot) in various ways. In particular, there are many new functions available. You can now read the documentation online at https://tanders.github.io/tot/. However, remember that you can directly evaluate the many examples in the documentation when (after installing the library) you drag the library folder into your Opusmodus project navigator and open the documentation within Opusmodus. If you are interested in the details of how the library developed, you can see a changelog at https://github.com/tanders/tot/commits/master . NOTE: When you install/upgrade this library, make sure you also install/upgrade all its dependencies, as described in the detailed installation instructions at https://github.com/tanders/tot. Best, Torsten PS: This is not an official release. As I am primarily developing this library for my own purposes, I keep it rather informal and extend it on a continuous basis for my own composition projects. Anyway, I thought at least some of you might be interested to learn that there have been many developments
  17. For sound synthesis purposes (e.g., for an expressive performance), we may want to use note lengths beyond the restricted set of quantised note durations. However, Opusmodus currently prevents various irregular note duration sequences to be auditioned and throws an error instead. What is really interesting, though, is that the notation for such irregular durations still seem to work. It might make sense the other way round (i.e. refusing to notate certain rhythms -- though I am definitely not voting for introducing that :), but I don't see any real reason why arbitrary rhythms may not be auditioned. As an example, below is a short example of some arbitrary non-regular rhythm. Opusmodus can notate this rhythm, but when trying to play it back it throws an error. '((1/10 1/11 1/12 1/13)) Thanks! Best, Torsten
  18. It is handy that Opusmodus can display multiple score snippets and full scores alongside each other. Is there perhaps also a way to re-play some snippet still shown? Either with some GUI element that I may have missed or programmatically (they all have a unique name shown, like "UNTITLED 101 (Snippet)").? There is a function audition-musicxml-last-score, is there perhaps a function to again audition a score that is specified by its name? Thanks! Best, Torsten
  19. Great. How do we document such features so that there is an obvious place for them for new users? Best, Torsten
  20. Dear Achim, From your error message at the end (There is no package named "PW" ) it looks like you did not follow the installation instructions, which you can find at https://github.com/tanders/cluster-engine In a nutshell, you should load it with ASDF and for that put it at a location where ASDF can find it. Instead, when you are putting it into ~/Opusmodus/Extensions/ then files are loaded in a wrong order. Best, Torsten
  21. I just got a copy of EW ComposerCloud and had a look at this. Wow -- this setup is a true monster, and way too much for my poor mere 8GB laptop (with unfortunately no way to extend the memory). I can confirm that in principle your setup works on my computer (Opusmodus can control sound playback of the instruments), but even when I reduce the bidule-file to only the string section, my machine has difficulties handling it. Sigh. How much memory are you using? I wish Play would have a purge feature similar to Kontakt, where you can basically start with an empty patch, and all samples needed are by and by loaded. (Play has some purge functionality, but it is more limited, only useful when the score is already fixed, which is not terribly useful in an environment like Opumodus). (I would probably need a second computer and something like Vienna Ensemble Pro to handle a full orchestra, in particular as I would be interested in using multiple articulations...) In your setup, you are running a separate Play instance for each instrument, and then you load several articulations per instrument into that Play instance, each on a different MIDI channel. I don't quite understand how this should work, as each instrument is controlled by only a single MIDI channel. Best, Torsten
  22. I assume internally of tonality-map there is a comparison of pitch classes (modulus 12 of pitches) deduced from the input "raw" music with the input pitch classes of the underlying harmony/spectra (called tonalities here). All that would be needed technically is to instead allow for a comparison among pitches or MIDI note numbers instead (i.e. skipping the modulus 12 calculation). This behaviour could be the default or controlled with a keyword argument to tonality-map. Best, Torsten
  23. Simply slightly edit the algorithms below by inserting some additional output. Below I simply took one of the algorithms you linked and added a single print statement. If instead you want to collect all the results, then just accumulate them in some variable with a scope surrounding your algorithm function. (defun bubble-sort/naive (sequence) (let ((end (length sequence))) (labels ((compare-and-swap (index modified) ;; print intermediate results (print sequence) (if (= index (1- end)) (if modified (compare-and-swap 0 nil) (values)) (let ((index+1 (1+ index))) (if (> (elt sequence index) (elt sequence index+1)) (let ((x (elt sequence index))) (setf (elt sequence index) (elt sequence index+1) (elt sequence index+1) x) (compare-and-swap index+1 t)) (compare-and-swap index+1 modified)))))) (unless (< end 2) (compare-and-swap 0 nil)) sequence))) (bubble-sort/naive '(3 1 9 5 3 6 4 2 3 7)) Best, Torsten
  24. Nice. You might like the graphical explanation of search algorithms and other algorithms at https://idea-instructions.com. They are visualising such algorithms basically following an IKAE style of graphics. Best, Torsten
×
×
  • Create New...

Important Information

Terms of Use Privacy Policy