-
Posts
222 -
Joined
-
Last visited
Content Type
Forums
Events
Store
Video Gallery
Everything posted by Rangarajan
-
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
-
Use a database, or wrong thinking?
Rangarajan replied to Lance Massey's topic in Support & Troubleshooting
That would be very helpful, thanks. -Rangarajan- 10 replies
-
Use a database, or wrong thinking?
Rangarajan replied to Lance Massey's topic in Support & Troubleshooting
What if wanted to do it from a function, not from the IDE? -Rangarajan- 10 replies
-
Use a database, or wrong thinking?
Rangarajan replied to Lance Massey's topic in Support & Troubleshooting
Just now noticed that the function MIDI-TO-SCORE is not documented. -Rangarajan- 10 replies
-
Use a database, or wrong thinking?
Rangarajan replied to Lance Massey's topic in Support & Troubleshooting
SB, Can you point me to a couple of library functions to read midi files and access its parts? -Rangarajan- 10 replies
-
Doubt about motif-map function
Rangarajan replied to Rangarajan's topic in Support & Troubleshooting
Great! How come you forgot the other wildcard operators '+' and '*' (just kidding!) Regards, Rangarajan -
WOW, SB! -Rangarajan
-
Doubt about motif-map function
Rangarajan replied to Rangarajan's topic in Support & Troubleshooting
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 -
Doubt about motif-map function
Rangarajan replied to Rangarajan's topic in Support & Troubleshooting
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 -
Doubt about motif-map function
Rangarajan replied to Rangarajan's topic in Support & Troubleshooting
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 -
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
-
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
-
Yeah, I guess it could be useful to others too. - Rangarajan
-
Glad you like it. Thanks. -Rangarajan
-
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
-
How to replace length with rest?
Rangarajan replied to Rangarajan's topic in Support & Troubleshooting
Thanks. Definitely useful. -Rangarajan -
How to replace length with rest?
Rangarajan replied to Rangarajan's topic in Support & Troubleshooting
Thanks, Will check this function. -Rangarajan -
How to replace length with rest?
Rangarajan replied to Rangarajan's topic in Support & Troubleshooting
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 -
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
-
Order of evaluation and ratios
Rangarajan replied to julio d'escrivan's topic in Support & Troubleshooting
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 -
Order of evaluation and ratios
Rangarajan replied to julio d'escrivan's topic in Support & Troubleshooting
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 -
A useful addition! Thanks. -Rangarajan