FINALLY - a way to to OVERSAMPLE your schematic for real!!!
Posted: Sat Jan 27, 2018 2:16 am
I have been messing around with the "call of Cuthulu" and I may have come up with something game-changing.... A way to oversample sections of your schematic. And I mean really oversample, as in execute the portion of your stream multiple times per sample!!!
It is not limited to assembler!!! You can put in any module with stream inputs/outputs and it will run that module at N-times the sample rate!!!
Now, this module is not fully finished. For proper oversampling the inputs and outputs should be low-passed at Nyquist/N frequency to remove aliasing. I haven't quite done that yet, because I was so excited to share this discovery with you.
The mechanism is actually very simple. In first ASM block in the signal chain I call the "call of Cuthulu" to get the memory address of the machine code at that point. I pass that value to the last ASM block in the signal chain. That one simply does call to that value which makes everything between the first and second ASM blocks repeat again and again. I added counter which breaks that infinite loop after N iterations. (there's a bit more details to it, that I may go over later).
Keep in mind that this will merely make the stream run at N-times the speed - if that code is samplerate dependent (ie. EQ, adsr, delays) you will have to modify them. Typically, multiplying the output of any samplerate prim by the oversampling ratio will do the trick. Some prims, however, read the samplerate in "hidden" way (for example the pitch to freq prims) - you will have to replace them.
It is not limited to assembler!!! You can put in any module with stream inputs/outputs and it will run that module at N-times the sample rate!!!
Now, this module is not fully finished. For proper oversampling the inputs and outputs should be low-passed at Nyquist/N frequency to remove aliasing. I haven't quite done that yet, because I was so excited to share this discovery with you.
The mechanism is actually very simple. In first ASM block in the signal chain I call the "call of Cuthulu" to get the memory address of the machine code at that point. I pass that value to the last ASM block in the signal chain. That one simply does call to that value which makes everything between the first and second ASM blocks repeat again and again. I added counter which breaks that infinite loop after N iterations. (there's a bit more details to it, that I may go over later).
Keep in mind that this will merely make the stream run at N-times the speed - if that code is samplerate dependent (ie. EQ, adsr, delays) you will have to modify them. Typically, multiplying the output of any samplerate prim by the oversampling ratio will do the trick. Some prims, however, read the samplerate in "hidden" way (for example the pitch to freq prims) - you will have to replace them.