DhrBaksteen / ArduinoOPL2

Arduino library for use with the OPL2 board (YM3812) and OPL3Duo (YMF262)
MIT License
195 stars 39 forks source link

setInstrument does not support reading from SRAM on Arduino hardware #47

Closed virtuaCode closed 4 years ago

virtuaCode commented 4 years ago

Hi @DhrBaksteen, I'm working on a modified version of the TeensyMIDI example where I want to store part of the instruments in the EEPROM or SRAM, so I can modify and store them permanently on my Arduino Uno. Unfortunately setInstrument does not support reading from SRAM when the board type is set to OPL2_BOARD_TYPE_ARDUINO.

Here's my workaround for this problem: virtuaCode@6664009973a6255de28523fef02c26531390a27c

DhrBaksteen commented 4 years ago

Hi @virtuaCode this was done intentionally because fitting a full instrument library into SRAM would eat a lot of memory (especially for an Uno or Nano with just 2k). I didn't want to limit people's creativity when working with the example code by taking most of their memory :). However having said that I have a local change already where instruments can also be set directly from RAM along the lines of what you have, because it's still handy to have.