Jump to content

Rangarajan

Members
  • Posts

    222
  • Joined

  • Last visited

Everything posted by Rangarajan

  1. Friends, Time for yet another blog post! This week I have described a technique that you can use to read a MIDI file and then transform the corresponding score. I personally think that Opusmodus could introduce many interesting functions for working with MIDI files, not just for transforming as explained in my blog, but also for analyzing the score. Hope you find this article interesting. Regards, Rangarajan
  2. What if wanted to do it from a function, not from the IDE? -Rangarajan
  3. Just now noticed that the function MIDI-TO-SCORE is not documented. -Rangarajan
  4. SB, Can you point me to a couple of library functions to read midi files and access its parts? -Rangarajan
  5. Great! How come you forgot the other wildcard operators '+' and '*' (just kidding!) Regards, Rangarajan
  6. Interesting. Looks like you have a small rule-engine in place! I have worked with LispWorks and they have a powerful ops5-like rule engine. Yes, this rule-based approach is desirable/suitable for certain classes of problems. Good luck! Regards, Rangarajan
  7. André, You are right, technically I suppose you can call what motif-map does as pattern matching. Often we use the term pattern matching when some wild card or other patterns are present (for example, regular expressions). Thanks for the code; I understand what you are trying to do. Quite interesting. Regards, Rangarajan
  8. Andre, It doesn't do pattern matching (to the extent I have tested), although that could be a useful scenario. Would you like to post some examples showing how such a feature can be used? Regards, Rangarajan
  9. Very useful function. I have a few questions: 1) Why is it called “motif-map” instead of, say, “sequence-map” or “substitute-sequence”, because what it does is to replace a part of a sequence with another. 2) I expected it to use the “best match” when replacing. In the following case (motif-map '(((0 1 2) (a b c)) ((0 1 2 3) (p q r))) '(0 1 2 3 4 5 6 7 8 9 10 11) :otherwise 'x) => (a b c x x x x x x x x x) I thought it would give (p q r x x x x x x x x x) because (0 1 2 3) is (arguably) a better match than (0 1 2). However, when I did this (motif-map '(((0 1 2 3) (a b c)) ((0 1 2) (p q r))) '(0 1 2 3 4 5 6 7 8 9 10 11) :otherwise 'x) it gave me => (a b c x x x x x x x x) That means it checks from left to right. So, technically, the longest sequence matching can be done by just re-arranging the given sequences in decreasing order of length. Does it make sense to use the “longest” sequence logic? I am not sure. 3) If there are many sequence pairs to work with, does the replacement occur at the top level, or iteratively? For example, in this case: (motif-map '(((0 1 2 3) (a b c)) ((a b c) (p q r)) ((p q) (m n o))) '(0 1 2 3 4 5 6 7 8 9 10 11) :otherwise 'x) I was pleasantly surprised to see this answer: => (m n o r x x x x x x x x) That shows it works on successive replaced result. I like this, but it may be a good idea to take an optional keyword to decide which of the 2 possible behaviors will be applied. In this example, if the replacement only worked at the top level, the result would be: => (a b c x x x x x x x x) Whatever is the behaviour, it is a good idea to document it. - Rangarajan
  10. In the file "Sextet - Pitch.opmo", I noticed that the function "pre-span" is used. However, I cannot find its documentation. Is it one of the "developer" functions to be documented in Ver 2.0? -Rangarajan
  11. Yeah, I guess it could be useful to others too. - Rangarajan
  12. Friends, In today's blog, I have talked about how to start with a simple motif and then incrementally apply different transformations on the motif to get interesting piece of music. As usual, I would appreciate your comments and feedback. Regards, Rangarajan
  13. Hi, Will you be adding documentation of the function substitute-motif in the next release? -Rangarajan
  14. Andre, Nice code, Thank you. I am looking for a function that works on a OMN, not just a list of lengths. Also, lengths can be represented in the format '(q q e e q s) instead of the corresponding numeric fractions. In such cases, the loop will not work (you can't multiply 'q by -1). Regards, Rangarajan
  15. I have a OMN. I want to replace one of the lengths with rest, randomly. Is there a function to do this? Suppose I have a list of lengths either in the form '(1/4 1/4 1/4 1/4) or '(q q q q), is it correct to replace one of the elements randomly with '- to mean rest? Regards, Rangarajan
  16. In continuation of the above reply, try to evaluate the following in your Listener: (and (print 1) (print 2) (print (+ (print 3) (print 4))) "Done") You should see this: 1 2 3 4 7 "Done" This shows left-to-right evaluation. More importantly, because of nested evaluation, 7 is printed only after 3 and 4 Regards, Rangarajan
  17. Hi Julio, In my understanding, the order of evaluation of forms is left to right. When we write Macros, we are expected to adhere to this convention. If there is a need to be different, it should be noted clearly. In your example, at the top level, "gen-repeat-seq" will be evaluated after "expl". Within "gen-repeat-seq", after evaluating its first 3 args, evaluation of "gen-eval" will start. Within that "randomize-octaves" takes place, and so on. In other words, "gen-eval"will finish only AFTER "randomize-octaves" finishes; "gen-repeat-seq" will complete only AFTER "gen-eval" completes. Hope this is clear? In some languages, this order is not guaranteed, for example in C++. Regards, Rangarajan
  18. Nice idea, thanks SB! I notice the function substitute-motif is not documented. Regards, Rangarajan
×
×
  • Create New...

Important Information

Terms of Use Privacy Policy