< Back to IRCAM Forum

Interval class vector patch

Is there a patch to do this in one of the libraries?

SOLVED, using the Forte list and a hash table. For those interested, attached are the Lisp functions and hash table, as well as a patch to test it. Please let me know if you encounter any issues.interval-vectors.lisp (27.6 KB)
ivt-query-test.opat (2.7 KB)

Hi! I think you can find some relevant tools in the MathTools library.
The OM# version of it is here: Release MathTools external package for oM# · cac-t-u-s/mathtools · GitHub

The help-patches include one example about interval vectors in mathtools/Groups/Dn/6-iv:

SOLVED, using the Forte list and a hash table. For those interested, attached are the Lisp functions and hash table, as well as a patch to test it. Please let me know if you encounter any issues.interval-vectors.lisp (27.6 KB)

Fantastic! Just what I’ve been looking for (my whole life! LOL). Thanks very much Jean.

Hi Das,

intervalvector2pcset is missing, can you send it to us, please ?

many thanks

best,

Jerome

sorry, it seems that it’s in interval-vector.lisp…

how can I make it work ? sorry again for that :slight_smile:

(defun intervalvector2pcset (ivt)
(gethash ivt interval-vector-table))

ivt-query-test.opat (3.5 KB)

Here you go – they work, but just a heads-up. In looking carefully at the Forte list I’ve noticed that there can be up to 4 sets with the same interval vector… so I’m going to revise these functions. Stay tuned.

excuse me but can you tell me how to use your code ?

THX

image

Opening document: /Users/lotus/Desktop/dossier sans titre/ivt-query-test.opat
[!!] :: unknown function: intervalvector2pcset
[!!] :: unknown function: hashkeylist

Please discard the lisp code and the patch example and use the attached, which now provide 1-4 sets for a given interval vector.

Re ‘how to use it’, the lisp code should be in a folder that you setup in the preferences under ‘General’ at the bottom of the page. When you see the (alarming! LOL) red in a patch, that indicates that the patch can’t be found. Where things are will almost certainly be different on your system and, to compound the issue, will be different on a Windows vs MacOS install. The ‘fix’ is to 1) place the patches in folders that make sense to you 2) make note of the name and then delete the internal patches that can’t be found, and then 3) using Finder or Windows Explorer, drag the (now deleted) internal patch into the one you’re working on.

Try the attached and see if it works for you. If not, let me know and we can figure it out.

Ooops, forgot the attachments.

ivt-query-test.opat (3.9 KB)

dasOMlibrary.lisp (19.4 KB)

thank you very much Das, it seems basic, when you understand how it works :slight_smile:

image

(Tip:) :point_up: try split (or list-elements in OM) to split out the elements of a list (equivalent to first second third fourthNth in a single box)

Thanks! I’ll give it a go.