pouët.net

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
This bytebeat code here:

https://greggman.com/downloads/examples/html5bytebeat/html5bytebeat.html#t=0&e=0&s=44100&bb=5d00000100a20000000000000000310f4a8310243b01750ed3384422e816d117ef47cde333f8e0219e085bfaf6897f19a38448baf9f98e8bd29c9b031c1efcce20ca1aee63092b898b7a0028aa3b04076286dc7e139d1efb71dd82d676f9927cabc91080df6681cf49ee8db9a3c26e56471eb215f92b9a04781211110cdb198adc046154b75b912c693c3500eed481511fffd8a06000
Remove the spaces of the link!

login