Forum

VL.Audio Spreads vs Sequences

Hi All

I noticed one weird thing, Why is the output of the AudioPlayer of the type Spread but the input of AudioOut is of the type Sequence?
image image

Not sure it matters, but it does confuse me.

Sune

iirc @joreg explained once that inputs shall be of type Sequence so that you could connect any Sequence to it (so of course a Spread but also a SpreadBuilder or a MutableList, you name it), and outputs would be Spread because we assume that we feed this data to the vvvv world where we mostly use Spread? But maybe I get this explanation wrong?

That does make sense but apparently a bit confusing on first encounter.

to maximize compatibility, the rule is:

  • inputs as general as possible → highest up in the type hierarchy
  • outputs as concrete as possible → lowest in the type hierarchy

Sequence and IReadOnlyList (which have very few supertypes) are very high in the hierarchy and Spread is very low in the hierarchy, it has many supertypes. for example, have a look at the Sequence type:

if you check the “Derived” list, it is huge. all these types can be connected to such an input. if the input would be “Spread”, only a Spread could be connected to it.

2 Likes