How much on-chip RAM does the Axoloti have?
Also, is it possible to assign to/read from (using a pointer) the larger SDRAM memory in a custom object?
a|x
How much on-chip RAM does the Axoloti have?
Also, is it possible to assign to/read from (using a pointer) the larger SDRAM memory in a custom object?
a|x
I found this line in the Factory alloc 8b sdram object:
static int8_t _array[attr_poly][LENGTH] __attribute__ ((section (".sdram")));
Is this how it's done?
Can it be a const, rather than a static array, if so, does it have to be a static, if it's going to be writeable?
Sorry for the silly questions..
a|x
A memory section can only be specified if the variable is static. Static variables are shared among class instances, Axoloti emits a separate class for every object, only in a polyphonic subpatch context, they are really shared. That's why a [attr_poly] array is declared. It is writeable.
So this would work OK, for storing an array or 8-bit bytes in SDRAM?
static uint8_t _array[attr_poly][62] __attribute__ ((section (".sdram"))) UK_ACORN_M_TONE1[62] = {0x8D,0xF2,0xDE,0xDD,0xDD,0x93,0x74,0xAA,0x53,0x9D,0xEA,0x54,0xA7,0x3A,0xD5,0xA9,0x4E,0x75,0xAA,0x53,0x9D,0xEA,0x54,0xA7,0x3A,0xD5,0xA9,0x4E,0x75,0xAA,0x53,0x9D,0xEA,0x54,0xA7,0x3A,0xD5,0xA9,0x4E,0x75,0xAA,0x53,0x9D,0xEA,0x54,0xA7,0x3A,0xD5,0xA9,0x4E,0x75,0xAA,0x53,0x9D,0xFA,0x4A,0x26,0x51,0x39,0x79,0x15,0x0A};
and I could declare a point to it in the usual way
static *m = &UK_ACORN_M_TONE1[0];
?
a|x
For an array of 62 bytes, I recommend to keep it in sram. But I guess you have many of those.
Provisioning initialization data to a large table in sdram is best done by loading a file from sdcard, or - if possible - by computation in object initialization.
Yep, I have a LOT of arrays of various lengths, hence the necessity to use pointers. I they were all the same length, I would just stick them all in a 2D array.
I didn't know it was possible to load arbitrary data from SDCard. Actually, if that IS possible, that would be quite useful, I think. Writing all the bytes into tables in the the Patcher manually would be soul-destroying, though...
My plan was to dump all the arrays in an include file, then use an Attribute to choose which set of arrays to use at runtime.
My other slightly obscure requirement is that I need to be able to abuse pointers in order to point to arbitrary bytes in the data, under param/inlet control, so all the arrays need to be in a contiguous block in memory, if at all possible.
a|x
Maybe pad the arrays of various lengths to their maximum length, and really stick them in a 2D array? Yes, arbitrary data can be loaded from sdcard.
Padding wouldn't work, now I think about it.
The background is this is (as you may have guessed) LPC-encoded speech, which is basically a serial data-stream, consisting of frames of varying lengths.
In order to replicate circuit-bent-type sounds, I need to be able jump into the data at arbitrary points in the data-stream, which has the effect of producing the kind of garbled glitchy sound you get from abusing a vintage Texas Instruments talking toy.
Padding out each word/phrase with zeroes would mean there would be a good chance you'd get silence a good proportion of the time, in 'bent mode'.
a|x
the problem with loading from card is that the object will no longer be standalone. You'd need to load the data to card before it would work. I realise that's also the case with any sample-based patches, but I'd rather it wasn't for this particular object.
Having said that, I'd love to know how that would be done, anyway- i.e. loading many arrays like the above from SD card to SDRAM, then setting up pointers to each one.
a|x
Check "table/alloc 16b sdram load" as an example of loading binary data into an array.
For the uneven lengths - how is the ROM of the TI Speak'n'Spell organized? Perhaps a master index containing the offsets of the phonemes, and each phoneme string terminated with a zero?
It's a bit more complicated than that, unfortunately.
Because the frames are of a variable number of bits in length, and each frame contains multiple 3, 4, 5 or 6-bit indices into various lookup tables, the frame boundaries don't actually correspond to 8-bit bytes. The end of each word/phrase is marked by a value of 15 for one of the indices, but you have to read the word from the correct beginning position in order to find this marker.
a|x
I'm at work at the moment, so can't test stuff. I'll have a look at the ""table/alloc 16b sdram load" object when I get home.
Does this one load data from SD card?
a|x
Maybe it would be easier to just concatenate all the word data into one massive array (currently each word is a separate array).
Then, I could keep a separate array of 'index' pointers pointing to particular start bytes.
Of course, it would be the same number of bytes, but it might make it easier to load the data into SDRAM from an external file.
Also, it might make it easier to create new word banks in the future.
Thinking out loud, really...
a|x
I think I understand now.
In order to use a mechanism like the 'alloc 16b sdram load' object to transfer my data to SDRAM, I'd first need to convert the data that's currently in the form of multiple mixed-type structs and long arrays of 8-bit uints into an unstructured raw binary 'blob', in order to be able to load it.
I'd then need to define the format of that raw data in the object, in order to be able to read it.
This is really getting waaay more low-level than I'm used to dealing with. It's a challenge...
a|x
Probably another silly question, but when loading a file into SDRAM, the file has to be raw binary data?
Or, is it possible to evaluate text content of the file as code (as you do with text attributes in some Factory objects)
a|x
At the bottom of this page
http://furrtek.free.fr/index.php?a=speakandspell&ss=6&i=2
there's a description of the memory map for the TI Speak & Spell word cartridges.
Address Size (bytes) Description
0 1 Word count of level A
1 1 Word count of level B
2 1 Word count of level C
3 1 Word count of level D
4 2 Pointer to the level A word list
6 2 Pointer to the level B word list
8 2 Pointer to the level C word list
A 2 Pointer to the level D word list
C 2 Magic bytes (0xAAAA)
I think I will use the same format for my binary data. That way, I'm half way to being able to use the same code to load Speak & Spell raw binary dump files, like the .vsm ones available for MAME.
a|x