moddevices / cc-arduino-lib

Arduino library for the Control Chain protocol
6 stars 9 forks source link

Documentation #6

Open progtologist opened 3 years ago

progtologist commented 3 years ago

Firstly, thanks for all this work, I find both mod-* and the control chain software very useful and a huge step up from the aging MIDI protocol.

I am building a control chain device using a Teensy 4.1 which has a lot of computational power and plenty of RAM to handle many actuators. My tests and implementations so far are using the USB Serial of that board, and so far most things are working mostly without issues.

While porting the cc-arduino-lib to the board, I must decide the proper values for the constants defined in the config.h for my board.

#define CC_MAX_DEVICES
#define CC_MAX_ACTUATORS
#define CC_MAX_ASSIGNMENTS
#define CC_UPDATES_FIFO_SIZE
#define CC_STRING_NOT_SUPPORTED

Some of those variables are self-explanatory, some however are not exactly clear to me what and how they are supposed to work. e.g. CC_MAX_DEVICES is normally defined as 1 for the arduino boards. One would assume that if he changed that value to a larger number, he could call cc_device_t* newDevice(const char *name, const char *uri); multiple times, but that doesn't seem to be the case because of this

cc_device_t *cc_device_get(void)
{
    return &g_devices[0];
}

My guess is that CC_MAX_DEVICES is a parameter that is not yet supported by the library, is that correct?

Similarly, I do not understand the purpose of CC_MAX_ASSIGNMENTS. Is the idea that if this is larger than one that you can assign more parameters to a single actuator and that when that actuator changes value, all assigned parameters will change value simultaneously? Is this implemented or is this also something for the future?

Are there limitations to the library or the protocol? E.g. max number of actuators, max number of assignments? What does the CC_UPDATES_FIFO_SIZE affect? Would increasing it also affect latency?