Audio:...inSetup(3pm)

πŸŽ€ NAME

okay so welcome bestie πŸ’– this is Audio:...inSetup(3pm) β€” section 3pm of the perl manual, no cap β€” and the actual star of the show is Audio::Nama::ChainSetup, aka the routines for generating Ecasound chain setup. periodt. ✨

🌸 Overview

so for the Ecasound engine to even run, it has to be configured into a signal processing network. that configuration? it's called a "chain setup" πŸ’… and it's a graph made up of a whole bunch of signal processing chains, where each chain has exactly one input and exactly one output. one and one. iconic.

when user input needs the configuration to change, Nama generates a new chain setup file. and these files are guaranteed to be consistent with the rules of Ecasound's routing language, so you can trust them fr fr 🫢

after initializing the data structures, Nama iterates over project tracks and buses to make a first-stage graph. that graph gets successively transformed as more routing details get added, and then every single edge of the graph is processed into a pair of IO objects β€” one for input, one for output β€” that together constitute an Ecasound chain. with a bit more processing on top, the config gets written out as text in the chain setup file. ate. πŸ‘‘

πŸ¦‹ The Graph and its Transformations

generating a chain setup starts with each bus iterating over its member tracks and connecting them to its mix track. (see man Audio::Nama::Bus.)

in the case of one track belonging to the Main (default) bus, the initial graph would be:

soundcard_in -> sax -> Main -> soundcard_out

soundcard_in and soundcard_out will eventually be mapped to the appropriate JACK or ALSA source, depending on whether jackd is running. the Main track hosts the master fader, connects to the main output, and serves as the mix track for the Main bus. main character energy tbh πŸ‘‘

if we've asked to record the input, we automatically get this route:

soundcard_in -> sax-rec-file -> wav_out

the track 'sax-rec-file' is a temporary clone (slave) of track 'sax' and connects to all the same inputs. no original tracks were harmed πŸ’–

a 'send' (for example, a instrument monitor for the sax player) generates this additional route:

sax -> soundcard_out

Ecasound requires that we insert a loop device wherever signals fan out or fan in.

soundcard_in -> sax -> sax_out -> Main -> soundcard_out

                       sax_out -> soundcard_out

here 'sax_out' is a loop device. (note that we prohibit track names matching *_out or *_in.) 🚫

inserts are incorporated by replacing the edge either before or after a track vertex with a network of auxiliary tracks and loop devices. (see man Audio::Nama::Insert.)

unterminated parts of the network are discarded. then redundant loop devices are removed from the graph to minimize latency. slay, efficiency. ✨

πŸ’œ Dispatch

after routing is complete, Nama iterates over the graph's edges, transforming them into pairs of IO objects that become the inputs and outputs of Ecasound chains. πŸ’…

to create an Ecasound chain from

Main -> soundcard_out

Nama uses 'Main' track attributes to provide data. for example track index (1) serves as the chain_id, and the track's send settings determine the soundcard channel or other destination.

some edges are without a track at either terminal. for example this auxiliary send:

sax_out -> soundcard_out

in this case, the track, chain_id and other data can be specified as vertex or edge attributes.

edge attributes override vertex attributes, which override track attributes. this allows routing to be edited and annotated to behaviors different from what the track wants. when a temporary track is used for recording, for example

sax-rec-file  -> wav_out

the 'sax-rec-file' vertex is assigned the 'chain_id' attribute 'R3' rather than the track index assigned to 'sax-rec-file'. iykyk 😌


and that's the whole page bestie, you understood it, you ate πŸ“ this was perl v5.40.1, dated 2026-05-06 β€” go forth and build chains, mwah πŸ’–πŸ§šβ€β™€οΈπŸŒˆ

πŸ“¦ where this page comes from