Subsystem Search

Many audio channels

By the end of this chapter, Subsample records from the pair of inputs you choose on an interface with many, your keyboard plays on outputs of its own, and you know what recording in ambisonics needs.

The project so far

The project from Playing with other software: your keyboard and two kits played together by the ensemble in midi-map.yaml, through a MIDI port of Subsample's own, in time with a sequencer's clock, and telling other software over OSC what it records. Write each kit, then the ensemble, with the configuration naming each map as you write it:

$ mkdir kitchen-kit
$ cd kitchen-kit
$ subsample --init
…
recorder:
  enabled: true
  audio:
    audio_format: flac
    bit_depth: 24
player:
  midi_map: kits/kitchen/midi-map.yaml
  watch_midi_map: true
  enabled: true
  virtual_midi_port: Subsample Virtual MIDI
library:
  max_memory_mb: 512
  watch: true
similarity:
  weight_timbre_onset: 2
detection:
  release_threshold_db: 4
  retrigger_threshold_db: 15
  min_peak_db: -45
tempo:
  bpm: 120
  source: midi
osc:
  enabled: true
  receive_enabled: true
notes:
  kick: 36
  snare: 38
  hat: 42
  open_hat: 46
cc:
  brightness: 74
channels:
  kit: 10
definitions: { my: names.yaml }
channel: my.kit
templates:
  pad:
    process:
      - compress: true
  quiet:
    gain: -6
assignments:
  - name: Kick
    template: pad
    notes: my.kick
    select: { where: { directory: kick }, pick: any }
  - name: Snare
    template: pad
    notes: drum.snare_1
    select: { where: { directory: snare }, pick: any }
    stack: true
  - name: Snare layer
    template: [pad, quiet]
    notes: drum.snare_1
    select: { where: { directory: layer }, pick: any }
    stack: true
  - name: Closed hi-hat
    template: pad
    notes: drum.hi_hat_closed
    select: { where: { directory: hat }, pick: any }
  - name: Open hi-hat
    template: pad
    notes: drum.hi_hat_open
    select: { where: { directory: open-hat }, pick: any }
    silenced_by: drum.hi_hat_closed
player:
  midi_map: kits/worktop/midi-map.yaml
channel: 10
assignments:
  - name: Kick
    notes: drum.kick_1
    select: { where: { directory: kick }, pick: any }
  - name: Snare
    notes: drum.snare_1
    select: { where: { directory: snare }, pick: any }
  - name: Closed hi-hat
    notes: drum.hi_hat_closed
    select: { where: { directory: hat }, pick: any }
player:
  midi_map: midi-map.yaml
assignments:
  - name: Glass keys
    channel: 1
    notes: C3..C6
    select:
      where:
        name: note_1
    process:
      - repitch: true
    mode: gated
  - name: Glass drone
    channel: 1
    notes: C2
    select:
      where:
        name: note_1
    mode: loop
  - name: Table loop
    channel: 1
    notes: G2
    select:
      where:
        name: taps
    process:
      - stretch_quantize: { grid: 16 }
    mode: loop
maps:
  - kits/kitchen/midi-map.yaml
  - { channel: 11, map: kits/worktop/midi-map.yaml }

Choosing inputs

Recording well chose the microphone by name. An interface with many inputs needs one more choice, which of them to record from:

recorder:
  audio:
    input: [3, 4]

recorder.audio.input lists the inputs to record from, numbered from 1 as the interface labels them, and Subsample records as many audio channels as it lists: two here, a stereo pair. Left out, Subsample records from the first inputs, as many as the interface has, or as recorder.audio.channels says.

A sound keeps its audio channels

A sound keeps the audio channels it was recorded with, from the moment it is cut to the moment it plays: a pair of microphones records and plays back in stereo, and a recording on four keeps four. A sound with more audio channels than Subsample plays through is mixed down to fit, by the coefficients the broadcast standards give for it.

Outputs of its own

Subsample plays through two outputs unless you tell it how many the interface has:

player:
  audio:
    channels: 4

player.audio.channels is how many outputs to play through, in the order the standards give them, and Subsample refuses to start when the interface has fewer. Now send the keyboard to outputs of its own:

- name: Glass keys
  channel: 1
  notes: C3..C6
  select:
    where:
      name: note_1
  process:
    - repitch: true
  mode: gated
  output: [3, 4]

output names the outputs a sound plays through, counted from 1 as the interface labels them. The keyboard now plays through outputs 3 and 4, a pair of its own to send to a mixer, while every sound that names none plays on the first two. Where a sound sits between the outputs it plays through is pan's to say.

One part of a recording

With a stereo pair of inputs, record a sound in stereo: strike a pan lid between the two microphones, and save it in the project folder as lid.wav.

A recording for this step is planned. Until then, use one of your own.

Cut it, and it gives lid_1:

Example not checked: it is not run when this site is built.

$ subsample lid.wav

A pad can play one part of a recording with more than one audio channel, as one audio channel:

- name: Lid, left
  channel: 1
  notes: D2
  select:
    where:
      name: lid_1
  extract: channel.1
- name: Lid, sides
  channel: 1
  notes: E2
  select:
    where:
      name: lid_1
  extract: side

extract takes its part before pan and output place it. channel.1 is the first audio channel alone, what the microphone on input 3 heard, and side is the difference between the two, what reached one microphone and not the other: for a lid struck between them, more of the room and less of the strike. omni is the two added together, and left and right are what a microphone facing that way would have heard. The same recording plays whole wherever a pad does not extract it.

Recording in ambisonics

An ambisonic microphone records the sound from every direction at once, on four audio channels, so that a microphone facing any way can be drawn from it afterwards. Subsample records one with recorder.audio.channels set to 4 and recorder.audio.ambisonic_format naming how the microphone gives its four: a_generic for four capsules in the usual tetrahedron, a_nt_sf1 for the Rode NT-SF1, and b_ambix or b_fuma for a microphone that gives B-format already. It keeps every recording as first-order AmbiX B-format, whichever it came in as, and extract can then play it as a microphone facing front, back, left or right, or up and down, height.

With the sound going where you want it, the next chapter splits the work between two machines: one records, and the other plays what it records.