You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A browser based tool for running JavaScript code at specific frames of an audio track. This is useful for creating interactive music videos, making subtitles, or anything else where audiovisual synchronization is required.
4
+
5
+
## How-To
6
+
7
+
1. Include the js file and the css file from the repository. (Links coming soon)
8
+
2. Initialize an instance of CodeKeyframes:
9
+
10
+
```javascript
11
+
var ckf =newCodeKeyframes({
12
+
audioPath:'audio/yourMusic.mp3',
13
+
editorOpen:true,
14
+
waveColor:'#3AEAD2',
15
+
progressColor:'#0c9fa7',
16
+
bgColor:'#222',
17
+
keyframes:[] // paste in after exporting keyframes
18
+
})
19
+
```
20
+
21
+
3. Write your keyframes in the browser. The tool is keyboard controlled. See controls below.
22
+
23
+
4. Click EXPORT KEYFRAMES and paste the resulting code as your keyframes array from when you initialized the instance. This saves your keyframes out of localStorage and into a variable.
24
+
25
+
5. Change `editorOpen` to `false` and your keyframes will still run while only showing the audio waveform without the editor.
26
+
27
+
## Controls
28
+
29
+
Make sure you click the waveform before using keyboard controls. This choice was to avoid adding event listeners to the entire page, to prevent overlap with any other controls that you might use on the page.
30
+
31
+
`Left & Right` : Move playhead
32
+
`Shift + Left or Right ` : Nudge playhead
33
+
`Up & Down` : Zoom waveform
34
+
`Space` : Play / Pause
35
+
`Enter` : Add keyframe
36
+
`Page Up & Page Down` : Jump between keyframes
37
+
38
+
## Acknowledgements
39
+
40
+
This tool relies hugely on [Wavesurfer](https://wavesurfer-js.org/). Big thanks to [katspaugh](https://github.com/katspaugh/wavesurfer.js) for their work on it.
41
+
42
+
The repository build structure is based on [Net Art Starter](https://github.com/gridwalk/net-art-starter) by me Donald Hanson. You can learn more about the structure and use it yourself.
0 commit comments