Memory mapping options


#1

I've been working on an axoloti patch with a lot of custom code (including code to display text on a character LCD, draw waveforms on a graphical LCD, and interface with 8 rotary encoders and 64 switches on my custom-designed board).

It's all working well but I keep running into problems with memory limits for the size of my compiled code. I've scoured these forums and done as much in-lining of my functions as possible to reduce code size, but I'm continually right at the limit, often getting this error when adding new code:

(x86)/axoloti_runtime/platform_win/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: region `SRAM' overflowed by 120 bytes
collect2.exe: error: ld returned 1 exit status
make: *** [C:\Users\dan\DOCUME~1\axoloti/build/xpatch.bin] Error 1
shell task failed, exit value: 1

I've noticed I have extra memory available for variables (about 2000 bytes), so I was wondering: is there is any way to reduce the memory allocated for variables and increase the memory allocated for compiled code?


#2

Amazing build man! Love the color scheme and the immediate subconscious visual grouping you achieve.

as for memory, i can't help you much here with inline optimisation... but if you're already scrambling for single bytes i would seriously consider splitting up the whole thing on two boards though. either 2 axolotis or just add a little arduino to do the screen and encoder handlig, send data both ways via serial com.

edit: zoomed in on the keys, looks like an amazing concept. care to shed some light on what it does? controls only or does it do audio at the same time?

edit2: personally i use midibox for the controls and send midi to the axo synth. very convenient. but there might be better options for you.


#3

Yeah, that is an issue with Axoloti. If you build a really advanced controller like yours, you will end up with no memory left for the patch itself.

As @weasel79 says, it is probably a good idea to split it up for 2 axos instead of 1.


#4

wowzah this is the best axo project I've seen so far can't wait to hear it


#5

do you have a youtube/vlog for this project/your projects in general?


#6

Thanks for the positive feedback. I'll probably go the route of offloading the screen/inputs to an arduino. It's just frustrating because I'm so close to being able to do everything with just the axo.

As far as my build goes, it's a 6 oscillator wavetable synth. Two of those are 8-note polyphonic (the top two light gray rows), and the other four are monophonic (the darker gray rows). Each oscillator can be toggled as either a wavetable or noise source. Each has its own filter and a 64-note arpeggiator, as well as amp, pitch, and filter envelopes. I also recently added a pretty basic additive harmonics feature to build up interesting waves.

I designed it so that each oscillator can be used as either an output voice or a mod source for any of the others (vibrato, tremolo, gate, filter freq, filter res, and arp rate). I used extended frequency ranges so each oscillator can be set anywhere from .1hz to 22khz (from LFO up to anywhere in the audible range). Most of the buttons are used to quickly toggle things on and off (envelopes, tracking, wave/noise, etc). I can also set different midi channels for each oscillator as well as different key ranges (to do split keyboard patches). My latest goal was to dual-purpose the main block of buttons to also function like a drum sequencer. I have it working but had to comment some other stuff to reduce the size of my compiled code (hence my original post).

To create wavetables I made a separate web app where I can open up an audio file, zoom in on a specific section, and copy the data out to load onto my sd card.

I haven't recorded a demo of it yet, but I definitely plan to. I was hoping to finish my next build first (this build was designed before I added the graphic LCD, and I'm also adding a few more buttons and possibly some built-in speakers).
.


#7

very nice!

so do i read this correctly, you are not just using objects to patch but you mostly write the code directly? are you using the patcher at all? do you drive the OLED with the objects by @SmashedTransistors? or did you write your own? if you use the one by @SmashedTransistors you can probably gain quite some sram by commenting stuff out that you don't need (all the letters for example, so you could leave out the include file altogether if you only need the scope) what about the LCD, is there an object that you could share? (i have the same...)


#8

Oh, 100% go with built in speakers! I made a temp enclosure for the tangband 3" and 4" i got recently and it's endless fun, not only to build but also to be able to play your thing standalone with it's own sound character.

oh and a random thought, i think you could improve the LCD readability a lot if you delete leading zeros, ie. " A: 56" still keep them right-aligned of course.

and i can recommend offloading stuff to other platforms, my project has a midibox STM32F4 for all keyboard, button and encoder inputs as well as preset management, axolotis purely for the sound engine and some OLEDs, and then an arduino for the rest of the screens and LED-rings. why kill yourself trying to optimize the last bit of code when you can just throw in a 15$ arduino...

i really like what i understood from your architecture and signal flow, would love to learn more about it at some point.


#9

how much time did you spend making this?