< Back to IRCAM Forum

Using the word pulse for notes is confusing

It’s not just downbeats or upbeats that I want to select, also the position in the time signature, those who coincide with the numerator. Position order on pulses and for each one of them, subposition. What I want to do is have those position ordinal numbers to store them on variables, to classify notes.

In the same-bloodtype-p helper, should I remove both Lisp lmidic’s or replace them with something else?

For the cannibal helper, should I remove the Lisp ldur or replace it with something else?

I want to point out that unlike the post you mentioned, I use the voice object.

HI,

Maybe this is close to what you need ?:

Here is the patch:
ordinal.omp (18.6 KB)

Now it is up to you to tweak it!
Best
K

1 Like

I opened the file you attached to get information (and learn) of the elements you used. The voice-voices box is dead. The onsets and chords elements the info says they are loops, so I suppose they were renamed.
The onset of a voice is in miliseconds format. And maybe the values shown in the textbox are in ms, I don’t know.

What I need is simple numbers, of positions and subpositions. I need some function that counts beats, and assign them position numbers. After that, for each beat, count subpositions and assign them subposition numbers.

b pos

Hi

Which version of OM you are using? The voice->voices is a new function introduced since version 6.18. I advise you to use the latest 6.19. And sorry, an error slipped in the patch, Here is an updated one, with your positions/subpositions you need.

ordinal-1.omp (31.3 KB)

Best
K

1 Like

I don’t know how to cons up successive pulses in a situation of a quarter note on an upbeat.

cons up quarter

Open music ties the eight notes.The text on the next pic should read “The third note”.

cons up quarter tied

The output of tree2ratio is 1/4 1/8 1/4 1/8 1/4. How to cons up the second and third notes, making a sublist for that second beat, when the third note has half its value in the second beat, and the other on the third beat? Because (1/8 1/4) is more than a beat.

Also, I spent this week trying to learn this programming language and your algorithm with the patch you shared , eat adjacent chords and bloodbath. So if I learn that patch, I could change it for my needs.
I could do some sort or reverse engineering outputing the values of the boxes and functions to textfiles, so I could understand what is happening.
I couldn’t do that on the bloodbath patch and both internal helpers. I don’t know what data comes through the inputs. I suppose they are elements in a list (chord and lonset) but it wasn’t possible for me to follow the data flow, because inside bloodbath textfiles always output nil. I tried to initialize the eat adjacent chords lower chord seq box, and still couldn’t get data inside the bloodbath patch.
The most difficult part is the recursive one. Any advice on how to trace the data flow?

The situation of having a quarter note on an upbeat shows the need to differentiate the class time signature and on the other hand a class for the notes, chords, etc.

Some answers here:

What do you mean by cons? If you cons duration 2 and 3 you will end up with a doted quarter note.

Not particularly. OpenMusic can explicit exactly the rhtyhm you want, ie. quarter, eight quarter eight and quarter note (cf. patch enclosed).

Yes this is correct.

You just write this RT:

 (1 (((4 4) (2 1 2 1 2))))

And here is the patch:

ordinal-1 2.omp (12.5 KB)

For the other questions, i leave it up to Anders

Best
K

Thank you for the patch. This is a “get” positions and it works fine. Now I would need a “set” positions; that is, insert a note (of any duration) on a given position.
I find it hard to do because the RT input in a voice object expects a complete list of notes.
I need something like this:
At this position, insert a note with this rhythm value.


Set posi.omp (39.9 KB)

Dear archiduque,

I find that there is something wrong in your postulate, or i am not getting what you REALLY want to achieve.

For instance, if we take the second position proposal, The question is, how are we supposed to know that the second beat will be subdivided?

So, structurally speaking, we need to know what are you intending to do by “setting” rhythm positions? Let’s suppose that in the second beat you have two levels of subdivisions. This will complicate matters, meaning that we must project subdivisions in advance. So in my opinion, if you need to “construct” rhythms starting from indices of position, you should reconsider your strategy.

In order to give you some leads, can you please first tell us what you want to do at the end. We might already have some tools for this.

Best
K

It’s pretty much what I have said. Manipulate the rhythm in a melody. First, where the note will be placed. Then, what rhythm value will it have.

We will know when we put a rhythm value. It will be given, after the position is given. So I suppose it should be an algorithm like so: position + rhythm value.
And with that information there will be a RT to input in a voice object.

For example, insert any of these (1/4 1/8 1/2) on a certain position.

To clarify, the Positions and Subpositions loops shown in the image are from the ordinal-1 patch you provided, so it’s the same principle. You made two “Get” functions. What I’m after is the same but to “Set” positions and subpositions functions.

If i understand you well, you have a predefined onsets, and you want to position rhythm figures on these?

In your example, nothing shows at the start (first staff) the possibility to position an eight note on the 2 half beat. That’s why i am asking.

In general, it is good to start to define first on what basis you are working, then define afterwards the tools you need.

K

I don’t know if it’s correct to call them onsets(maybe onsets are measured in ms?) I call them ordinal numbers, given by the time signature. The format is exactly as your loops “Positions” and “Subpositions” inside the ordinal-1.omp file you uploaded in this thread. See the next picture for clarification.

