An MxApp can query its contents (units, channels, inlets, outlets) and operations can be called on these queries to perform them on all results.
An initial query set is obtained from the MxApp and can then be filtered further. Operations performed on the query are performed on all matching objects and all events (like connections or replacing units) will happen in a single update.
More to come. query to query patching will be possible with UGen-style multi channel array connections
Just like collection select, but the function is passed: source, i, app
function |
a new MxQuery with the selected results |
Just like collection reject
function |
a new MxQuery with the non-rejected results |
If a query set includes channels or iolets then this method will return a query set with all the units in those channels and all units that the iolets.
an MxQuery with only units
If a query set includes units or iolets then this will return a query set with just the channels that those items are in.
an MxQuery with just channels
Returns a query set with all inlets for the currently matched results. so mx.units.inlets returns all inlets for all units in the mx. For a channel (or channels) it returns all inlets for all units in that channel. For a query set of units it returns all inlets for those units.
an MxQuery with just inlets
Like inlets but returns outlets
an MxQuery with just outlets
Filters the results by testing each source object if objects.selector == equalsValue. eg. qs.inlets.where(\name,\freq) would return all inlets with the name \freq
selector |
The selector will be called on the source. For a unit this is what is inside it. For inlets, outlets and channels it is the inlet,outlet,channel itself. Thus inlet.name == 'freq' is asking the inlet. |
equalsValue |
The value to be matched for equality |
an MxQuery with the selected results
Filters where class of the source object === class
class |
an MxQuery with the selected results
Filters where source object is of the class or a subclass of class.
class |
an MxQuery with the selected results
class |
Iterates over the result set
function |
Supplied arguments: source, i, app |
this
Collects the resultset returning an array of whatever your function returns.
function |
an array |
Size of the result set
integer
If size == 0
boolean
If size != 0
boolean
Returns an item from the result set
i |
index |
the app object: MxUnitApp, MxInletApp etc
Connects all matched items to that. Units connect their first available out.
that |
An inlet. Will support connecting to another query set soon. |
that
Disconnect all matched items. Outlets and inlets disconnect all cables. Units disconnect all of their iolets.
Remove the matched items from the mx. Not to be confused with removing the items from the query set (use reject for that).
From the source objects get an array of values obtained with the selector. eg. x.units.outlets.get('spec') would be all of the specs of all of outlets.
selector |
The selector to call on the source objects. |
... args |
extra args to pass when calling source.selector( arg1, arg2, ...) |
an array of the results of getting
selector | |
value |
Duplicate all units in the query set. Dup inserts a copy of the unit directly below itself, moving anything that might be there further down by one.
num |
Number of copies to make |
if num == 1 then returns the new unit, else returns an array of units [though a new qs would be nice]
Move the matched items by channel and slot according to the vector (a point). ie. 1@0 moves it over by one channel. 0@1 moves it down by one slot in the current channel. Replaces anything currently there. [ will offer safe mode or moving items ]
vector |
a point channel@slot by which to move the objects |
this. returning a new set would be better
Copies rather than moves. See moveBy
vector |
Stops matched objects from playing
Plays matched objects
Respawns matched objects. See MxUnitApp respawn
For all channels of the matched object, mutes or unmutes the channel fader.
boo |
For all channels of the matched object, solos or unsolos the channel fader.
boo |
For all channels of the matched object, set the channel fader level.
db |