Jump to content

Selecting start points in chop and create a line


Recommended Posts

Hi,

 

this is the input from a midi-in chop. 

 

midi-in.png

 

I would like to get only the starting points, where the midi-file changes notes.

 

midi2.png

 

And then create a line between these points, I guess that can be done with the add sop.

 

midi3.png

 

But how to select only the start points. A trigger chop would give me the right time, but not the value at that position.

Link to comment
Share on other sites

Checkout the function chops(opinputpath(".",0")). This should get you your starting value from there chop channel.

 

For instance, use a Shift node (in CHOPS context) and then place the expression -chops(opinputpath(".",0")) in the Start field. This will create a shifted chop whose start will always be at 0. Then you can use a Delete by pattern 0 (non-selected) to fetch that value.

 

chops gets you chop start.

chope gets you chop end.

Edited by Atom
Link to comment
Share on other sites

Thank you sadhu!

 

That definitely catches some of the points:

chopi.png

 

I can't say that I understand what it does though.

Now I'm readign that the chopi expression function evaluates a channel at a given sample point.

Ok, so the expression compares the points and if the y-value is higher than the one before it is kept, otherwise it is set to 0.

Changing the > to a < produces the remaining points.

 

How does one rewrite the expression so that it matches points bigger than or smaller than the 

point before?

 

Then I can probably just use a delete and delete all points of value 0.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...