crispr_boi 5 Posted March 23 I wanted to ask for advice on combining two setups. One is using spectrum chop to displace the points of a line along P.y independently. The other one is a RBD bullet sim. A POP Wind is moving the fractured pieces of a box away from their original position. Using a time shift the sim's progression can be offset along the z axis and the offset is controlled by a chramp. Now I want the data from the the spectrum sop to instead of displace the points along P.y fit the amplitude from 0 to 1 and remap (?) it to the frame range of the pre-calculated sim, currently frame 1 to 50. I sorted the the simulation points along the z axis and would like to use the audio spectrum to drive their time offset, instead of the P.y. Need to figure out the maximum amplitude of the spectrum chop and fit it to the last frame of the sim? Attached is the .hip containing both setups and an audio file (royalty free track used by the tutorial creator of: Houdini CHOP Talk 3 Audio Processing 1 - Audio Spectrum https://www.youtube.com/watch?v=J754SLvE7BQ) The audio doesn't matter, I just wanted to provide anything.Downfall.wav The line's points are evenly spaced, but the bullet sim points obviously aren't, so I would like that to remain unchanged.. retimed_sim_1.mp4 retime_sim_with_chops.hiplc Downfall.wav Share this post Link to post Share on other sites
crispr_boi 5 Posted April 1 @konstantin magnus do you maybe have an idea Konstantin? Share this post Link to post Share on other sites
Alain2131 44 Posted April 2 (edited) Hi Kilian, If I understand correctly, you want to "apply" the simulation where there are peaks in the curve, correct ? You already have a line with the correct animation applied to it. Doesn't that look like a ramp already ?.. What I would do is sample directly from the line instead of using chramp. (This code requires the "channel_audio_import" node to be the third input of your wrangle) float end = 50.0; float frame = (@Frame + v@P.z*10) % end ; float pos = fit(frame , 1, end, 0.0, 1.0); pos = chramp("AnimCurve", pos); // These two lines are the only difference float sample = 1 - relbbox(0, @P).z; // You can visualize this with "v@Cd = sample;". A 0 to 1 value in the relative bounding box. pos = primuv(2, "audio", 0, set(sample, 0, 0)); // Sample the audio attribute of the line based on sample v@P = primuv(1, "P", @ptnum, set(pos, 0, 0)); [...] // rest of the code is untouched Now, the result might not be what you expected. This clamps when "audio" is higher than 1, so you might want to do some post-process on the audio. retime_sim_with_chops.hipnc Hopefully that's what you want ! P.S. I found that reducing the amount of points in the line yields a better result, you might want to try that (50 points instead of 498). Try it to see if you like that. Edited April 2 by Alain2131 2 1 Share this post Link to post Share on other sites
crispr_boi 5 Posted April 3 16 hours ago, Alain2131 said: Hi Kilian, If I understand correctly, you want to "apply" the simulation where there are peaks in the curve, correct ? You already have a line with the correct animation applied to it. Doesn't that look like a ramp already ?.. What I would do is sample directly from the line instead of using chramp. (This code requires the "channel_audio_import" node to be the third input of your wrangle) float end = 50.0; float frame = (@Frame + v@P.z*10) % end ; float pos = fit(frame , 1, end, 0.0, 1.0); pos = chramp("AnimCurve", pos); // These two lines are the only difference float sample = 1 - relbbox(0, @P).z; // You can visualize this with "v@Cd = sample;". A 0 to 1 value in the relative bounding box. pos = primuv(2, "audio", 0, set(sample, 0, 0)); // Sample the audio attribute of the line based on sample v@P = primuv(1, "P", @ptnum, set(pos, 0, 0)); [...] // rest of the code is untouched Now, the result might not be what you expected. This clamps when "audio" is higher than 1, so you might want to do some post-process on the audio. retime_sim_with_chops.hipnc Hopefully that's what you want ! P.S. I found that reducing the amount of points in the line yields a better result, you might want to try that (50 points instead of 498). Try it to see if you like that. Awesome! Thank you so much! This looks exactly like the what I wanted to achieve. <3 1 Share this post Link to post Share on other sites
crispr_boi 5 Posted April 3 In my opinion it looks better with a lot of pieces. Something like 350 scatter points in the fracture, but no secondary fracture and especially no chipping. I love it, thank you very much. Share this post Link to post Share on other sites
crispr_boi 5 Posted April 3 I also turned up the amplitude of the popwind in theRBDbulletsolver, to make the pieces travel a larger distance. 1 Share this post Link to post Share on other sites
Alain2131 44 Posted April 3 4 hours ago, crispr_boi said: In my opinion it looks better with a lot of pieces. Something like 350 scatter points in the fracture, but no secondary fracture and especially no chipping. I meant the points in the line, not the fracture. I'm glad this is working out for you though ! Share this post Link to post Share on other sites