Inlet/Outlet Ranges


#1

I'm working on a suite of objects at the moment that require integer in/outlet values within a much narrower range that the 27 bits used by factory objects.

The objects themselves are able to communicate with each other fine, but I'm wondering if it would be better to bit-shift all outlet values to 27 bits, and shift inlets down to the correct internal range.

Doing this would allow other objects to interact more easily with my customs ones, but would add a small additional CPU overhead.

I'd be interested in hearing anyone's view on the pros and cons of doing this.

a|x


#2

Could you explain what the in- and outlets serve for?
Sometimes the shift can be absorbed into an already existing multiplication coefficients in your algorithms.
Some processor instructions like ADD or AND can also do a (free) shift, the compiler will figure that out. Worst case, an explicit shift is a single instruction cycle.


#3

Hi, thanks for getting back to me, and sorry for the late reply.

The in/outlets in question are of 3 types:

  1. Lookup table indices (positive ints using no more than 6 bits)
  2. Control signals (signed ints using no more than 16 bits)
  3. Audio signals (8 bit signed integer)

The reason for shifting the control signals to 27 bits would be so that k-rate objects (LFOs, envelopes etc.) could be connected to them without requiring any additional signal-scaling objects.

Though the suite of custom objects includes noise and pitched wave sources, their output is 8 bits, so they're too quiet to be used in place of standard sound-sources.

The filter object these audio sources feed into also expects 8 bit signals, so can't be used with Factory audio sources without pre-scaling.

All the objects work fine together as they are, but I think I'm persuading myself that I should make sure at least the audio and control signals operate in the expected ranges.

When I get some free time to work on Axoloti stuff, I'll try and implement this, and see if it makes any significant difference to resource-usage. If each shift is a single instruction, then I guess I should be ok.

a|x