Square "42 Melody" (bytebeat)

category: music [glöplog]
So I was trying modifications on the "42 Melody" and I ended up with a result that has a square tone instead of a sawtooth tone

try it out if you want

Code:((t >> 10) & 42) * t + 1000000000000000000
added on the 2018-09-29 00:39:32 by 4096 4096
Ummm, no? 1000000000000000000 & 0xFF is zero, so it's the same as:

Code:((t >> 10) & 42) * t

Which is the regular 42 melody. (Unless you're not writing 8-bit PCM output, then of course the addition will mess things up if it's 24-bit or higher.)
added on the 2018-10-01 22:58:48 by porocyon porocyon
no, its actually not that. idk how to use pouet but the code is t*(42&t>>10) for me for some reason
added on the 2019-11-28 16:09:28 by lexon lexon
adding a huge value truncates the precision, which is why it sounds different than without. You can use 1e18 instead if you want to save some decimal digits.
added on the 2019-11-29 14:05:50 by kusma kusma
Right, JS, I was assuming C.
added on the 2019-11-29 15:16:38 by porocyon porocyon