renklint Posted March 19, 2015 Share Posted March 19, 2015 Hi, this is the input from a midi-in chop. I would like to get only the starting points, where the midi-file changes notes. And then create a line between these points, I guess that can be done with the add sop. But how to select only the start points. A trigger chop would give me the right time, but not the value at that position. Quote Link to comment Share on other sites More sharing options...
Atom Posted March 19, 2015 Share Posted March 19, 2015 (edited) 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 March 19, 2015 by Atom Quote Link to comment Share on other sites More sharing options...
renklint Posted March 23, 2015 Author Share Posted March 23, 2015 Thank you Atom. I'm doing something wrong, because everything but the first point gets deleted. test_opinputpath.hipnc Point the midi-in chop to this file: https://www.dropbox.com/s/vftlfa0vdwnx4v4/skala.mid?dl=0 Quote Link to comment Share on other sites More sharing options...
sadhu Posted March 23, 2015 Share Posted March 23, 2015 try this if (chopi("../math1/ty",$I)>chopi("../math1/ty",$I-1),$V,0) in expression/expression1 chop. Quote Link to comment Share on other sites More sharing options...
renklint Posted March 23, 2015 Author Share Posted March 23, 2015 Thank you sadhu! That definitely catches some of the points: 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. Quote Link to comment Share on other sites More sharing options...
renklint Posted March 23, 2015 Author Share Posted March 23, 2015 Found it. if (chopi("../math1/ty",$I)!=chopi("../math1/ty",$I-1),$V,0) Thanks again. Quote Link to comment Share on other sites More sharing options...
sadhu Posted March 23, 2015 Share Posted March 23, 2015 ohh.. I didn't realize that its not selecting all the desired points. Good ! You got it working. Quote Link to comment Share on other sites More sharing options...
renklint Posted March 23, 2015 Author Share Posted March 23, 2015 Just have to figure out how to include the very first point... Quote Link to comment Share on other sites More sharing options...
sadhu Posted March 23, 2015 Share Posted March 23, 2015 if($I==0,$V,if (chopi("../math1/ty",$I)!=chopi("../math1/ty",$I-1),$V,0)) Quote Link to comment Share on other sites More sharing options...
renklint Posted March 23, 2015 Author Share Posted March 23, 2015 Thank you! So there's no else if in Houdini, good to know. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.