Home

MidiTransform

{
  singlePatch: MidiTransform.Fn.Whole,
  throttle?: Int,
  param?: MidiTransform.Fn.Param,
  name?: MidiTransform.Fn.Name
}

Used with SinglePatchTrusses that can have individual parameter changes sent to the synth (as opposed to some synths that only accept full patch dumps.)

throttle
Minimum time in milliseconds that Patch Base should wait between sending MIDI data to the synth.
param
The logic for sending individual parameter changes to the synth.
patch
The logic for sending entire patch dumps to the synth. Used when loading a new patch, and also when changes to multiple parameters occur very quickly.
name
Logic for sending a patch name update to the synth.
{
  multiPatch: MidiTransform.Fn.Whole,
  throttle?: Int,
  param?: MidiTransform.Fn.Param,
  name?: MidiTransform.Fn.Name
}

Used with MultiPatchTrusses that can have individual parameter changes sent to the synth (as opposed to some synths that only accept full patch dumps.)

throttle
Minimum time in milliseconds that Patch Base should wait between sending MIDI data to the synth.
param
The logic for sending individual parameter changes to the synth.
patch
The logic for sending entire patch dumps to the synth. Used when loading a new patch, and also when changes to multiple parameters occur very quickly.
name
Logic for sending a patch name update to the synth.
{
  singleBank: MidiTransform.Fn.BankPatch,
  throttle?: Int
}

], { try .single(throttle: $0.xq("throttle"), .bank($0.x("bank"))) }),

{
  compactSingleBank: Object,
  waitInterval?: Int
}

// assume a bank truss has been passed, and make a wholeBank out of it. let truss: SingleBankTruss = try $0.x() let fn = truss.core.createFileData let waitInterval: Int = try $0.xq("waitInterval") ?? 10 return .single(throttle: nil, .wholeBank(.init({ editor, bodyData in try fn.call(bodyData, editor).map { ($0, waitInterval) } }))) }),

{
  compactMultiBank: Object,
  waitInterval?: Int
}

// assume a bank truss has been passed, and make a wholeBank out of it. let truss: MultiBankTruss = try $0.x() let fn = truss.core.createFileData let waitInterval: Int = try $0.xq("waitInterval") ?? 10 return .multi(throttle: nil, .wholeBank(.init({ editor, bodyData in try fn.call(bodyData, editor).map { ($0, waitInterval) } }))) }),