Sync Music or Sound Channel BPM #1928
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Set the BPM of a channel playing a sound and set up events to activate on a beat.
For example, if you have an audio file on sound channel 1, you can set it's BPM.
On the beat, you can activate events, such as a camera zoom tween, or color change.
Reminder that the on beat detection must be running every frame of when you want it to detect the beats!
How to use the extension
On an event that runs every frame, you are to add the "Beat handler" action, sound or music, and set its channel to the channel currently playing a track. This is how the beat length is calculated. This extension does not work otherwise. You cannot run both a music, and sound handler at the same time. They depend on the same hidden variables. You must run one at a time. This might be changed in a later update.
You can set the BPM, with the "Set the BPM" action. It must be the BPM of the audio file you have playing, or it won't look synced.
You can add events when the beat is hit by using the "If a beat on a (music or sound) channel is hit" condition. This object runs once during the frame of the beat.
Checklist
Example file
BPM Sync Example.zip
Extension file
SyncChannelBpm.zip
Extension by @heisenhixie
You can update the extension on this "Pull Request" by commenting the update command: in the comment field, type
!update, then drag and drop a zip file with your extension file in the commenting field, like how you initially submitted the extension. It should look like this:It can take a few seconds for the file to fully upload and show as the above. Once it is like shown above, click "Comment" and let the bot do the rest!