Using AppleScript to clip video to music beats in FCPX

Details

—————————————————————————-
VIDEO RELATED STUFF
—————————————————————————-
If you use FCPX to edit video, this might be of interest to you. It is a simple AppleScript to cut video based on the song you are using. Just cut the code below to use along with this demonstration.

Song: Fed Up by Bazanji – no copyright music on Soundcloud

— —————————————————————————-
— USE THE APPLESCRIPT CODE BELOW
— —————————————————————————-
— TAT FCP Beat Cuts – Demo video: https://youtu.be/mODhkLDfWH8
— 2017 Applescript by TomAndToys – http://youtube.com/c/tomandtoys
— Instagram: @tomandtoys

— Edit the four variables below (framesBetweenBeats, secondsToCutOut, numberOfCuts and frameRateOfProject). Make sure that Final Cut X is open and your clip is selected. Position the play head at the point you would like the script to start (most likely the first beat).

— EDIT framesBetweenBeats to the music you are using – full bar, half bar, quarter bar or whatever
set framesBetweenBeats to 20

— EDIT secondsToCutOut to how many seconds you wish to trim between cuts
set secondsToCutOut to 25

— EDIT numberOfCuts to how many times you would like this to cut in total
set numberOfCuts to 10

— EDIT frameRateOfProject to the frame rate of your FCP project
set frameRateOfProject to 24

— do not alter the variables below
set cutCount to secondsToCutOut * frameRateOfProject
set newNumberOfCuts to numberOfCuts – 1

tell application “Final Cut Pro”
activate
end tell
delay 5
tell application “System Events”
tell process “Final Cut Pro”
— Initial cut
keystroke “b” using {command down}
repeat cutCount times
keystroke (ASCII character 29)
end repeat
keystroke “[” using {option down}
— End Initial Cut – Do the remainter below
repeat newNumberOfCuts times
repeat framesBetweenBeats times
keystroke (ASCII character 29)
end repeat
keystroke “b” using {command down}
repeat cutCount times
keystroke (ASCII character 29)
end repeat
keystroke “[” using {option down}
end repeat
end tell
end tell

— —————————————————————————-
— END OF CODE
— —————————————————————————-

If you enjoy the video, please like and SUBSCRIBE – http://goo.gl/3pXaPN

GET A STICKER! – http://tomandtoys.com

—————————————————————————-
SOCIAL INTERWEBS STUFF
—————————————————————————-
http://tomandtoys.com
http://instagram.com/tomandtoys
http://facebook.com/tomandtoys
http://twitter.com/tomandtoys

—————————————————————————-
Z125 STUFF
—————————————————————————-
Stebel Nautilus Air Horn: http://amzn.to/2avGivs
Bikemaster Stand: http://amzn.to/2avutzp
Flux Capacitor: http://amzn.to/2avHKhv
Pro Taper Bars: http://amzn.to/2avyIed
Chimera Air Intake – http://amzn.to/2avAH2b
Yoshimura Exhaust System: http://amzn.to/2aJMRY6
Battery Tender – http://amzn.to/2akQIwE
Round Waterproof Rocker Switch – http://amzn.to/2amx8eR
Integrated Tail and Plate Mount – http://www.mnnthbx.com/z125.html
Dehydration Prevention Kit (Bottle Opener) – http://www.mnnthbx.com/ruckus.html
Kawasaki Signal Plug Converters 2-to-2 – https://tstindustries.com/Kawasaki-Signal-Plug-Converters-2-to-2.html
LED Front Flushmount Turn Signals – https://tstindustries.com/LED-Front-Flushmount-Turn-Signals-2017-Kawasaki-Z125.html
Billie Aluminum Clutch and Brake Levers (Not ASV) – http://amzn.to/2aCYjTc
iWonow® Motorcycle 7 / 8 Inch Universal Handlebar Mounting Switch – http://amzn.to/2ao95wb
Round License Plate Bolt Screw – http://amzn.to/2ao8Zop
Sunstar 10913 13-Teeth Front Countershaft Sprocket – http://amzn.to/2amDMSj
Sunstar 10915 15-Teeth Front Countershaft Sprocket – http://amzn.to/2avNurw
Mini Trail Lights OZ-USA (TM) LED CREE Spot – http://amzn.to/2awSN3K
Rear Sprockets – https://www.denniskirk.com/search/Sunstar+Rear+Sprocket+-+2-10373.q
CoreMoto Brake Line Kit – http://zeus-armor.com/store/product_info.php/z125-pro-coremoto-frontrear-brake-line-kit-kawasaki-z125-pro-p-502
CoreMoto Brake Line Kit (their site in case of shipping) – http://www.coremoto.com/KAWASAKI_Z125_PRO_2016_CUSTOM_FRONT_BRAKE_LINE_KIT_p/cc2160.htm
TYGA Crash Bungs – http://www.hardracing.com/15-16%20Bikes/16%20Z125.htm
Ultimate Stunt Package (Pro Cage, Combo System and Frame Braces) – http://zeus-armor.com/store/product_info.php/z125-pro-ultimate-stunt-package-kawasaki-z125-pro-p-506