Jesper Rahlff Posted November 7, 2018 Share Posted November 7, 2018 (edited) hey guys. simple question which I do not hold the answer to. I have a switch and I want it to switch input number every 50th frame going between 0 and 1. so example would be that for the first 50 frames the active switch value is 0 and then on frame 51 it goes to 1, hold that for 50 frames and then turns back to 0. I need this to be a procedural expression if possible rather than key framing it. Thanks Edited November 16, 2018 by Jesper Rahlff Quote Link to comment Share on other sites More sharing options...
3dome Posted November 7, 2018 Share Posted November 7, 2018 (edited) this expression does it (floor(($F+50)/50)%50)%2 but I'm sure there is an easier one. I even remember a thread here on odforce where I posted the solution but it was a long time ago and I can't find it anymore.. EDIT: found it! In your case it would be $F%100<50 So we can say that if you need to turn something on (= 1) every n frames for a certain duration (num_frames_turned_on) the general form is $F % ( every_n_frames + num_frames_turned_on ) < num_frames_turned_on Edited November 7, 2018 by 3dome found it! 2 1 Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted November 7, 2018 Share Posted November 7, 2018 just messing around, also found this to work: floor(fit($F % 101,0,101,0,2)) Quote Link to comment Share on other sites More sharing options...
Jesper Rahlff Posted November 7, 2018 Author Share Posted November 7, 2018 fantastic man. Thanks for the nice explanation. Quote Link to comment Share on other sites More sharing options...
papsphilip Posted February 8, 2022 Share Posted February 8, 2022 old thread but really helpful. i want to do the same but with a small difference. when i want to change from 0 to 1 i would like the change to be smooth 0000 0.25 0.5 0.75 1111 0.75 0.5 0.25 0000 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.