Cabbage Logo
Back to Cabbage Site

Doc suggestion - or maybe optimization question?

On the doc page for imported plants: http://cabbageaudio.com/docs/custom_plant_imports/

You suggest using sprintfs in the section with the example:
iAtt chnget sprintf("%sattack", SChan) iDec chnget sprintf("%sdecay", SChan) iSus chnget sprintf("%ssustain", SChan) iRel chnget sprintf("%srelease", SChan)

Wouldn’t this be more efficient with strcat?
iAtt chnget strcat(SChan,"attack") iDec chnget strcat(SChan,"decay") iSus chnget strcat(SChan,"sustain") iRel chnget strcat(SChan,"release")

I haven’t really figured a good way to benchmark test, but my thought was strcpy should be a simpler join of the two strings whereas sprintf has to get into the messy formatting even when it’s a simple string presented.

Anyways… if so, I’d suggest the doc be updated.

And if not, I’ve got a bunch of code to change! :joy:

Sure, that looks neater. I’ll update them now.