Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: Memory usage on teensy 3.6 [replacing AudioSynthWavetable::instrument_data in memory]

  1. #1

    Memory usage on teensy 3.6 [replacing AudioSynthWavetable::instrument_data in memory]

    I'm in the process of building an electric piano controller using the synth_wavetable library and a teensy 3.6
    The problem right now is to figure out how to be able to replace instruments in memory, as there is not enough memory available for multiple instruments.

    From what I see the instruments are loaded into flash memory (program memory) at compile time. Each instruments when pushing it (loading only some of the sound range) takes close to 1MB.
    I tried looking into loading only one dummy instrument and then replacing it's data, but it's read only memory, so that won't work.

    Is there any other solution that may work, software or physical? i.e. adding some kind of additional physical storage that can be accessed directly as program memory, writing to program memory, low cost stand along midi player that the teensy can send midi to, etc.?

    I also looked at letting the raspberry pi do the actual midi synthesizer and run the teensy only as the midi controller to work the keyboard, but the boot times and sensitivity to pulling the power cable on the pi are an issue and I would rather avoid trying to build a minimal custom setup on the pi to reduce those issues.

    Thanks

  2. #2
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    2,786
    If you can read the stuff for the instruments into memory when you need it, you do have the micro-SD card on the 3.6 that you can use to off-load data, but that can be rather painful to implement if you have everything with pointers, etc. right now.

  3. #3
    It would be easy to implement, and that was the direction I was going, problem is that the instrument is currently stored in flash which is read only, so I cannot over right. I can get it to load into ram (not a lot of work), but there is only 256KB of ram vs 1MB of flash, and that is borderline already, so I need to either be able to overwrite the data in flash, or add a memory module that is accessible as memory so that I can load data there.

  4. #4
    Trying to dig into options, I guess the solution might be if there is a sensible way to get the instrument to play from SPI memory

  5. #5
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,536
    Quote Originally Posted by laughingrice View Post
    Trying to dig into options, I guess the solution might be if there is a sensible way to get the instrument to play from SPI memory
    You might want to look at this: https://github.com/PaulStoffregen/SerialFlash

  6. #6
    Senior Member Blackaddr's Avatar
    Join Date
    Mar 2017
    Location
    Canada
    Posts
    181
    To get decent performance you'll probably need to use DMA SPI to work with the serial memory. I modified crteensy's DmaSpi library to work with LC1023 memories here.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •