1 | # Butterchurn
|
2 |
|
3 | Butterchurn is a WebGL implementation of the Milkdrop Visualizer
|
4 |
|
5 |
|
6 | ## [Try it out](https://butterchurnviz.com)
|
7 |
|
8 | [![Screenshot of Butterchurn](https://butterchurnviz.com/static/img/preview.png)](https://butterchurnviz.com)
|
9 |
|
10 |
|
11 | ## Usage
|
12 |
|
13 | ### Installation
|
14 |
|
15 | With [yarn](https://yarnpkg.com/) or [npm](https://npmjs.org/) installed, run
|
16 |
|
17 | $ yarn add butterchurn butterchurn-presets
|
18 | or
|
19 | $ npm install butterchurn butterchurn-presets
|
20 |
|
21 | ### Create a visualizer
|
22 |
|
23 | ```JavaScript
|
24 | import butterchurn from 'butterchurn';
|
25 | import butterchurnPresets from 'butterchurn-presets';
|
26 |
|
27 | // initialize audioContext and get canvas
|
28 |
|
29 | const visualizer = butterchurn.createVisualizer(audioContext, canvas, {
|
30 | width: 800,
|
31 | height: 600
|
32 | });
|
33 |
|
34 | // get audioNode from audio source or microphone
|
35 |
|
36 | visualizer.connectAudio(audioNode);
|
37 |
|
38 | // load a preset
|
39 |
|
40 | const presets = butterchurnPresets.getPresets();
|
41 | const preset = presets['Flexi, martin + geiss - dedicated to the sherwin maxawow'];
|
42 |
|
43 | visualizer.loadPreset(preset, 0.0); // 2nd argument is the number of seconds to blend presets
|
44 |
|
45 | // resize visualizer
|
46 |
|
47 | visualizer.setRendererSize(1600, 1200);
|
48 |
|
49 | // render a frame
|
50 |
|
51 | visualizer.render();
|
52 | ```
|
53 |
|
54 | ### Browser Support
|
55 |
|
56 | Butterchurn requires the [browser support WebGL 2](https://caniuse.com/#feat=webgl2).
|
57 |
|
58 | You can test for support using our minimal isSupported script:
|
59 |
|
60 | ```Javacript
|
61 | import isButterchurnSupported from "butterchurn/lib/isSupported.min";
|
62 |
|
63 | if (isButterchurnSupported()) {
|
64 | // Load and use butterchurn
|
65 | }
|
66 | ```
|
67 |
|
68 | ## Integrations
|
69 | * [Webamp](https://github.com/captbaritone/webamp), the fantastic reimplementation of Winamp 2.9 in HTML5 and Javascript, built by [captbaritone](https://github.com/captbaritone)
|
70 | * [mStream](http://mstream.io/), your personal music streaming server, built by [IrosTheBeggar](https://github.com/IrosTheBeggar)
|
71 |
|
72 |
|
73 | ## Thanks
|
74 |
|
75 | * [Ryan Geiss](http://www.geisswerks.com/) for creating [MilkDrop](http://www.geisswerks.com/about_milkdrop.html)
|
76 | * Nullsoft for creating [Winamp](http://www.winamp.com/)
|
77 | * All the amazing preset creators, special thanks to [Flexi](https://twitter.com/Flexi23)
|
78 |
|
79 |
|
80 | ## License
|
81 |
|
82 | This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
|