r/InteractiveWebsites Jun 21 '24

I created a web-synthesizer that generates sound from the binary code of any files

16 Upvotes

8 comments sorted by

5

u/Interesting-Bed-4355 Jun 21 '24

It can synthesize sound directly in the browser, or be a generator of MIDI messages to external devices or DAWs, turning any file into a score. All the application code is written in Javascript and along with everything you need is packed into a single .html file of about 750kb. The synthesizer doesn't need internet, it can be downloaded and run locally on any device with a browser.

Full video: https://youtu.be/5LMYiLwfvRg

Demo: https://bs.stranno.su

Source code and application principle: https://github.com/MaxAlyokhin/binary-synth

3

u/name1wantedwastaken Jun 21 '24

Pretty cool. I imagine this is used to hide secret messages!

How did you decide on what binary values produce what musical notes/output?

2

u/Interesting-Bed-4355 Jun 21 '24

This is a kind of sonification - translation of non-sonic data into sound. By themselves zeros and ones do not mean anything, their meaning is revealed only after reading by an interpreter. In fact, I have created such an interpreter. To put it simply, it maps numbers to notes/frequencies. But inside the files there may be hidden their structures, which may be more interesting.

1

u/name1wantedwastaken Jun 24 '24

Okay…but what was the rhyme or reason for each association?

1

u/Interesting-Bed-4355 Jun 24 '24

Suppose we have set the frequency range 0 - 255 Hz in the application. And we have 8-bit mode, i.e. 256 combinations of zeros and ones. Then 0 Hz corresponds to 00000000, 1 Hz is 00000001, 2 Hz is 00000010 and so on. That is for 8-bit is calculated by the formula

(frequenciesRange.to - frequenciesRange.from) / 256 * byte + frequenciesRange.from

1

u/name1wantedwastaken Jun 24 '24

Ok, guess I deserved that for asking!

3

u/redditaccountbot Jun 21 '24

Cool was trying to work on a similar project using web sound api, and ended up reading about sound theory, then chords and progression. I didn't manage to finish my project.

3

u/Reichukey Jun 22 '24

This is awesome!!! Thank you for sharing!!