C question - const char to string


#1

Hi, I want to take an inlet that has Const Char * or Char * and use it to define a Table name - which I guess is just a regular String. Not sure if objref is required either. Is there anything tricky I need to do or its just standard stuff?


#2

Tables are statically referenced, resolved at compile-time. There is currently no way to resolve a table (or any object) reference at run-time.
This is by design, I prefer compile-time errors over run-time errors.


#3

i was hoping i can still use the patcher to define the table at compile time.


#4

What's the use case?
I really prefer to avoid dynamic memory allocation in firmware.


#5

I want to reuse table read based subobjects with the same structure in a single main patch. To do that I would have to save different copies of the same subpatch just so I can reference a different table, Was thinking it would be easy just to feed strings to the subobjects to define which table the table read objects should play back. Maybe even have the Table/load object have a string outlet that is then connected to a subobject's table read


#6

You could allocate a table in a polyphonic subpatch, and load different files by using patch/polyindex to string/indexed to table/load.
Referencing tables from a polyphonic subpatch from the parent patch is not implemented, but technically possible.


#7

ahh nice..thats completely different from what i have now. I have a muxer that loads a new file into a table! (well i have like 5 muxers with 7-37 strings)


#8

I also used muxer for this Feeding 2 string objects to muxer and then to table load. It works, but there will be a smal gap in the sound when the muxer changes to load another file.


#9

small price to pay! you can just dip the volume or mute it as you load.
anyway i ran out of SDRAM after adding my 2nd voice to the instrument so the whole thing is a disaster :smile:


#10

Yeah I hit that SD-ram wall very often too. But have gotten better at using the ressources available. Getting much more "fun" out of it now, than when I first got it.

Have been using a lot of sequencers lately too.... and now I also had a few CCMSRAM overloads. Not sure what they are.

Indeed small price to pay :smile:


#11

i have a feeling something is wrong with the sdram. sometimes i cant get anything to load for 2 crashes. then everything is ok with patches that use a small amount of sdram. maybe its because my instrument so dirty.


#12

I also get some issues especially on larger patches... One patch is really buggy... FOr example I changed the file reference in the table load object from being in the root of the SD-card to a folder on the Sd-card.. and then I get SD ram overflow. Dont really get why. That shouldnt matter. Sometimes I also get it from just moving objects, again especially in large patches. But yeah, I think there might be someting with SD-ram and the use of subpatches. Techno bear says it is not related, but I just have the feeling that there is something there that might need to be looked at. But I am not capable of doing such things. Anyway, will see what happens down the road.... :smile: I think Ill just get a third Axo to start with and take it form there :smile:

I know you know most of the tricks :wink: but reducing number of presets, mod destination/sources does help a lot, but you probably al ready did that. I also started avoiding using subpatches inside subpatches. I am pretty sure that does something too.


#13

yeah i did. im even just referencing the same tables in a 2nd subobject as the first.

what the heck is this about folder and overflow? im using tons of folders hehe.

yeah the instancing that happens can be a bit tricky to grasp but we'll optimize.


#14

yeah i guess the patch itself uses tons of ram due to the complexity (mixers, filters, FM)
cant get 3 subpatch instances working with tiny tiny tables.


#15

Yeah it is funny with the folder. I use a lot of folders in other patches with no issues. Technobear said it might be a bug.

BTW, do you know what the loopstart and loopend in the table play pitch object does? Does it set sample start and sample end position? So you can choose to only play within a certain part of the table/alloc?


#16

no idea. never got it to work. pretty sure im using it wrong.


#17

Yeah, that is also why I started looking into creating new objects. That must save some resources. For example loading one 64 step sequencer instead of 4 16 steps.... Also the new multimode svf filter is a good idea, instead of having to load 3 filters individually. The modulation inputs on the multimode filter doesnt work yet, though.


#18

Just a thought: did you try using the patcher object instead of a subpatch?I only just learned about that object. Pretty nice it saves the "subpatch" within the master patch.


#19

no im too depressed.


#20

:smile: Well, the problen patch I have, I think I will rebuild it in another patch and see if Ill face the same issues again.