In the example picture given before is missing any rhythm value (although I’ve written that duration will be supplied). It was just a broad approximation of what I’m after.

Position (& optional Subposition) + Rhythm value = RT?

Also, after first note insertion, don’t delete the note with new insertions.

So far I have this patch, but it’s not what I’m looking for, because the function subs-posn doesn’t differentiate between notes matching a beat and notes that are off-beat.

How SetPos.omp (21.4 KB)
pos to rtree.omp (7.1 KB)

Hi,

The core of the problem is that you don’t have sub-positions. It is up to you to deterime these.

However, you can still as i proposed, determine them in advance as:

Nevertheless, you will be confronted with duration problems if the substitution is not consistent with your first rhythm structure. (cf. figure).

I don’t know if it’s correct to call them onsets(maybe onsets are measured in ms?) I call them ordinal numbers,

You can call them whatever you like, this is up to you :slight_smile: Still as I advise you, you should reconsider what you want to do with this. Forget the naming business. The rhythm structure in OM, doesn’t know about beats/upbeats. It is agnostic. So you should figure out, depending on WHAT you want to do so you can implement some code to construct your rhythm structure. If you depend on patches done before, you are on the wrong and harsh road to solve your problem. Believe me.

Again my advice: First draft on paper your strategy if possible step by step. THEN you can think about HOW to implement it with the tools OM has to offer. It you will find that the solution is easier than you thought it was.

Best
K

pos to rtree1.omp (32.2 KB)

I know this patch is wrong, I know how many beats there are. I just upload it to get some help, to start somewhere. Forget about this patch:

What was succesfully done were your patches. Those steps are exactly what I need done in reverse. Your patches show beats, or positions and subpositions within the beats. You’ve done it.

So this is what I want to continue with:


It shows the order of appearence of (pulses/beats/positions call it anything you wish) (0 1 2 3) and Subpositions (nil (0 1) nil (0 1)) on that measure. This information is what I need. Those numbers.

What I pursue is already done, that is, GETTING those numbers from notes in a measure. It is possible it is proven. What I need now is to do the opposite, with numbers like those, PLUS a rhythm value (1/4 for example) is to SET notes in a measure.

I want to achieve what is shown in the following picture with the information provided: A number for the position (2) and a rhythm value (1/4)

ex

Regarding the naming business, I agree about being agnostic. Just counting the order of positions in a measure given a time signature is totally agnostic. You got what I’m after with the patch ordinal-1, I attach it below. I just need to do the opposite of what was done. Instead of getting in a measure, setting in a measure.
ordinal-1.omp (31.3 KB)

Hi again,

Unfortunately, you cannot set something that is non-existent. I explain myself: The patch ordinal-1 retrieves the offsets of existent objects in a VOICE. Changing them could lead to an inconsistency in this object. I understand you want to start from scratch with a default voice and build a rhythm. What i don’t get, is why you need to do so starting from a positions and subpositions. This you can do by simply building a rhythm tree. This is the way that OM Voices work. So either you build an RT using rhythm-trees, (which is of course the closest to what you want_ or use treeratios.

Best
K

Ok, is non-existent. I noticed that a class regarding positions regarding a time signature is a feature that doesn’t exist in Openmusic. But this post in the first place was an asking for guidance on how to achieve that. I think it is a feature that could be achieved via Lisp programming, knowing that Openmusic is based in that programming language and accepts new functions from Lisp.

The function that I need - to set (insert) a note in a certain position with a certain duration- is understandable, doable on paper or in any notation program, so programming such function I believe is totally possible.

I don’t know Lisp or CLOS, what resources do you recommend to study in order to create a class for setting a note?

One last thing. When I tried to reverse engineer patches that you and Anders provided, there were Lisp functions that showed no documentation neither in the Openmusic reference page nor CLOS glossary pages in the internet, like Inside or Onset, for example. Is there a comprehensive webpage for information on any Lisp function?

It is not correct to state that positions and time signatures are non-existent in OM. They are indeed existent. What seems to trouble you, is that it is not the way you consider them. Now of course you can do some programing to achieve your way to construct rhythms. It is doable in OM without problem, but with some time consuming coding. That is why I asked you first, what is the purpose for this, ie. what do you want to achieve here? Just mimic other typesetting programs? OM is not a typesetting program. The rhythm structures have their own consistency and changing them will break the code. And again you might consider building your own way in lisp to do so.

Now concerning the non-documented functions such as inside, onset, etc. these are not functions. They are access slots to the Score classes. Something very lispy. It is inside the code of OM.

At last, i advice you to open another thread with a significant and straight forward title. This thread’s title doesn’t point to your direct quest. Maybe you will have some better input than mine…

Best
K

1 Like

Hi again,

It is not exactly what you are looking for but this might help:

The problem lies in the chosen figures. ie, if you need to put a 1/2 note in an “ordinal number”, if this one say as it is the case in the example above, a 1/8th note, we should know if we Extend the duration. In this case we have to recompute (recursively) all durations coming after… Just a thought. (it can be done, but we should know what do you want to do next??)

Best
K
Patch 3.omp (9.9 KB)