flickering video synced to midi bang – beginner problems

    Jan 26 2022 | 9:08 am
    Hi everyone!
    I'm very new to max and even newer to jitter. I'd like to build a patch for synchronizing the flicker of a video to midi sound (a strobe with video if you'd like)
    The idea would be that a midi signal/bang would read one frame of a video for a certain time, then use a delay so that a black video is read instead -- until the next bang.
    I built a very simple protoype for this but switching btw videos seems to be an issue, and I don't see why. I think I'm stumbling on something very basic. Any idea?
    In a second stage -- I'd like to find a way to 'quantize' everyone's time values so that a frame of the video is read for 83.3333ms (one frame at 12fps) and black is read for this value by 1, 2, 3, etc. (I used slower values in the patch so it's easier to see what's going on.) A phasor seemed to be an interesting start for this because of the transport option?
    ps Also I can't seem to find the function here to attach a code. Sorry about this

    • Jan 26 2022 | 10:29 am
      Hey Johnny, you don't need to have a black video to have a black frame, you can just send a black texture into the rendering window. Infact, you don't even need the phasor. You can change the amount of time the black or the video play, by having more outlets for the "cycle" object. Also, you can directly set the framerate from jit.world. This should get you going:
      P.S. To copy a patch like this, just do cmd+a to select all, then edit->copy compressed, and then past it in your post.
    • Jan 26 2022 | 11:19 am
      Hi Federico! Many thanks for taking the time. I'm shocked by the simplicity of this! It looks like a much more elegant solution.
      Can I ask you another question? My idea with using an external bang to trigger the whole system was to be able to sync everything to a variable beat. So you would have 1 frame of video, then depending on the speed of the bangs 1 or 2 or 3 or n black frames (or, n millisconds of that black frame). I guess using your approach you could alternate between different cycles (1, 2 or 1, 2, 3), but then the speed of the video would not be synced. Where would advise to you look at to do this?
    • Jan 26 2022 | 11:31 am
      Just saw your Youtube channel! Fantastic job
    • Jan 26 2022 | 1:07 pm
      I've reworked my patch using some elements from Federico's. It... sort of works, although the frame #1 message seems to have mixed results, even using a very slow qmetro. Any suggestion would be greatly appreciated! cheers everyone
    • Jan 26 2022 | 9:07 pm
      Hey Johnny, my idea with the "cycle" allows you to choose how many frames of videos and how many frames of black you want. In this modified patch you can see how it works: 3 frames of video, 2 frames of black, 1 video, 1 black, and then loop I've fixed also a couple of things, like "frame_true" instead of "frame" and also @autostart 0 for the jit.movie, so will not continuosly play under the hood. Let me know if it works!
    • Jan 27 2022 | 11:26 am
      Hey Federico! Many, many thanks, this is absolutely brilliant. Even more flexible I thought was possible. This opens up a lot of possibilities for what I'm trying to do. Thanks a lot for your help! cheers