![]() Int minutes = ((framenumber \ frRound) \ 60) % 60 Int seconds = (framenumber \ frRound) % 60 ![]() Jean-Baptiste Mardelle correctly pointed out that m should be compared to dropFrames.įramenumber = framenumber + (dropFrames * 9 * d) + dropFrames * ((m - dropFrames) \ framesPerMinute) įramenumber = framenumber + dropFrames * 9 * d While (framenumber 1, which only worked for 29.97. But since % for negative numbers varies by language, we'll do it manually In some languages, a % operation will work here Int framesPerMinute = (round(framerate) * 60) - dropFrames //Number of frames per minute is the round of the framerate * 60 minus the number of dropped frames Int framesPer10Minutes = round(framerate * 60 * 10) //Number of frames per ten minutes Int framesPer24Hours = framesPerHour * 24 //Number of frames in a day - timecode rolls over after 24 hours Int framesPerHour = round(framerate * 60 * 60) //Number of frames in an hour 066666) //Number of frames to drop on the minute marks is the nearest integer to 6% of the framerate Framerate should be 29.97 or 59.94, otherwise the calculations will be off. Given an int called framenumber and a double called framerate Code by David Heidelberger, adapted from Andrew Duncan ![]() Again, we’re not going to worry about those distinctions here.Ĭopy to Clipboard //CONVERT A FRAME NUMBER TO DROP FRAME TIMECODE As with integer division, modulo behaviors vary among programming languages when negative numbers are involved. Most languages use the same % notation for modulo. 30 / 7 is 4 with a remainder of 2, so 30 % 7 would be 2. Modulo refers to the remainder that’s left after division.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |