Conditionally Include File Based on Attribute Value


#1

Is it possible to include different files at compile-time based on the value set in an attribute? If so, how?

a|x


#2

This is currently not possible, why would you want to do this?
Multiple include files with the same interface will cause conflicts when you 'd have multiple instances of the same object in a patch with a different include selected, as they're included globally.


#3

It's a(nother) slightly obscure scenario. I'm working on a series of modules based on LPC speech-synthesis. I'd like to include different word libraries, to be played back by the same object, but for various reasons, I'd like to keep them external to the object itself. I thought being able to select one of the available libraries from a combobox before making the patch live might be a way to achieve this, so was investigating possibilities.

a|x


#4

I'd suggest to put all different word libraries in one include file, and reference the chosen one via an attribute, would that work?


#5

Ah, that should work.

Would the compiler ignore constant arrays that weren't actually referenced anywhere?

I ask because they arrays may be quite large...

a|x


#6

I'd expect it will, yes.