MugicSpatCon:
Filter:
mugic-spat-con/Classes (extension) | Libraries > MugicSpatCon

MugicSpatCon
ExtensionExtension

Control spatialized audio live using the IEM Plugin Suite, Korg NanoKontrol2, and Mugic.

Description

MugicSpatCon is a SuperCollider extension that allows the user to control the spatialization of four mono audio streams in real-time using the Mugic Motion and Korg NanoKontrol2 controllers. Spatialization is done via the IEM Plugin Suite (see https://plugins.iem.at/) and can be configured to any number of outputs supported by the plugins, including binaural, quadrophonic, and octophonic. Mugic is used in a simple analog to the ambisonic position: turn Mugic clockwise and the position moves clockwise.

Each stream can be manually repositioned independently or in a group selection. Each stream also has its own gesture recording and playback which can be looped (in standard or pingpong mode) and its speed manipulated (from 1/4 speed to 4x). Gesture playback and manual position are summed, so a looping gesture can be moved around ambisonic space.

See the project README.md for setup information.

MugicSpatCon is designed to be used through its GUI, but can also be used programmatically. Start the GUI like this:

or like this, if you want to retain references:

Class Methods

.new

Construct a new MugicSpatCon.

Arguments:

n_tracks

The number of input tracks (max 4). Can be changed later.

n_output_chans

The number of output channels. Can be changed later.

ambi_order

The ambisonic order to use. Can be changed later.

.chaos_algos

A list of functions for generating chaotic or algorithmic repositioning.

Discussion:

The index saved in MSCTrack: -chaos_algo refers to one of these functions. Each of these wraps a particular UGen:

0
White noise (using LFNoise2)
1
Brownian movement (using LFBrownNoise2)
2
Lorenz attractors (using LorenzL)
3
Feedback sine (using FBSineC)
4
Onset detection (using Coyote). The actual detection is done behind-the-scenes in MSCTrack.

.gendyn_dist

The distribution to use for the Brownian movement chaotic movement. See LFBrownNoise2 for more.

.coyote_thresh

Threshold for Coyote's transient detection (default: 0.05).

Instance Methods

App control

.gui

Open the MugicSpatCon user interface window. This is the intended way of interacting with the extension.

.start

Start MugicSpatCon's main ambisonic processing and controller handling according to the current configuration. This will start the server if it's not already started, and restart it if the IO configuration needs to change.

.stop

Stop MugicSpatCon's processing, freeing all Synths, MIDIdefs, and OSCdefs.

.start_or_restart

Starts or restats MugicSpatCon's main processing as needed.

.show_track_vsts

Opens or closes the VST window of each track's encoder (IEM's StereoEncoder).

App configuration

.n_tracks

The number of input tracks (max 4). The number of input channels allocated is always twice this number to allow for stereo inputs. See MSCTrack: -stereo_input

.n_output_chans

The number of output channels.

.ambi_order

The ambisonic order to use.

.mugic_port

The OSC port on which to listen for Mugic's control messages (default: 4000).

.sensitivity

Mugic's positioning sensitivity.

Discussion:

This is a multiplier. A value of 1 is the default state; values greater than 1 result in faster movement for a given Mugic gesture; values less than 1 result in slower movement for the same gesture.

App status

MugicSpatCon's startup process:

MugicSpatCon.new is called
  • -is_preloading == true
  • MIDIClient is restarted (this process blocks on some systems and the preflight GUI may not be available or responsive)

MugicSpatCon is ready for configuration
  • -is_preloading == false

User calls -start
  • -is_starting == true
  • SuperCollider server restarts

Startup completes and ambisonic processing begins
  • -is_starting == false
  • -is_running == true

.is_running

Is MugicSpatCon's main processing running?

.is_starting

Is MugicSpatCon starting up?

.is_preloading

Is MugicSpatCon preloading?

.midi_running

Checks whether MSC's MIDI is configured and running. MIDI is handled by MSCMidi.

.osc_running

Checks whether MSC's OSC is configured and running. OSC is handled by MSCOsc.

.mugic_battery

Mugic's curent battery level

.mugic_last_seen

The timestamp of the last received message from Mugic. Used to determine connectivity status.

.error_str

Populated by any errors MSC encounters during startup.

App internals

These are not meant for direct consumption.

.n_input_chans

The number of input channels.

.tracks

A list of active MSCTracks.

.decoder

A MSCDecoder.

.midi

A MSCMidi.

.osc

A MSCOsc.

Examples

Start MugicSpatCon and its GUI: