Tightened the source code and README documentations in the library.
This commit is contained in:
@@ -1,16 +1,14 @@
|
||||
extension Sound.Signal {
|
||||
/// Custom signal callbacks.
|
||||
/// Custom signal callbacks, run on the audio render thread; return quickly.
|
||||
public struct Callbacks {
|
||||
/// Returns the signal's value at the end of the current cycle.
|
||||
/// `ioFrames` is the number of frames until the cycle ends and
|
||||
/// may be lowered to interpolate toward `interpolationValue`.
|
||||
/// Returns the value at the end of the cycle; `ioFrames` holds its frames left. For
|
||||
/// a mid-cycle value, write it to `interpolationValue`, set `ioFrames` to its offset.
|
||||
public var step: (_ ioFrames: UnsafeMutablePointer<Int32>?,
|
||||
_ interpolationValue: UnsafeMutablePointer<Float>?) -> Float
|
||||
/// Called on note-on events. `length` is -1 for indefinite notes.
|
||||
/// `length` is in seconds, or -1 if indefinite.
|
||||
public var noteOn: ((_ note: Sound.MIDINote, _ velocity: Float, _ length: Float) -> Void)?
|
||||
/// Called on note-off events. `stopped` is `false` when the note
|
||||
/// is released and `true` when it actually stops playing;
|
||||
/// `offset` is the frame offset within the current cycle.
|
||||
/// `stopped` is `false` on release, `true` on stop; `offset` is the frame offset
|
||||
/// into the cycle.
|
||||
public var noteOff: ((_ stopped: Bool, _ offset: Int) -> Void)?
|
||||
|
||||
public init(step: @escaping (_ ioFrames: UnsafeMutablePointer<Int32>?,
|
||||
|
||||
Reference in New Issue
Block a user