< Back to IRCAM Forum

Tessitura

Hello everyone,

I’m trying to build a patch that adapts any list of MIDIcs to a certain register (a min and a max MIDIcs value) through octave correspondence. In this case in particular I want to adapt a list of MIDIcs to a basson’s register, wich would be from 3400 to 7700 aprox. So I did it with two OMloops, the first one testing all the values from a list (listloop) and summing 1200 to values smaller than 3400. Then a second OMloop with a OMif testing values higher then 7700 and subtracting 1200. That is exactly where I have to improve my patch. I could altered the values but some of those values kept being smaller or grater then the register I need it. So I need a function that keeps adding or subtracting 1200 until this number is comprised between 3400 and 7700. I tried using and but I can’t figure out how to connect them to a OMif! There are only a few examples in OM tutorials and none of them presented the solution. Does someone have the answer to this?

Thanks!

Have you tried ‘Range-approx’ from the Profile library? I don’t know if it would keep the octave correspondance you have in mind, but it should certainly keep everything within the range you specifies…

Hello,

I have been doing such things, using lists of possible notes on an instrument and a filtering function.

In the OMRuben library I included a lisp function doing this:

‘my-instrument-multiseq’ selects notes suitable for an instrument, and deletes notes outside the range. In the library menu you will find examples of instrumental ranges. These simply output a list of midicent, which could also be irregular intervals or microtonal tunings.

The function ‘r-wrap-to-range’ is closer to what you suggest, as it does not remove notes. Inputs are:

  1. Midicents 2. (min max-midicent) 3. Wrapping interval (ex. 1200) 4. Number of wrapping intervals (number of octaves).

It’s all in lisp though.

Best
Ruben

Hi,

I hope I understand well your question.
If you want to scale a list of values, “om-scale” is your friend.
Watch the picture below.
Otherwise functions “filtre1”, “filtre2”, “zoom1” and “zoom2” in the library OMAlea might do the trick.

Cordialement.

om-scale.png

Interestingly enough, after a quick test comparing Profile’s Range-approx and Ruben’s r-wrap-to-range (wrapping interval 1200, number of octaves 1), the results show a strange behaviour from the former (see image): even when range-approx is set to include the bounds (here the high ‘F’ bound is concerned), the first utterance of this pitch is at the right place (was already there in the original-seq) but the second one is placed an octave too low (whereas it should have been transposed on the ‘included limit’ value).

Conversely, the operation works perfectly well in Ruben’s version, and the tool is way more flexible, indeed. It’s also good to know that the two tools return the same result if the chosen bounds are not part of the original seq (tried with 7800, instead of 7700)…

quicktest.png

Hy again, everyone!

Thank you very much, Ruben and Jimmie, that was exactly what I need it! Both of these functions works fine!! Ruben, unfortunately I don’t “speak” LISP (yet!)… and I still am very curious on how could I solve my problem in my patch (that’s the only way to improve on programming, wright?). I’m stuck in trying to get a number from a list and add 1200 n times until it has a value that is, at the same time, bigger than 3400 and smaller than 7700 i.e. How would you do that?

Jimmie, Ruben and Jean, thank you very much shearing your knowledge with me!

Best wishes,

Alex

You might look at some things in MATH-TOOLS library, which I believe is built-in.

I have a patch where a pitch in Midicents (but it could be a pitch, a chord, a chord-seq, etc.), (the first output of the chord object) is fed into the function “chord2c” in Functions / MATH-TOOLS / Circle.

The output of this is an N-CERCLE object, so feed it into a Classes / MATH-TOOLS / N-CERCLE

The 3rd output of this is the pitch-class (0-11) (or list of pitch-classes, or list of lists).

One you’ve got Pitch-Classes, you can do things like add random amounts to them, add multiples of 12 to get them into various octaves. Then add a base number and multiple by 100 to get Midicents in the end.

All of this can be done with built-in objects/functions, no knowledge of LISP needed, and no need to use OMLOOP, or even REPEAT-N. (Because most of the built-in objects in OM can operate on lists or lists of lists).

I attach an example patch, which takes an input midicent, and turns it into 2 random keyboard octaves (one for each hand on the piano).

—Chris Bailey

Screen-Shot-2016-01-23-at-6.42.50-PM.png

Cheers everyone,

Kantorowicz, I’ve attached a patch which does what you are asking for, using only native OM functions and libraries.

Hope this helps.

All the best,
António

snap-2-range.omp (19.4 KB)

And I happen to have an old patch version of the wrapping function, so there are many alternatives.

Best,
Ruben

wrap2range.omp (13.2 KB)