repo stringclasses 7
values | lang stringclasses 2
values | aspect stringclasses 7
values | file stringlengths 5 48 | content stringlengths 283 144k |
|---|---|---|---|---|
AudioKit | swift | audio_dsp | MIDIMonoPolyListener.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
#if !os(tvOS)
import Foundation
import CoreMIDI
/// This class probably needs to support observers as well
/// so that a client may be able to be notified of state changes
///
/// This class is constructed to be s... |
AudioKit | swift | audio_dsp | MIDISystemRealTimeObserver.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
#if !os(tvOS)
import Foundation
/// MIDI System Real Time Observer
public protocol MIDISystemRealTimeObserver {
/// Called when a midi start system message is received
///
/// - Parameter srtListener: MI... |
AudioKit | swift | audio_dsp | MIDIObserverMaster.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import Foundation
/// Observer protocol
public protocol ObserverProtocol {
/// Equality test
/// - Parameter listener: Another listener
func isEqualTo(_ listener: ObserverProtocol) -> Bool
}
extension Obs... |
AudioKit | swift | audio_dsp | MIDIOmniListener.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
#if !os(tvOS)
import Foundation
import CoreMIDI
/// This class probably needs to support observers as well
/// so that a client may be able to be notified of state changes
public class MIDIOMNIListener: NSObject {
... |
AudioKit | swift | audio_dsp | MIDITempoObserver.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import Foundation
#if !os(tvOS)
/// MIDI Tempo Observer
public protocol MIDITempoObserver {
/// Called when a clock slave mode is entered and this client is not allowed to become a clock master
/// This sign... |
AudioKit | swift | audio_dsp | MIDITempoListener.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
// MIDI Spec
// 24 clocks/quarternote
// 96 clocks/4_beat_measure
//
// Ideas
// - Provide the standard deviation of differences in clock times to observe stability
//
// Looked at
// https://sta... |
AudioKit | swift | audio_dsp | MIDIBeatObserver.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
#if !os(tvOS)
import Foundation
import AVFoundation
/// Protocol so that clients may observe beat events
public protocol MIDIBeatObserver {
/// Called when the midi system real time start or continue message arri... |
AudioKit | swift | audio_dsp | MIDIClockListener.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
#if !os(tvOS)
import Foundation
import CoreMIDI
import os.log
/// This class is used to count midi clock events and inform observers
/// every 24 pulses (1 quarter note)
///
/// If you wish to observer its events, the... |
AudioKit | swift | audio_dsp | MIDISystemRealTimeListener.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
#if !os(tvOS)
import Foundation
import CoreMIDI
import os.log
/// This MIDIListener looks for midi system real time (SRT)
/// midi system messages.
open class MIDISystemRealTimeListener: NSObject {
enum SRTEvent: ... |
AudioKit | swift | audio_dsp | FFTTap.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import Accelerate
import AVFoundation
/// FFT Calculation for any node
open class FFTTap: BaseTap {
/// Array of FFT data
open var fftData: [Float]
/// Type of callback
public typealias Handler = ([Flo... |
AudioKit | swift | audio_dsp | Tap.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import Foundation
import AVFAudio
public protocol Tap {
func handleTap(buffer: AVAudioPCMBuffer, at time: AVAudioTime) async
}
extension Node {
public func install(tap: Tap, bufferSize: UInt32) {
// ... |
AudioKit | swift | audio_dsp | RawBufferTap.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
/// Get the raw buffer from any node
open class RawBufferTap: BaseTap {
/// Callback type
public typealias Handler = (AVAudioPCMBuffer, AVAudioTime) -> Void
private let handler: Handle... |
AudioKit | swift | audio_dsp | NodeRecorder.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
/// Simple audio recorder class, requires a minimum buffer length of 128 samples (.short)
open class NodeRecorder: NSObject {
// MARK: - Properties
/// The node we record from
public p... |
AudioKit | swift | audio_dsp | MultiChannelInputNodeTap+WriteableFile.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
public extension MultiChannelInputNodeTap {
/// An inner class to represent one channel of data to record to file
class WriteableFile: CustomStringConvertible {
/// Simple descripti... |
AudioKit | swift | audio_dsp | BaseTap.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
import Foundation
/// Base class for AudioKit taps using AVAudioEngine installTap
open class BaseTap {
private let callbackQueue: DispatchQueue
/// Size of buffer to analyze
public priv... |
AudioKit | swift | audio_dsp | AmplitudeTap.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import Accelerate
import AVFoundation
/// Tap to do amplitude analysis on any node.
/// start() will add the tap, and stop() will remove it.
public class AmplitudeTap: BaseTap {
private let channelCount: Int
p... |
AudioKit | swift | audio_dsp | MultiChannelInputNodeTap.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
/// MultiChannelInputNodeTap is a tap intended to process multiple channels of audio
/// from AVAudioInputNode, or the AVAudioEngine's inputNode. In the case of the engine
/// the input node will h... |
AudioKit | swift | audio_dsp | RawDataTap.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import Accelerate
import AVFoundation
/// Get the raw data for any node
open class RawDataTap: BaseTap {
/// Array of Raw data
open var data: [Float]
/// Callback type
public typealias Handler = ([Floa... |
AudioKit | swift | audio_dsp | Node+connectionTreeDescription.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import Foundation
public let connectionTreeLinePrefix = "AudioKit | "
extension Node {
/// Nice printout of all the node connections
public var connectionTreeDescription: String {
return String(create... |
AudioKit | swift | audio_dsp | NodeParameter.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
/// Definition or specification of a node parameter
public struct NodeParameterDef: Sendable {
/// Unique ID
public var identifier: String
/// Name
public var name: String
/// A... |
AudioKit | swift | audio_dsp | Node+Graphviz.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import Foundation
extension ObjectIdentifier {
var addressString: String {
String(debugDescription.dropFirst(17).dropLast(1))
}
}
#if !Swift6
fileprivate var labels: [ObjectIdentifier: String] = [:]
#... |
AudioKit | swift | audio_dsp | NodeStatus.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
/// Keep track of a node status
public enum NodeStatus {
/// Node status for a playback node
public enum Playback {
/// The player node is stopped.
case stopped
/// The player node is pl... |
AudioKit | swift | audio_dsp | Node.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
/// Node in an audio graph.
public protocol Node: AnyObject {
/// Nodes providing audio input to this node.
var connections: [Node] { get }
/// Internal AVAudioEngine node.
var avA... |
AudioKit | swift | audio_dsp | Node+disconnectStrategy.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFAudio
/// Describes a way to disconnect a node from another node
public enum DisconnectStrategy {
/// Recursively traverse node chain and disconnect
/// This strategy will keep connections from downs... |
AudioKit | swift | audio_dsp | Mixer.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
/// AudioKit version of Apple's Mixer Node. Mixes a variadic list of Nodes.
public class Mixer: Node, NamedNode {
/// The internal mixer node
fileprivate let mixerAU = AVAudioMixerNode()
... |
AudioKit | swift | audio_dsp | EnvironmentalNode.swift | import AVFoundation
public extension AVAudioEnvironmentNode {
/// Make a connection without breaking other connections.
/// Makes sure the Mixer3D connects to the EnviromentalNode In **MONO**
func connectMixer3D(_ input: AVAudioNode, engine: AVAudioEngine, format: AVAudioFormat) {
if let monoFormat... |
AudioKit | swift | audio_dsp | MatrixMixer.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
/// Matrix Mixer allows you to map X input channels to Y output channels.
/// There is almost no documentation about how matrix mixer audio unit works.
/// This implementation is a result of consolidating various onlin... |
AudioKit | swift | audio_dsp | Mixer3D.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
AudioKit version of Apple's Mixer Node. Mixes a variadic list of Nodes.
Mixer3D is based on AudioKit's Mixer class as much as possible.
You **MUST** use an instances of this class as endpoint o... |
AudioKit | swift | audio_dsp | TimePitch.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
/// AudioKit version of Apple's TimePitch Audio Unit
///
public class TimePitch: NamedNode {
fileprivate let timePitchAU = AVAudioUnitTimePitch()
let input: Node
/// Connected nodes
... |
AudioKit | swift | audio_dsp | VariSpeed.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
/// AudioKit version of Apple's VariSpeed Audio Unit
///
public class VariSpeed: NamedNode {
fileprivate let variSpeedAU = AVAudioUnitVarispeed()
let input: Node
/// Connected nodes
... |
AudioKit | swift | audio_dsp | AudioPlayer.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
/// Wrapper for AVAudioPlayerNode with a simplified API. The player exists in two interchangeable modes
/// either playing from memory (isBuffered) or streamed from disk. Longer files are recommend... |
AudioKit | swift | audio_dsp | AudioPlayer+Scheduling.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
extension AudioPlayer {
/// Schedule a file or buffer. You can call this to schedule playback in the future
/// or the player will call it when play() is called to load the audio data
/... |
AudioKit | swift | audio_dsp | AudioPlayer+Playback.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
public extension AudioPlayer {
// MARK: - Playback
/// Play now or at a future time
/// - Parameters:
/// - when: What time to schedule for. A value of nil means now or will
... |
AudioKit | swift | audio_dsp | AudioPlayer+Buffering.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
/// Functions specific to buffering audio
extension AudioPlayer {
// Fills the buffer with data read from the linked audio file
func updateBuffer() {
guard let file = file else {
... |
AudioKit | swift | audio_dsp | AudioPlayer+Legacy.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
public extension AudioPlayer {
/// Schedule a buffer to play at a a specific time, with options
/// - Parameters:
/// - buffer: Buffer to play
/// - when: Time to play
/// ... |
AudioKit | swift | audio_dsp | MultiSegmentAudioPlayer.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
/// audio player that can schedule many file segments
public class MultiSegmentAudioPlayer: NamedNode {
/// Nodes providing input to this node.
public var connections: [Node] { [] }
//... |
AudioKit | swift | audio_dsp | AppleSampler.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
/// Sampler audio generation.
///
/// 1. init the audio unit like this: var sampler = AppleSampler()
/// 2. load a sound a file: sampler.loadWav("path/to/your/sound/file/in/app/bundle") (without wa... |
AudioKit | swift | audio_dsp | PresetBuilder.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
//swiftlint:disable all
/// Builds presets for Apple sampler to read from
public class PresetBuilder {
fileprivate var presetXML = ""
fileprivate var layers = [String]()
fileprivate var... |
AudioKit | swift | audio_dsp | AppleSampler+getAUPresetXML.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
extension AppleSampler {
static func getAUPresetXML() -> String {
var templateStr = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
templateStr.append("<!DOCTYPE plist PUBLIC \"-... |
AudioKit | swift | audio_dsp | AppleSampler+SoundFonts.swift | import AVFoundation
// SoundFont Support
public extension AppleSampler {
internal func loadSoundFont(_ file: String, preset: Int, type: Int, in bundle: Bundle = .main) throws {
guard let url = findFileURL(file, withExtension: ["sf2", "dls"], in: bundle) else {
Log("SoundFont file not found: \(f... |
AudioKit | swift | audio_dsp | PlaygroundNoiseGenerator.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
import CoreAudio // for UnsafeMutableAudioBufferListPointer
/// Pure Swift Noise Generator
@available(macOS 10.15, iOS 13.0, tvOS 13.0, *)
public class PlaygroundNoiseGenerator: NamedNode {
fil... |
AudioKit | swift | audio_dsp | PlaygroundOscillator.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
import CoreAudio
let twoPi = 2 * Float.pi
/// Pure Swift oscillator
@available(macOS 10.15, iOS 13.0, tvOS 13.0, *)
public class PlaygroundOscillator: NamedNode {
fileprivate lazy var sourceNo... |
AudioKit | swift | audio_dsp | Delay.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
/// AudioKit version of Apple's Delay Audio Unit
///
public class Delay: NamedNode {
let delayAU = AVAudioUnitDelay()
let input: Node
/// Connected nodes
public var connections: [... |
AudioKit | swift | audio_dsp | Reverb.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
/// AudioKit version of Apple's Reverb Audio Unit
///
public class Reverb: NamedNode {
fileprivate let reverbAU = AVAudioUnitReverb()
let input: Node
/// Connected nodes
public va... |
AudioKit | swift | audio_dsp | NewPitch.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFAudio
/// `AUNewPitch` audio unit
/// This is different to `AUNewTimePitch` (`AVAudioUnitTimePitch`).
/// `AUNewTimePitch` does both time stretching and pitch shifting.
/// `AUNewTimePitch` is `AVAudioUnitTi... |
AudioKit | swift | audio_dsp | LowPassFilter.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
// This file was auto-autogenerated by scripts and templates at http://github.com/AudioKit/AudioKitDevTools/
import AVFoundation
/// AudioKit version of Apple's LowPassFilter Audio Unit
///
public class LowPassFilter:... |
AudioKit | swift | audio_dsp | ParametricEQ.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
// This file was auto-autogenerated by scripts and templates at http://github.com/AudioKit/AudioKitDevTools/
import AVFoundation
/// AudioKit version of Apple's ParametricEQ Audio Unit
///
public class ParametricEQ: N... |
AudioKit | swift | audio_dsp | LowShelfFilter.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
// This file was auto-autogenerated by scripts and templates at http://github.com/AudioKit/AudioKitDevTools/
import AVFoundation
/// AudioKit version of Apple's LowShelfFilter Audio Unit
///
public class LowShelfFilte... |
AudioKit | swift | audio_dsp | BandPassFilter.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
// This file was auto-autogenerated by scripts and templates at http://github.com/AudioKit/AudioKitDevTools/
import AVFoundation
/// AudioKit version of Apple's BandPassFilter Audio Unit
///
public class BandPassFilte... |
AudioKit | swift | audio_dsp | HighShelfFilter.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
// This file was auto-autogenerated by scripts and templates at http://github.com/AudioKit/AudioKitDevTools/
import AVFoundation
/// AudioKit version of Apple's HighShelfFilter Audio Unit
///
public class HighShelfFil... |
AudioKit | swift | audio_dsp | HighPassFilter.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
// This file was auto-autogenerated by scripts and templates at http://github.com/AudioKit/AudioKitDevTools/
import AVFoundation
/// AudioKit version of Apple's HighPassFilter Audio Unit
///
public class HighPassFilte... |
AudioKit | swift | audio_dsp | PeakLimiter.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
// This file was auto-autogenerated by scripts and templates at http://github.com/AudioKit/AudioKitDevTools/
import AVFoundation
/// AudioKit version of Apple's PeakLimiter Audio Unit
///
public class PeakLimiter: Nam... |
AudioKit | swift | audio_dsp | Expander.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
// This file was auto-autogenerated by scripts and templates at http://github.com/AudioKit/AudioKitDevTools/
import AVFoundation
/// AudioKit version of Apple's Expander Audio Unit
///
public class Expander: NamedNode... |
AudioKit | swift | audio_dsp | DynamicsProcessor.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
// This file was auto-autogenerated by scripts and templates at http://github.com/AudioKit/AudioKitDevTools/
import AVFoundation
/// AudioKit version of Apple's DynamicsProcessor Audio Unit
///
public class DynamicsPr... |
AudioKit | swift | audio_dsp | Compressor.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
// This file was auto-autogenerated by scripts and templates at http://github.com/AudioKit/AudioKitDevTools/
import AVFoundation
/// AudioKit version of Apple's Compressor Audio Unit
///
public class Compressor: Named... |
AudioKit | swift | audio_dsp | Decimator.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
// This file was auto-autogenerated by scripts and templates at http://github.com/AudioKit/AudioKitDevTools/
import AVFoundation
/// AudioKit version of Apple's Decimator Audio Unit
///
public class Decimator: NamedNo... |
AudioKit | swift | audio_dsp | RingModulator.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
// This file was auto-autogenerated by scripts and templates at http://github.com/AudioKit/AudioKitDevTools/
import AVFoundation
/// AudioKit version of Apple's RingModulator Audio Unit
///
public class RingModulator:... |
AudioKit | swift | audio_dsp | Distortion.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
// This file was auto-autogenerated by scripts and templates at http://github.com/AudioKit/AudioKitDevTools/
import AVFoundation
/// AudioKit version of Apple's Distortion Audio Unit
///
public class Distortion: Named... |
AudioKit | swift | audio_dsp | AppleDistortion.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
/// AudioKit version of Apple's Distortion Audio Unit
///
@available(iOS 8.0, *)
public class AppleDistortion: NamedNode {
fileprivate let distAU = AVAudioUnitDistortion()
let input: Node
... |
AudioKit | swift | audio_dsp | AVAudioNode+AudioKitAudioUnit.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
extension AVAudioNode {
var audioKitAudioUnit: AUAudioUnit {
let selector = NSSelectorFromString("AUAudioUnit")
guard responds(to: selector),
let result = perform(... |
AudioKit | swift | audio_dsp | Settings+iOSVariants.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
#if !os(macOS)
import AVFoundation
import Foundation
import os.log
public extension Settings {
/// Global audio format AudioKit will default to for new objects and connections
/// - Ta... |
AudioKit | swift | audio_dsp | Settings+macOS.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
#if os(macOS)
import AVFoundation
import os.log
extension Settings {
/// Global audio format AudioKit will default to for new objects and connections
/// - Tag: SettingsAudioFormat
public static var audio... |
AudioKit | swift | audio_dsp | Settings.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
import Foundation
/// Global settings for AudioKit
public class Settings: NSObject {
/// Enum of available buffer lengths
/// from Shortest: 2 power 5 samples (32 samples = 0.7 ms @ 44100 k... |
AudioKit | swift | audio_dsp | AVAudioEngine+Devices.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
import Foundation
#if os(macOS)
extension AVAudioEngine {
func setDevice(id: AudioDeviceID) {
var outputID = id
if let outputUnit = outputNode.audioUnit {
let error ... |
AudioKit | swift | audio_dsp | DeviceUtils.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
#if os(macOS)
import CoreAudio
import Foundation
struct AudioDeviceUtils {
static func devices() -> [AudioDeviceID] {
var propsize: UInt32 = 0
var address: AudioObjectPropertyAddress = AudioObject... |
AudioKit | swift | audio_dsp | Device.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
#if os(macOS)
/// DeviceID isan AudioDeviceID on macOS
public typealias DeviceID = AudioDeviceID
#else
/// DeviceID is a string on iOS
public typealias DeviceID = String
#endif
import AVFoundation
/// Wrapper for aud... |
AudioKit | swift | audio_dsp | MemoryAddress.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import Foundation
public struct MemoryAddress: CustomStringConvertible {
let opaquePointerAddress: Int
public var description: String {
let size = 2 + 2 * MemoryLayout<UnsafeRawPointer>.size
r... |
AudioKit | swift | audio_dsp | AVAudioTimeShim.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
// TODO: write unit tests.
/// Utility to convert between host time and seconds
private let ticksToSeconds: Double = {
var tinfo = mach_timebase_info()
let err = mach_timebase_info(&tinfo)... |
AudioKit | swift | audio_dsp | Log.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import Foundation
import os
private let subsystem = "io.audiokit"
public extension OSLog {
/// Generic AudioKit log
static let general = OSLog(subsystem: subsystem, category: "general")
/// Settings-rela... |
AudioKit | swift | audio_dsp | AVAudioPCMBuffer+audition.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
public extension AVAudioPCMBuffer {
/// Audition the buffer. Especially useful in AudioKit testing
func audition() {
let engine = AudioEngine()
let player = AudioPlayer()
... |
AudioKit | swift | audio_dsp | AudioKitHelpers.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import Accelerate
import AudioToolbox
import AVFoundation
import CoreAudio
// TODO: write unit tests.
/// Normally set in AVFoundation or AudioToolbox,
/// we create it here so users don't have to import those framew... |
AudioKit | swift | audio_dsp | ThreadLockedAccessor.swift | // ThreadLockedAccessor.swift
// MIDIKit
// Created by Steffan Andrews on 2020-12-20.
import Darwin
/// A property wrapper that ensures atomic access to a value, meaning thread-safe with implicit serial read/write access.
///
/// Multiple read accesses can potentially read at the same time, just not during a write... |
AudioKit | swift | audio_dsp | MusicalDuration.swift | import Foundation
public enum MusicalDuration: Int, CaseIterable {
case thirtysecond
case thirtysecondDotted
case sixteenth
case sixteenthDotted
case eighth
case eighthDotted
case quarter
case quarterDotted
case half
case halfDotted
case whole
case wholeDotted
publi... |
AudioKit | swift | audio_dsp | Table.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
/// Supported default table types
public enum TableType {
/// Standard sine waveform
case sine
/// Standard triangle waveform
case triangle
/// Standard square waveform
ca... |
AudioKit | swift | audio_dsp | Table+AdditiveSynthesis.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import Accelerate
import Foundation
// TODO: Write unit tests.
public extension Table {
/// This method will start at rootFrequency * octave, walk up by octaveStepSize, and halt before reaching nyquist.
/// T... |
AudioKit | swift | audio_dsp | AudioUnit+Helpers.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
#if !os(macOS)
import AVFoundation
import CoreAudio
// MARK: - AudioUnit helpers
/// Get, set, and listen to properties
public extension AudioUnit {
/// Get value for a property
func getValue<T>(forProperty ... |
AudioKit | swift | audio_dsp | AudioComponentDescription+Helpers.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
public extension AUParameterTree {
/// Look up parameters by key
subscript(key: String) -> AUParameter? {
return value(forKey: key) as? AUParameter
}
}
/// Adding convenience i... |
AudioKit | swift | audio_dsp | AVAudioUnit+Helpers.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFAudio
func instantiate(componentDescription: AudioComponentDescription) -> AVAudioUnit {
let (avAudioUnit, error) = instantiate(description: componentDescription)
guard let avAudioUnit else {
... |
AudioKit | swift | audio_dsp | CommonError.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import Foundation
// CommonError is an enum with descriptions so we can throw generic errors
// and hopefully provide more detail to developers when code fails
// Please feel free to add any errors you need especially... |
AudioKit | swift | audio_dsp | CheckError.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
import os.log
// Print out a more human readable error message
///
/// - parameter error: OSStatus flag
///
public func CheckError(_ error: OSStatus) {
#if os(tvOS) // No CoreMIDI
switc... |
AudioKit | swift | audio_dsp | AVAudioEngine+Extensions.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import Accelerate
import AVFoundation
import Foundation
// TODO: add unit test.
public extension AVAudioEngine {
/// Render output to an AVAudioFile for a duration.
/// - Parameters
/// - audi... |
AudioKit | swift | audio_dsp | AudioEngine.swift | // Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
import AVFoundation
extension AVAudioNode {
/// Disconnect without breaking other connections.
func disconnect(input: AVAudioNode, engine: AVAudioEngine, format: AVAudioFormat) {
var newConnections: [A... |
AudioKit | swift | audio_dsp | Contents.swift | import AudioKit
import Foundation
let osc = PlaygroundOscillator()
let engine = AudioEngine()
engine.output = osc
try! engine.start()
osc.play()
while true {
osc.frequency = Float.random(in: 200 ... 800)
osc.amplitude = Float.random(in: 0.0 ... 0.3)
usleep(100_000)
} |
swift-numerics | swift | numerics | Package.swift | // swift-tools-version:5.9
//===--- Package.swift ----------------------------------------*- swift -*-===//
//
// This source file is part of the Swift Numerics open source project
//
// Copyright (c) 2019-2025 Apple Inc. and the Swift Numerics project authors
// Licensed under Apache License v2.0 with Runtime Library ... |
swift-numerics | swift | numerics | ElementaryFunctionChecks.swift | //===--- ElementaryFunctionChecks.swift ------------------------*- swift -*-===//
//
// This source file is part of the Swift Numerics open source project
//
// Copyright (c) 2019 Apple Inc. and the Swift Numerics project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swi... |
swift-numerics | swift | numerics | DoubleWidth.swift | //===--- DoubleWidth.swift ------------------------------------*- swift -*-===//
//
// This source file is part of the Swift Numerics open source project
//
// Copyright (c) 2017-2024 Apple Inc. and the Swift Numerics project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https:/... |
swift-numerics | swift | numerics | Error.swift | //===--- Error.swift ------------------------------------------*- swift -*-===//
//
// This source file is part of the Swift Numerics open source project
//
// Copyright (c) 2020 Apple Inc. and the Swift Numerics project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swif... |
swift-numerics | swift | numerics | Interval.swift | //===--- Interval.swift ---------------------------------------*- swift -*-===//
//
// This source file is part of the Swift Numerics open source project
//
// Copyright (c) 2020 Apple Inc. and the Swift Numerics project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swif... |
swift-numerics | swift | numerics | BlackHole.swift | //===--- BlackHole.swift --------------------------------------*- swift -*-===//
//
// This source file is part of the Swift Numerics open source project
//
// Copyright (c) 2021 Apple Inc. and the Swift Numerics project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swif... |
swift-numerics | swift | numerics | AugmentedArithmetic.swift | //===--- AugmentedArithmetic.swift ----------------------------*- swift -*-===//
//
// This source file is part of the Swift Numerics open source project
//
// Copyright (c) 2020-2025 Apple Inc. and the Swift Numerics project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https:/... |
swift-numerics | swift | numerics | AlgebraicField.swift | //===--- AlgebraicField.swift ---------------------------------*- swift -*-===//
//
// This source file is part of the Swift Numerics open source project
//
// Copyright (c) 2019-2025 Apple Inc. and the Swift Numerics project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https:/... |
swift-numerics | swift | numerics | Float16+Real.swift | //===--- Float16+Real.swift -----------------------------------*- swift -*-===//
//
// This source file is part of the Swift Numerics open source project
//
// Copyright (c) 2020 Apple Inc. and the Swift Numerics project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swif... |
swift-numerics | swift | numerics | ApproximateEquality.swift | //===--- ApproximateEquality.swift ----------------------------*- swift -*-===//
//
// This source file is part of the Swift Numerics open source project
//
// Copyright (c) 2020-2025 Apple Inc. and the Swift Numerics project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https:/... |
swift-numerics | swift | numerics | Real.swift | //===--- Real.swift -------------------------------------------*- swift -*-===//
//
// This source file is part of the Swift Numerics open source project
//
// Copyright (c) 2019-2025 Apple Inc. and the Swift Numerics project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https:/... |
swift-numerics | swift | numerics | Double+Real.swift | //===--- Double+Real.swift ------------------------------------*- swift -*-===//
//
// This source file is part of the Swift Numerics open source project
//
// Copyright (c) 2019-2025 Apple Inc. and the Swift Numerics project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https:/... |
swift-numerics | swift | numerics | Float80+Real.swift | //===--- Float80+Real.swift -----------------------------------*- swift -*-===//
//
// This source file is part of the Swift Numerics open source project
//
// Copyright (c) 2019 Apple Inc. and the Swift Numerics project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swif... |
swift-numerics | swift | numerics | Float+Real.swift | //===--- Float+Real.swift -------------------------------------*- swift -*-===//
//
// This source file is part of the Swift Numerics open source project
//
// Copyright (c) 2019 Apple Inc. and the Swift Numerics project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swif... |
swift-numerics | swift | numerics | RelaxedArithmetic.swift | //===--- RelaxedArithmetic.swift ------------------------------*- swift -*-===//
//
// This source file is part of the Swift Numerics open source project
//
// Copyright (c) 2021-2025 Apple Inc. and the Swift Numerics project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https:/... |
swift-numerics | swift | numerics | ElementaryFunctions.swift | //===--- ElementaryFunctions.swift ----------------------------*- swift -*-===//
//
// This source file is part of the Swift Numerics open source project
//
// Copyright (c) 2019-2025 Apple Inc. and the Swift Numerics project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https:/... |
swift-numerics | swift | numerics | RealFunctions.swift | //===--- RealFunctions.swift ----------------------------------*- swift -*-===//
//
// This source file is part of the Swift Numerics open source project
//
// Copyright (c) 2019-2025 Apple Inc. and the Swift Numerics project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https:/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.