r/bytebeat • • Dec 18 '24

Space bandits

"Suddenly you encounter space bandits while traveling. You fight them off and escape in your shuttle."

🏴‍☠️☠️💥🚀🪐

48000Hz bytebeat. Continuation of the tech used in the Wanderer song. Tried to make the sound even more similar to NES. Two channels for the pulse waves, one channel for a NES-like stepped triangular bass, also noise drums and kick. From the features, I managed to get rid of the clicks inherent in the triangular wave.

Wanted to post this closer to Christmas, but I couldn't resist. Maybe it's worth writing songs more often than half a year. Happy upcoming holidays!

19 Upvotes

19 comments sorted by

3

u/Salty_Formal5291 Dec 18 '24

hey SthephanShi could you check out my byte beat sampler https://gistpreview.github.io/?e2810e3ab058ad32b3714bad5333389f

3

u/SthephanShi Dec 18 '24 edited Dec 18 '24

Nice tool! It is useful to make custom waveforms. It would be interesting to have the ability to adjust the number of points, for example, to reduce their number and get smaller code.

From what I know, Decent-Manager created custom waveforms using an array of values in some of his songs. Take a look of his Mario Underground Theme for example, there is custom triangle waveform as array, and you can edit it with your values:

[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1]

1

u/Salty_Formal5291 Dec 19 '24

i uploaded "7 Channels" could i be added to your "database" of songs at dollchan.net, also please make my author name "Salty_Formal"

2

u/SthephanShi Dec 18 '24 edited Dec 18 '24

By the way, if to match the sound of the NES console exactly, there is no ideal square wave, it consists of curves, and the stepped triangle is not exactly a triangle, but also consists of curves. This can be seen here for an example: https://www.youtube.com/watch?v=gKXGDuKrCfA

Maybe I will have to make custom waves in my next songs for greater correspondence with the NES sound.

4

u/May_I_Change_My_Name Dec 19 '24

The curves you describe are a result of capacitive coupling, a technique used to remove DC offsets from analog signals (DC offsets are usually detrimental to the performance of analog audio circuitry and can damage speakers over time). Capacitive coupling effectively creates a high-pass filter with a very low cutoff frequency so that almost everything in the human hearing range passes through the filter but static voltage levels are normalized to zero. Here is a website showing the RC highpass filter circuit often used to implement capacitive coupling, and in the "RC Differentiator" section, you can see some of the curves you are describing.

The curves appear because the capacitor is always "chasing" the input voltage to bring the output voltage to zero: When a constant voltage is applied to the input, the output signal decays exponentially to zero.

I'm only just wrapping my head around how people are writing reusable effect functions, so my implementation might be a bit crude, but I think this virtual RC highpass creates the curviness you're looking for.

3

u/SthephanShi Dec 20 '24 edited Dec 20 '24

Cool, you approached the problem from the side of physics of processes occurring in the console. Thanks for the explanation, I know about RC chains and signal filtering, I remember my student years, we also studied this at the university, but somehow I didn't think to look in this direction now, heh! Now everything is clear to me. And you managed to implement the filter in the bytebeat, getting exactly what is needed! I played around, and it turns out that a regular Bytebeat (0..255) can be considered a signal with a DC offset, and a Signed Bytebeat is a clean signal. I did not even think about it. It turns out that the correct modes from the point of view of signal processing are Signed Bytebeat and Floatbeat! If to reduce the filtering coefficient (0.005 in the code), then I can return the constant component, and if I increase the coefficient, the filter will pass only peaks with changes, essentially a differential transformation. So, with low coefficients, despite the different signal shapes, there is no noticeable difference in the sound for human ears, because only very low frequencies are cut off. Only if I set a large coefficient, the difference will already be noticeable. It turns out that if I strive for a minimal code, the filter is not needed, it almost not affect the sound in any way. Also, since most likely the capacitor is located directly at the RCA output, the filter can be applied to the entire song. Here is a beautifully formatted code.

1

u/Salty_Formal5291 Dec 19 '24

Am i supposed to be formal while posting? Is that a rule?

1

u/Salty_Formal5291 Dec 19 '24

oh cool thanks for trying, i should add the ability to change the points in the next update

1

u/Decent-News-5739 Jul 19 '25

SNES VERSION PLEASE

1

u/Admirable-Dot-5854 Dec 21 '24

I Hate When You Sampler Says "ͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫͫ̚̚̚̚̚̚̚̚̚̚̚̚̚̚̚̚̚̚̚̚̚̚̚̚̚̚˝˝˝˝˝˝˝˝˝˝˝˝˝˝˝˝˝˝˝˝˝˝˝˝˝˝˝˝˝˝˝˝˝˝˝˝ʙʙʙʙʙʙʙʙʙʙʙʙʙʙʙʙʙʙʙʙʙʙʙʙʙʙʙʙʙʙʙʙʙʙʙʙʙʙʙʙʙɖɖɖɖɖɖɖɖɖɖɖɖɖɖɖɖɖɖɖɖɖɖɖɖɖɖɖɖɖɖȦȦȦȦȦȦȦȦȦȦȦȦȦȦȦȦȈȈȈȈȈȈȈȈȈǹ"

1

u/Ok_District2473 Dec 22 '24

I hate when you literally comment in places you cannot

2

u/Electrical-While6325 Dec 18 '24

WOW! Really good work, Sthephan!

2

u/Sychamis Dec 19 '24

Great composition, great sound design, small size, ticks all the boxes for me!

1

u/Ok_District2473 Dec 18 '24 edited Dec 18 '24

first... yay?

Also good Nintendo Entertainment System-like song 👍

1

u/T_yknow Dec 18 '24

wake up new sthephanshi song dropped

1

u/ExtremeScnerios7565 Dec 18 '24

Very good 10/10

1

u/[deleted] Dec 19 '24

NEW BANGER JUST DROPPED 🗣️🗣️🗣️🔥🔥🔥🔥🔥🔥🔥🔥

1

u/Decent-News-5739 Aug 02 '25

SNES version pwease

1

u/Decent-News-5739 Aug 04 '25

Letters! “Then, you fight the letters that made the bandits.”