Skip to content

Commit

Permalink
added a link to Kalimba.txt in bytebeat-pcm.html
Browse files Browse the repository at this point in the history
  • Loading branch information
Ponali committed Mar 3, 2024
1 parent 849a28d commit 80c72cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion files/bytebeat-pcm.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ <h1>bytebeat PCM projects</h1>
<p><a href="/">home</a></p>
<hr>
<h3>audio to bytebeat</h3>
<p>when march started, i had the idea of creating a python script that can convert an MP3 file or basically any audio to bytebeat code. the script was finished 2 days later and i am very happy on how it turned out. you are able to make the audio loop or end with silence, choose the sample rate, and if the string needs to be formatted (\x69, \x00), to use special characters (E, NUL), or a mixed version (E, \x00).<br>to use the script, you will need the libraries "pylib" and "numpy" and have <a href="https://ffmpeg.org/">ffmpeg</a> installed on your computer. after that's done, you can download the file from <a href="/files/bytebeat/audio2b.py">here</a>. insert an audio file in the same folder, then run the python script. <u>make sure to run the script inside of cmd.exe, not any other client like python IDLE!</u> you'll be prompted if the audio needs to be looped, the sample rate, formatting, and the name of the audio file. if the name contains spaces, insert the name in double quotes. after that, you will be greeted with more text. that is just ffmpeg doing its job: it will convert the mp3 file to have the correct sample rate and turn it into mono. after that, you will see some other text that changes. this is the python script doing its job: it converts the audio file into a bytebeat string. if you see "Failed to summarize action." that is because the python script couldn't generate the string to update the status text. the status text is made out of a couple elements: "sample" is the sample that is being converted into the bytebeat string and a pourcentage. "compress" is how much has been compressed from the list of samples, if the pourcentage is more than 100%, that means it has successfully compressed the audio, if not, that means it takes more space than the list of values (silence will be greatly compressed because it uses RLE). "size" is the size of the bytebeat string that is generated, and "est." is the estimated size the bytebeat string is going to have. once it is done converting, you will see the bytebeat code has been written in <i>output.txt</i>. open it, select all, copy, then paste in a bytebeat client that supports "Funcbeat" (like <a href="https://dollchan.net/bytebeat/">this one</a>). make sure the time is set to 0, then play. if everything worked correctly, you should hear the sound you gave to the script.</p>
<p>when march started, i had the idea of creating a python script that can convert an MP3 file or basically any audio to bytebeat code. the script was finished 2 days later and i am very happy on how it turned out. you are able to make the audio loop or end with silence, choose the sample rate, and if the string needs to be formatted (\x69, \x00), to use special characters (E, NUL), or a mixed version (E, \x00).<br>to use the script, you will need the libraries "pylib" and "numpy" and have <a href="https://ffmpeg.org/">ffmpeg</a> installed on your computer. after that's done, you can download the file from <a href="/files/bytebeat/audio2b.py">here</a>. insert an audio file in the same folder, then run the python script. <u>make sure to run the script inside of cmd.exe, not any other client like python IDLE!</u> you'll be prompted if the audio needs to be looped, the sample rate, formatting, and the name of the audio file. if the name contains spaces, insert the name in double quotes. after that, you will be greeted with more text. that is just ffmpeg doing its job: it will convert the mp3 file to have the correct sample rate and turn it into mono. after that, you will see some other text that changes. this is the python script doing its job: it converts the audio file into a bytebeat string. if you see "Failed to summarize action." that is because the python script couldn't generate the string to update the status text. the status text is made out of a couple elements: "sample" is the sample that is being converted into the bytebeat string and a pourcentage. "compress" is how much has been compressed from the list of samples, if the pourcentage is more than 100%, that means it has successfully compressed the audio, if not, that means it takes more space than the list of values (silence will be greatly compressed because it uses RLE). "size" is the size of the bytebeat string that is generated, and "est." is the estimated size the bytebeat string is going to have. once it is done converting, you will see the bytebeat code has been written in <i>output.txt</i>. open it, select all, copy, then paste in a bytebeat client that supports "Funcbeat" (like <a href="https://dollchan.net/bytebeat/">this one</a>). make sure the time is set to 0, then play. if everything worked correctly, you should hear the sound you gave to the script.<br>i used this script to port a section of kalimba by mr. scruff into bytebeat, with clever audacity usage. <a href="/files/bytebeat/Kalimba.txt">here</a> is a link to the entire code.</p>
<h4>questions</h4>
<p><i>the audio in the bytebeat code is crusty. how do i enhance it?</i> if you don't care about the character count, you can always set the sample rate (when the script asks you questions) as 48000Hz. if you <i>do</i> care about the character count though...for sound effects, i reccomend using 22kHz and 11kHz for music. if you want the audio to be smoother, set the sample rate to 48kHz <i>in the client</i>, not in the python script! the bytebeat code has a built-in audio smoothing code that only works if the sample rate is higher than the one that was previously given.</p>
<p><i>why funcbeat?</i> if the result were actual bytebeat code, then terrible lag will occur. this is because, for every sample, the PCM data gets calculated again and again. if it were to be funcbeat, it will not lag, because the PCM data gets only calculated once. i used advantage of this to compress the data with RLE.</p>
Expand Down

0 comments on commit 80c72cf

Please sign in to comment.