I've recently created this block which works well, but it's really slow.
Here's the script for this reporter:
I still want to keep the sound at 48kHz, or else it'll sound muffled and low-quality, and the idea is to keep repeating samples for the amount it should.
Is there any way to rewrite this script to make it faster?
Of course, feel free to drag the code into the Snap! playground to test the script by yourself.
i'm guessing the performance issue might be that you're making the list longer repeatedly. maybe try starting by creating the list with the correct length, and then setting all the samples either with a loop or map.
Sorry! Here's the updated version.
It converts a stereo sound to mono with my block [scratchblocks]convert sound [sound v] to mono:: sound reporter[/scratchblocks] and then it does stuff from there.
The problem is that it's adding the items, and not the lists, becuase the sound is mono, so there are no lists to combine, so it adds all items.
Yeah, that was before I realised you could reshape a scalar. I've updated it, and it sort of improved, but it's still slow.
Topic closed...
So after messing around, I tried to make a better bitcrush block, and I made a mapping block, but it takes significantly longer - about 4 times longer than the first prototype I made - so it isn't helpful.