Group Admins

  • Profile picture of Karim
  • Profile picture of Jean

OpenMusic

Public Group active 9 hours, 24 minutes ago

User group for OpenMusic and computer-aided composition. Visit the Forum for discussions.

Counting Element Occurrences

Author 3 Subscribed Users |
Profile photo of msytsm00
msytsm00

Hi,

I’m very new to Open Music, having begun using it after becoming proficient in Pure Data. I know this probably has a very simple solution, but I’m trying to take a list of midicent values generated from partial tracking into a chord sequence and see how many times each midicent value occurs/probability of a midicent value. I know how to get Open Music to count all of the elements, but I don’t know how to get it to return a list of the occurrences of each separate value.

Thanks in advance.

March 15, 2018 at 14:59 #25909
Profile photo of Karim
Karim

Hi MSYTSMOO

here is a patch with an example of random numbers. (for chord-seqm juste flatten your lmidic list using ‘flat’ ),
it outputs a sorted list of list with ((elmt times-of-occurence) …)

Hope this will helps.

best
K

March 15, 2018 at 16:20 #25911
Profile photo of msytsm00
msytsm00

Thanks Karim,

It’s a great starting point. Either my sample size is too large or I’ve done something wrong because I’m getting a lot of long error messages containing lots of numbers, but I think I can figure the rest of what I need out based on what you’ve posted.

JS

March 16, 2018 at 03:23 #25914
Profile photo of rc
rc

Hi,

Here’s another way. You can switch the “times” and “elements” connections of [list] according to your needs.
Does it work with your chord-seq?

Best,
RC

Attachments:
  1. Screenshot

    Screenshot.png

  2. Screenshot

    Screenshot.png

March 16, 2018 at 11:55 #25915

You must be logged in to reply to this topic.

Log in now