addyosmani / addyosmani/webvlc

Add support for custom Butterchurn presets

Open
#15 0 comments 1 reaction 2 assignees Claimed by @addyosmani View on GitHub
Dominant language
JavaScript
Stars
28
Forks
4
PR merge metrics
No merged PRs in 30d

Description

This application uses Butterchurn https://github.com/jberg/butterchurn for music visualizations (https://github.com/addyosmani/webvlc/blob/main/package.json#L13) in src/components/VideoViewport.jsx. I would like to introduce a custom-presets directory to the repo which allows me to extend the current Butterchurn presets implementation with further custom presets.

To demonstrate that this works, you should support merging loaded custom-presets with the existing butterchurn-presets such that the custom-presets are loaded first. I want you to implement a custom butterchurn preset that is in that directory as a start.

below is a butterchurn preset for Royal Mashup you can use as your sample in the custom-presets directory

[$$$ Royal - Mashup (257).json](https://github.com/user-attachments/files/25589374/Royal.-.Mashup.257.json)

```json
{"version":2,"baseVals":{"rating":5,"gammaadj":1,"decay":0.9,"echo_zoom":1.104,"echo_alpha":0.5,"wave_mode":7,"additivewave":1,"modwavealphabyvolume":1,"wave_brighten":0,"brighten":1,"darken":1,"wave_a":0.001,"wave_scale":1.286,"wave_smoothing":0.63,"modwavealphastart":0.71,"modwavealphaend":1.3,"warpscale":1.331,"zoom":0.99951,"rot":0.2599,"cx":0.32,"cy":0.29,"warp":0.01105,"wave_r":0.65,"wave_g":0.65,"wave_b":0.65,"ob_size":0.5,"ob_r":0.01,"ib_size":0.26,"mv_a":0},"shapes":[{"baseVals":{"enabled":1,"textured":1,"rad":1.97883,"g":1,"b":1,"r2":1,"b2":1,"a2":1,"border_a":0},"init_eqs_str":"","frame_eqs_str":"a.tex_zoom=div(1,a.rad);a.a=.7;a.a2=a.a;","init_eqs_eel":"","frame_eqs_eel":"tex_zoom = 1/rad;\n\na = .7;\na2 = a;"},{"baseVals":{"sides":54,"x":0.15,"y":0.39,"rad":0.04084,"r":0,"b":1,"r2":1,"g2":0,"enabled":0},"init_eqs_str":"","frame_eqs_str":"","init_eqs_eel":"","frame_eqs_eel":""},{"baseVals":{"enabled":0},"init_eqs_str":"","frame_eqs_str":"","init_eqs_eel":"","frame_eqs_eel":""},{"baseVals":{"enabled":0},"init_eqs_str":"","frame_eqs_str":"","init_eqs_eel":"","frame_eqs_eel":""}],"waves":[{"baseVals":{"enabled":1,"additive":1,"r":0,"g":0,"a":0.05},"init_eqs_str":"a.sw=0;a.t5=0;a.t1=0;a.it=0;a.q1=0;a.q5=0;a.ya=0;a.xd=0;a.t8=0;a.xc=0;a.t3=0;a.t6=0;a.ti=0;a.sa=0;a.yb=0;a.yd=0;a.q4=0;a.t7=0;a.xb=0;a.t2=0;a.xa=0;a.t4=0;a.yc=0;a.t1=.2+.0006*rand(1001);a.t2=.2+.0006*rand(1001);a.t3=.2+.0006*rand(1001);a.t4=.2+.0006*rand(1001);a.t5=.2+.0006*rand(1001);a.t6=.2+.0006*rand(1001);a.t7=.2+.0006*rand(1001);a.t8=.2+.0006*rand(1001);","frame_eqs_str":"","point_eqs_str":"a.ti=a.q1;a.xa=.25+.25*Math.sin(a.ti*a.t1);a.xb=.25+.25*Math.sin(a.ti*a.t2);a.xc=.25+.25*Math.sin(a.ti*a.t3);a.xd=.25+.25*Math.sin(a.ti*a.t4);a.ya=.25+.25*Math.sin(a.ti*a.t5);a.yb=.25+.25*Math.sin(a.ti*a.t6);a.yc=.25+.25*Math.sin(a.ti*a.t7);a.yd=.25+.25*Math.sin(a.ti*a.t8);a.it=(a.it+1)*above(a.sample,0);a.sw=(1-a.sw)*above(a.sample,0);a.sa=1-a.sample;a.x=.00001

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.