follow us

Chipmusic • Retro Gods

Duty Cycle Generator – Single Channel Echo

Neil Baldwin over at Duty Cycle Generator has added the ability in his sound engine “Nijuu” to add an “echo effect” to a single square wave channel.

Echo Demo

How it works is to have a circular buffer (one each for voices Square 1, Square 2 & Noise) that the echo writes to by figuring out what is going to get written to the PAPU (Pseudo Audio Processing Unit) registers each frame. It then captures the register settings and continues to do so until the buffer is filled, then starts again at the beginning. When you enable echo, Nijuu retrieves the values from the buffer and writes them to the PAPU registers in the “gaps” in between notes when it decides that there’s no activity on the voice (I do this by detecting if the ADSR envelope on the voice has reached the release phase or if there is no note playing). The echo feedback continues to loop around, attenuating the captured amplitude until it reaches zero. All the while, any new notes are captured to the echo buffer in the same way and it continues to capture/attenuate/feedback notes forever until you turn it off.

(The above quote was taken from Neil’s article and slightly modified for accuracy.)

11 comments to Duty Cycle Generator – Single Channel Echo

  • Kind of lame to have it scripted, if you ask me. Not exactly hard or that time consuming to just do manually.

  • bucky

    I disagree on this being “lame” in any capacity. This is quite cool! I think the demo mp3 speaks for itself… :)

  • Neil Baldwin

    C’est la vie – can’t win ’em all :)

    To be serious for a minute, I did wrestle with the idea of trying to make these kind of effects easily available as I did think at some point it would alienate those who (like yourself, and myself, back in the day) prefer to manually program them.

    But the whole idea for Nijuu was born from the notion of “what if….?” And one of those what-ifs was “What if single-voice echo could be turned into a programmable effect?” and (apart from a couple of bugs that I need to iron out) I think I achieved that.

    The best thing about the whole exercise is that it’s now gone beyond just a way to recreate single-voice echo and has potential for some really creative uses.

    For the hardcore, you can still program echo manually. I just give you the choice :)

  • sure, not for the crafters, but i like the idea. i guess it gives nice possibilties for generative elements, if you expand the idea of to include other notes and other effects. boink!

  • B00daW

    Neil, now you have to add 4-bit and 7-bit PCM support, DPCM, change the NSF format so that you can increase or decrease engine refresh rate at will, all the expansion audio chips including MMC5 8-bit PCM support. ;D

    Either way, man. Good job and keep up the good work. We appreciate it. Per our previous discussion, if you need any help with concept or documentation, drop me a mail.

  • Neil Baldwin

    Ha ha :D

    I *may* cave in on the DPCM issue. Maybe.

    I haven’t forgotten about your offer, I will email you very soon. I did some rash optimising the other day and have introduced a couple of really awkward bugs that I want to track down. Then update the manual and then….. :)

  • B00daW

    It was your suggestion. Not my offer. ;D

  • Neil Baldwin

    True, true… :)

  • Neil Baldwin

    Oh, one thing man, in your summary line you suggest that the echo is for square channels only – in fact it also can be applied to the noise channel as well. :)

  • B00daW

    Well, I did mention it when I fixed your notes too! :D But, yeah… Sorry.

  • Keaton_Blue

    I can’t wait for Nijuu! I wanna hear a noise echo. ;)