I’m attempting to build a delay pedal that does only one thing: when you stomp the button, it plays back 30 seconds of high quality audio from 30 seconds ago.

I think it would need to be continuously overwriting some type of eeprom array. Does anyone have any advice?

I bought a few Teensy audio shields to try and prototype it. But I obviously need to understand how to achieve such a continuous rewrite on EEPROM or some other form of quick rewrite memory.

If someone could guide me to the right information, I’d be most grateful.

  • Treczoks@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    3 days ago

    Don’t use an eeprom for that, just use RAM. For 30 seconds of HiFi stereo, you need 30480002*2 bytes, roughly 6MB. A Raspberry Pi like computer should have no problems with that, and there are high-end codecs available.

    • harryprayiv@infosec.pubOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      3 days ago

      I’m trying to do this in a really small, portable format. So while that would work well with a Pi, this needs to be able to be powered by a 9V battery. So, I really need it to be a microcontroller instead of a full-on ARM chip.

      I could co conceivably do this with a PI Pico but I want to see about doing this in as compact and low power format possible.

      • Treczoks@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        2 days ago

        Good luck finding a chip that is capable of storing the needed amount of data while being easily accessible and not wearing out quickly. SRAM could do this, but you are quickly approaching the USD100 mark for a single chip here. That’s why people use the way cheaper DRAM chips, which are used by bigger chips, I.e. the upper class of ARM chips. As far as I know, there are no sub-ARM class controllers with a DRAM interface.

        What you could do is use an FPGA like an Efinix Trion T20 or bigger, which has at least one version with a DDR memory interface. But that might be a bit big for a beginner to work with - even seasoned programmers fail at grocking HDLs.

        • harryprayiv@infosec.pubOP
          link
          fedilink
          English
          arrow-up
          3
          ·
          2 days ago

          Thanks for the insight.

          FPGA’s can do anything. Verilog is no joke. I’m excited for FPGA’s to become a bit more approachable with the advent of OpenFPGA.

          • Treczoks@lemmy.world
            link
            fedilink
            arrow-up
            2
            ·
            2 days ago

            Well, nearly anything. But yes, verilog or VHDL are tough, because they require a different mindset to approach problems and solutions.

            • harryprayiv@infosec.pubOP
              link
              fedilink
              English
              arrow-up
              2
              ·
              edit-2
              2 days ago

              I find that Haskell and similar purely functional languages that use category theory pair well with situations that rely on parallelism. Especially Haskell because it is immutable and lazy (or Idris or Agda with their dependent types to prevent invalid circuits perhaps).

              Circuits as Bicartesian Closed Categories

              Maybe someday this stuff will be approachable to Arduino level tinkerers. Until then, I like to watch this guy make magic https://youtu.be/Q8K0aeqDBiI

  • junderwood@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    3 days ago

    Have you looked at the audio libraries that are available?

    https://www.pjrc.com/teensy/td_libs_Audio.html

    That content seems old but maybe it’ll help or at least provide some direction. Personally I’ve only done predetermined audio file playback with a button press, but constant recording sounds like something that would be possible. True constant rewriting on the EEPROM is from what I understand not the best idea because of how quick you’d wear it out. A fast sd card might be the ticket there. Good luck, it sounds like a fun project!

    • harryprayiv@infosec.pubOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      3 days ago

      I did look it over very thoroughly.

      The way to skin this cat is to find a way to rewrite large banks of memory. Their library is amazing but I think writing their onboard microSD card is about as close as I could get with stock Teensy hardware.
      I think I’ll see if Paul S from Teensy would chat on the phone. Edit: he pushed me to their forum. 🫤 super sweet guy!

      By my estimation, what I actually need is a circuit board or a IC packed with EEPROM that can write in a continuously-cascading fashion. A very interesting puzzle that I had yet to encounter until I had this idea for sure!

      I bought a cheap IC that does low quality audio but it’s just not the same. It needs to be pristine quality audio. So, I’m guessing that I’m looking for the ability to encode and decode 16bit 44.1 kHz quality audio on the fly.

  • Baron Von J@lemmy.worldM
    link
    fedilink
    arrow-up
    1
    ·
    3 days ago

    I’ve no idea how to help but it sounds like a neat project and would love to hear it after it’s done! I know there’s a few people in this community posting their DIY pedals so hopefully they chime in.

    • harryprayiv@infosec.pubOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      3 days ago

      I’m hoping so. I am resisting the urge to go to enshitti-Reddit for this question…… probably at my own expense.