repo
stringclasses
7 values
lang
stringclasses
2 values
aspect
stringclasses
7 values
file
stringlengths
5
48
content
stringlengths
283
144k
nom
rust
parsers
internal.rs
use self::Needed::*; use crate::error::{self, ErrorKind, FromExternalError, ParseError}; use crate::lib::std::fmt; use core::marker::PhantomData; use core::num::NonZeroUsize; /// Holds the result of parsing functions /// /// It depends on the input type `I`, the output type `O`, and the error type `E` /// (by default ...
nom
rust
parsers
macros.rs
macro_rules! succ ( (0, $submac:ident ! ($($rest:tt)*)) => ($submac!(1, $($rest)*)); (1, $submac:ident ! ($($rest:tt)*)) => ($submac!(2, $($rest)*)); (2, $submac:ident ! ($($rest:tt)*)) => ($submac!(3, $($rest)*)); (3, $submac:ident ! ($($rest:tt)*)) => ($submac!(4, $($rest)*)); (4, $submac:ident ! ($($rest:t...
nom
rust
parsers
traits.rs
use core::iter::Enumerate; use core::str::CharIndices; use crate::error::{ErrorKind, ParseError}; use crate::internal::{Err, IResult, Needed}; use crate::lib::std::iter::Copied; use crate::lib::std::ops::{ Bound, Range, RangeBounds, RangeFrom, RangeFull, RangeInclusive, RangeTo, RangeToInclusive, }; use crate::lib::...
nom
rust
parsers
mod.rs
#[cfg(test)] mod tests; use core::marker::PhantomData; use crate::error::ErrorKind; use crate::error::ParseError; use crate::internal::{Err, Mode, Parser}; /// Tests a list of parsers one by one until one succeeds. /// /// It takes as argument either a tuple or an array of parsers. If using a /// tuple, there is a m...
nom
rust
parsers
mod.rs
pub mod complete; pub mod streaming; #[cfg(test)] mod tests; use core::marker::PhantomData; use crate::error::ErrorKind; use crate::error::ParseError; use crate::internal::{Err, Needed, Parser}; use crate::lib::std::result::Result::*; use crate::traits::{Compare, CompareResult}; use crate::AsChar; use crate::Check; u...
nom
rust
parsers
complete.rs
use core::marker::PhantomData; use crate::error::ParseError; use crate::internal::{IResult, Parser}; use crate::traits::{Compare, FindSubstring, FindToken, ToUsize}; use crate::Complete; use crate::Emit; use crate::Input; use crate::OutputM; /// Recognizes a pattern /// /// The input data will be compared to the tag ...
nom
rust
parsers
mod.rs
use core::marker::PhantomData; use crate::error::ErrorKind; use crate::FindToken; use crate::IsStreaming; use crate::Mode; use crate::{error::ParseError, AsChar, Err, IResult, Input, Needed, Parser}; #[cfg(test)] mod tests; pub mod complete; pub mod streaming; #[inline] #[doc(hidden)] #[deprecated(since = "8.0.0", ...
nom
rust
parsers
complete.rs
use crate::branch::alt; use crate::combinator::opt; use crate::error::ErrorKind; use crate::error::ParseError; use crate::internal::{Err, IResult}; use crate::traits::{AsChar, FindToken, Input}; use crate::traits::{Compare, CompareResult}; use crate::Complete; use crate::Emit; use crate::OutputM; use crate::Parser; //...
nom
rust
parsers
mod.rs
#[cfg(test)] mod tests; use core::marker::PhantomData; use crate::bytes::take; use crate::error::ErrorKind; use crate::error::ParseError; use crate::internal::{Err, Needed, Parser}; use crate::lib::std::num::NonZeroUsize; #[cfg(feature = "alloc")] use crate::lib::std::vec::Vec; use crate::traits::ToUsize; use crate::...
nom
rust
parsers
mod.rs
use core::{ marker::PhantomData, ops::{Add, Shl}, }; use crate::{ branch::alt, character::{char, digit1}, combinator::{cut, map, opt, recognize}, error::{make_error, ErrorKind, ParseError}, sequence::pair, AsBytes, AsChar, Compare, Either, Emit, Err, Input, IsStreaming, Mode, Needed, Offset, OutputM, ...
nom
rust
parsers
complete.rs
use crate::branch::alt; use crate::bytes::complete::tag; use crate::character::complete::{char, digit1, sign}; use crate::combinator::{cut, map, opt, recognize}; use crate::error::ErrorKind; use crate::error::ParseError; use crate::internal::*; use crate::lib::std::ops::{Add, Shl}; use crate::sequence::pair; use crate:...
nom
rust
parsers
mod.rs
pub mod complete; pub mod streaming; use crate::error::{ErrorKind, ParseError}; use crate::internal::{Err, IResult, Needed, Parser}; use crate::traits::ErrorConvert; use crate::Input; /// Converts a byte-level input to a bit-level input, for consumption by a parser that uses bits. /// /// Afterwards, the input is con...
nom
rust
parsers
complete.rs
use crate::error::{ErrorKind, ParseError}; use crate::internal::{Err, IResult}; use crate::lib::std::ops::{AddAssign, Div, Shl, Shr}; use crate::traits::{Input, ToUsize}; /// Generates a parser taking `count` bits /// /// # Example /// ```rust /// # use nom::bits::complete::take; /// # use nom::IResult; /// # use nom:...
nom
rust
parsers
mod.rs
#![allow(unused_imports)] use core::marker::PhantomData; #[cfg(feature = "alloc")] use crate::lib::std::boxed::Box; use crate::error::{ErrorKind, FromExternalError, ParseError}; use crate::internal::*; use crate::lib::std::borrow::Borrow; use crate::lib::std::convert::Into; #[cfg(feature = "std")] use crate::lib::st...
nom
rust
parsers
mod.rs
#[cfg(test)] mod tests; use crate::error::ParseError; use crate::internal::{IResult, Parser}; use crate::{Check, OutputM, OutputMode, PResult}; /// Gets an object from the first parser, /// then gets another object from the second parser. /// /// # Arguments /// * `first` The first parser to apply. /// * `second` The...
swift-algorithms
swift
algorithms
Package.swift
// swift-tools-version:5.7 //===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2020 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception //...
swift-algorithms
swift
algorithms
FlattenCollection.swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2021 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift-algorithms
swift
algorithms
EndsWith.swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2021 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift-algorithms
swift
algorithms
Chunked.swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2020 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift-algorithms
swift
algorithms
Split.swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2021 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift-algorithms
swift
algorithms
Trim.swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2020 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift-algorithms
swift
algorithms
Permutations.swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2020 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift-algorithms
swift
algorithms
Unique.swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2020 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift-algorithms
swift
algorithms
Chain.swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2020 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift-algorithms
swift
algorithms
Indexed.swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2020 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift-algorithms
swift
algorithms
FirstNonNil.swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2020 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift-algorithms
swift
algorithms
Compacted.swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2021 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift-algorithms
swift
algorithms
Intersperse.swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2020 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift-algorithms
swift
algorithms
Cycle.swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2020 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift-algorithms
swift
algorithms
Suffix.swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2021 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift-algorithms
swift
algorithms
Combinations.swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2020-2021 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift....
swift-algorithms
swift
algorithms
Rotate.swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2020 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift-algorithms
swift
algorithms
EitherSequence.swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2021 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift-algorithms
swift
algorithms
AdjacentPairs.swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2021 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift-algorithms
swift
algorithms
Partition.swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2020-2021 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift....
swift-algorithms
swift
algorithms
Product.swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2020 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift-algorithms
swift
algorithms
Grouped.swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2021 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift-algorithms
swift
algorithms
Reductions.swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2020 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift-algorithms
swift
algorithms
RandomSample.swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2020 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift-algorithms
swift
algorithms
Joined.swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2020 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift-algorithms
swift
algorithms
Windows.swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2020 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift-algorithms
swift
algorithms
Stride.swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2020 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift-algorithms
swift
algorithms
Keyed.swift
//===----------------------------------------------------------------------===// // // This source file is part of the Swift Algorithms open source project // // Copyright (c) 2020 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
AudioKit
swift
audio_dsp
Package@swift-6.1.swift
// swift-tools-version:6.1 import PackageDescription let package = Package( name: "AudioKit", platforms: [.macOS(.v11), .iOS(.v13), .tvOS(.v13), .visionOS(.v1)], products: [.library(name: "AudioKit", targets: ["AudioKit"])], traits: [ .trait(name: "Swift6"), ], targets: [ .targ...
AudioKit
swift
audio_dsp
Package.swift
// swift-tools-version:5.9 import PackageDescription let package = Package( name: "AudioKit", platforms: [.macOS(.v11), .iOS(.v13), .tvOS(.v13), .visionOS(.v1)], products: [.library(name: "AudioKit", targets: ["AudioKit"])], targets: [ .target( name: "AudioKit", resourc...
AudioKit
swift
audio_dsp
ValidatedMD5s.swift
import AVFoundation import XCTest extension XCTestCase { func testMD5(_ buffer: AVAudioPCMBuffer) { let localMD5 = buffer.md5 let name = description XCTAssertFalse(buffer.isSilent) XCTAssert(validatedMD5s[name]!.contains(buffer.md5), "\nFAILEDMD5 \"\(name)\": \"\(localMD5)\",") ...
AudioKit
swift
audio_dsp
ConstantGenerator.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import AudioKit import AVFAudio @available(macOS 10.15, iOS 13.0, tvOS 13.0, *) public class ConstantGenerator: Node { public var connections: [Node] { [] } public private(set) var avAudioNode: AVAudioNode ...
AudioKit
swift
audio_dsp
CustomFormatReverb.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import AudioKit import AVFAudio class CustomFormatReverb: Node { private let reverb: Reverb var avAudioNode: AVAudioNode { reverb.avAudioNode } var connections: [Node] { reverb.connections } var output...
AudioKit
swift
audio_dsp
UMPSysex.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ private extension UInt8 { init(highNibble: UInt8, lowNibble: UInt8) { self = highNibble << 4 + lowNibble & 0x0F } var highNibble: UInt8 { self >> 4 } var lowNibble: UInt8 { s...
AudioKit
swift
audio_dsp
AVAudioPCMBuffer+Utilities.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import AVFoundation import CryptoKit public extension AVAudioPCMBuffer { /// Hash useful for testing var md5: String { var sampleData = Data() if let floatChannelData = floatChannelData { ...
AudioKit
swift
audio_dsp
WaveformDataRequest.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import Accelerate import AVFoundation /// Request to get data out of an audio file public class WaveformDataRequest { /// Audio file get data from public private(set) var audioFile: AVAudioFile? private l...
AudioKit
swift
audio_dsp
AVAudioPCMBuffer+Processing.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import Accelerate import AVFoundation public extension AVAudioPCMBuffer { /// Read the contents of the url into this buffer convenience init?(url: URL) throws { guard let file = try? AVAudioFile(forRea...
AudioKit
swift
audio_dsp
AVAudioFile+Utilities.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import Accelerate import AVFoundation public extension AVAudioFile { /// Duration in seconds var duration: TimeInterval { Double(length) / fileFormat.sampleRate } /// returns the max level in ...
AudioKit
swift
audio_dsp
FormatConverter.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import AVFoundation FormatConverter wraps the more complex AVFoundation and CoreAudio audio conversions in an easy to use format. ```swift let options = FormatConverter.Options() // any options left nil will adop...
AudioKit
swift
audio_dsp
FormatConverter+PCM.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import Accelerate import AVFoundation // MARK: - internal helper functions extension FormatConverter { func convertToPCM(completionHandler: FormatConverterCallback? = nil) { guard let inputURL = inputURL ...
AudioKit
swift
audio_dsp
FormatConverter+Utilities.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import AVFoundation extension FormatConverter { class func createError(message: String, code: Int = 1) -> NSError { let userInfo = [NSLocalizedDescriptionKey: message] return NSError(domain: "com.a...
AudioKit
swift
audio_dsp
FormatConverter+Compressed.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import AVFoundation // MARK: - internal helper functions extension FormatConverter { /// Example of the most simplistic AVFoundation conversion. /// With this approach you can't really specify any settings ot...
AudioKit
swift
audio_dsp
Duration.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ /// Type alias for Tempo to make it clear when we're working with tempo in beats per minute public typealias BPM = Double import AVFoundation /// Container for the notion of time in sequencing public struct Duration:...
AudioKit
swift
audio_dsp
MusicTrack+Events.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import AVFoundation import Foundation public extension MusicTrackManager { /// Array of Apple MIDI Events var eventData: [AppleMIDIEvent]? { return getRawEventData() } /// Array of Apple MIDI ...
AudioKit
swift
audio_dsp
MIDIMetaEvent+allocate.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import AVFoundation import Foundation extension MIDIMetaEvent { /// `MIDIMetaEvent` is a variable length C structure. YOU MUST create one using this function /// if the data is of length > 0. /// - Parame...
AudioKit
swift
audio_dsp
AppleSequencer.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import AVFoundation /// Sequencer based on tried-and-true CoreAudio/MIDI Sequencing open class AppleSequencer: NSObject { /// Music sequence open var sequence: MusicSequence? /// Pointer to Music Sequence...
AudioKit
swift
audio_dsp
TimeSignature.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import Foundation /// Time Signature public struct TimeSignature: CustomStringConvertible, Equatable { /// Denominator of the time signature public enum TimeSignatureBottomValue: UInt8 { /// According ...
AudioKit
swift
audio_dsp
MusicTrack+Load.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import AVFoundation extension MusicTrackManager { func loadMIDI(filePath: String) { Log("loading file from exists @ \(filePath)") let fileURL = URL(fileURLWithPath: filePath) var tempSeq: M...
AudioKit
swift
audio_dsp
MusicTrack.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import AVFoundation /// Wrapper for internal Apple MusicTrack open class MusicTrackManager { // MARK: - Properties /// The representation of Apple's underlying music track open var internalMusicTrack: Mus...
AudioKit
swift
audio_dsp
UnsafeMIDIMetaEventPointer.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import AudioToolbox import Foundation /// Helper for accessing the data of `MIDIMetaEvent`. struct UnsafeMIDIMetaEventPointer { let event: UnsafePointer<MIDIMetaEvent> let payload: UnsafeBufferPointer<UInt8> ...
AudioKit
swift
audio_dsp
MIDICallbackInstrument.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ #if !os(tvOS) import AVFoundation /// Function type for MIDI callbacks public typealias MIDICallback = (MIDIByte, MIDIByte, MIDIByte) -> Void /// MIDI Instrument that triggers functions on MIDI note on/off commands ...
AudioKit
swift
audio_dsp
BluetoothMIDIButton.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ #if os(iOS) import CoreAudioKit /// Bluetooth MIDI Central View Controller class BTMIDICentralViewController: CABTMIDICentralViewController { var uiViewController: UIViewController? /// Called when subview ar...
AudioKit
swift
audio_dsp
MIDI.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ #if !os(tvOS) import CoreMIDI import os.log /// MIDI input and output handler public class MIDI { /// Shared singleton public static var sharedInstance = MIDI() // MARK: - Properties /// MIDI Client...
AudioKit
swift
audio_dsp
MIDIInstrument.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import AVFoundation import CoreAudio #if !os(tvOS) /// A version of Instrument specifically targeted to instruments that /// should be triggerable via MIDI or sequenced with the sequencer. open class MIDIInstrument: ...
AudioKit
swift
audio_dsp
MIDITransformer.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ #if !os(tvOS) import os.log /// MIDI Transformer converting an array of MIDI events into another array public protocol MIDITransformer { /// Transform an array of MIDI events into another array /// - Paramete...
AudioKit
swift
audio_dsp
MIDIListener.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ /// Protocol that must be adhered to if you want your class to respond to MIDI /// /// Implement the MIDIListener protocol on any classes that need to respond /// to incoming MIDI events. Every method in the protocol ...
AudioKit
swift
audio_dsp
MIDI+Sending.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ #if !os(tvOS) import os.log import AVFoundation private let sizeOfMIDIPacketList = MemoryLayout<MIDIPacketList>.size private let sizeOfMIDIPacket = MemoryLayout<MIDIPacket>.size /// The `MIDIPacketList` struct consi...
AudioKit
swift
audio_dsp
MIDI+VirtualPorts.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ #if !os(tvOS) import CoreMIDI import os.log extension MIDI { // MARK: - Virtual MIDI // // Virtual MIDI Goals // * Simplicity in creating a virtual input and virtual output ports together // ...
AudioKit
swift
audio_dsp
MIDI+Extensions.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import Foundation extension MIDIByte { /// This limits the range to be from 0 to 127 func lower7bits() -> MIDIByte { return self & 0x7F } /// [Recommendation] - half of a byte is called a nibb...
AudioKit
swift
audio_dsp
MIDIEvent.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ #if !os(tvOS) import CoreMIDI import os.log /// A container for the values that define a MIDI event public struct MIDIEvent: MIDIMessage, Equatable, Sendable { /// Internal data public var data = [MIDIByt...
AudioKit
swift
audio_dsp
MIDIEndpointInfo.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ #if !os(tvOS) /// MIDI Endpoint Information import AVFoundation /// Information about a MIDI Endpoint public struct EndpointInfo: Hashable, Codable { /// Unique name public var name = "" /// Display nam...
AudioKit
swift
audio_dsp
MIDINoteData.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ /// Struct holding relevant data for MusicTrackManager note events public struct MIDINoteData: CustomStringConvertible, Equatable { /// MIDI Note Number public var noteNumber: MIDINoteNumber /// MIDI Veloc...
AudioKit
swift
audio_dsp
MIDISampler.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ #if !os(tvOS) import AVFoundation import CoreAudio import os.log /// MIDI receiving Sampler /// /// Similar to ``AppleSampler`` but with added MIDI capabilities /// open class MIDISampler: AppleSampler { // MARK:...
AudioKit
swift
audio_dsp
MIDIPlayer.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ #if !os(tvOS) import AVFoundation extension MIDIPlayer: Collection { /// This is a collection of AVMusicTracks, so we define element as such public typealias Element = AVMusicTrack /// Index by an intege...
AudioKit
swift
audio_dsp
MIDI+Receiving.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ // MIDI+Receiving Goals // * Simplicity in discovery and presentation of available source inputs // * Simplicity in inserting multiple midi transformations between a source and listeners // * Simplicity ...
AudioKit
swift
audio_dsp
MIDIControl.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ /// Common name of MIDI Control number from MIDIByte /// /// - ModulationWheel: Modulation Control /// - BreathControl: Breath Control (in MIDI Saxophones for example) /// - FootControl: Foot Control /// - Portamento: P...
AudioKit
swift
audio_dsp
MIDISystemCommand.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ /// MIDI System Command /// /// - None: Trivial Case /// - sysEx: System Exclusive /// - SongPosition: Song Position /// - SongSelect: Song Selection /// - TuneRequest: Request Tune /// - SysExEnd: End System Exclusive...
AudioKit
swift
audio_dsp
MIDICustomMetaEvent.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import Foundation /// MIDI Custom Meta Event Type public enum MIDICustomMetaEventType: MIDIByte { /// Sequence Number case sequenceNumber = 0x00 /// Text Event case textEvent = 0x01 /// Copyright ...
AudioKit
swift
audio_dsp
MIDIStatus.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ /// MIDI Status Message public struct MIDIStatus: MIDIMessage { /// Status message data public var data: [MIDIByte] { return [byte] } /// Status byte public var byte: MIDIByte /// Ini...
AudioKit
swift
audio_dsp
MIDITimeout.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import Foundation /// A class that performs an action block, then starts a timer that /// catches timeout conditions where a response is not received. /// Since the external caller is responsible for what constitutes ...
AudioKit
swift
audio_dsp
BPM+StatisticalTools.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ #if !os(tvOS) import Foundation extension Double { /// Tool for rounding to decimal places which is good for /// producing a more stable tempo display. /// /// - Parameter decimalPlaces: number of deci...
AudioKit
swift
audio_dsp
MIDIHelper.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import Foundation /// Helper functions for MIDI public class MIDIHelper { /// Convert MIDI Bytes to 16 bit /// - Parameters: /// - msb: Most significant bit /// - lsb: Least significant bit //...
AudioKit
swift
audio_dsp
MIDIVariableLengthQuantity.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import Foundation /// MIDI Variable Length Quantity public struct MIDIVariableLengthQuantity { /// Data in bytes public let data: [MIDIByte] /// Length of the quantity public var length: Int { return v...
AudioKit
swift
audio_dsp
MIDISysexMessage.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import Foundation /// MIDI System Exclusive Message public struct MIDISysExMessage: MIDIMessage { /// Data in bytes public let data: [MIDIByte] /// Length of sysex message public let length: Int //...
AudioKit
swift
audio_dsp
MIDIFileChunk.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import Foundation /// MIDI File Chunk Protocol public protocol MIDIFileChunk { /// All data used to init this chunk var rawData: [MIDIByte] { get } /// The subset of data used to determine type ("MTrk" or ...
AudioKit
swift
audio_dsp
MIDIFileTrackChunk.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import Foundation /// MIDI File Track Chunk public struct MIDIFileTrackChunk: MIDIFileChunk { /// Raw data as array of MIDI Bytes public let rawData: [MIDIByte] let timeFormat: MIDITimeFormat let time...
AudioKit
swift
audio_dsp
MIDIFileChunkEvent.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import Foundation /// MIDI File Chunk Event public struct MIDIFileChunkEvent { let data: [MIDIByte] // all data passed in let timeFormat: MIDITimeFormat let timeDivision: Int let runningStatus: MIDISta...
AudioKit
swift
audio_dsp
MIDIFileHeaderChunk.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import Foundation struct MIDIFileHeaderChunk: MIDIFileChunk { var rawData: [MIDIByte] /// Initialize with data /// - Parameter data: MIDI Bytes public init?(data: [MIDIByte]) { guard ...
AudioKit
swift
audio_dsp
MIDIFile.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ #if !os(tvOS) import Foundation /// MIDI File public struct MIDIFile { /// File name public var filename: String var chunks: [MIDIFileChunk] = [] var headerChunk: MIDIFileHeaderChunk? { ...
AudioKit
swift
audio_dsp
MIDIFileTrack.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ import Foundation #if !os(tvOS) /// MIDI File Track public struct MIDIFileTrack { var chunk: MIDIFileTrackChunk /// Channel events public var channelEvents: [MIDIEvent] { return chunk.chunkEvent...
AudioKit
swift
audio_dsp
MIDIFileTrackMap.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ #if !os(tvOS) /// MIDI Note Duration - helpful for storing length of MIDI notes public class MIDINoteDuration { /// Note Start time public var noteStartTime = 0.0 /// Note End time public var noteEndTim...
AudioKit
swift
audio_dsp
MIDIFileTempoTrack.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ #if !os(tvOS) /// MIDI File Tempo Track public struct MIDIFileTempoTrack { /// Associated MIDI File Track public let track: MIDIFileTrack /// Length of MIDI File tempo track public var length: Double...
AudioKit
swift
audio_dsp
MIDIPacket+Extensions.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ #if !os(tvOS) import CoreMIDI extension MIDIPacket { var isSysEx: Bool { return data.0 == MIDISystemCommand.sysEx.rawValue } var status: MIDIStatus? { return MIDIStatus(byte: data.0) ...
AudioKit
swift
audio_dsp
MIDIPacket+SequenceType.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ #if !os(tvOS) import CoreMIDI Allows a MIDIPacket to be iterated through with a for statement. This is necessary because MIDIPacket can contain multiple midi events, but Swift makes this unnecessarily hard because ...
AudioKit
swift
audio_dsp
MIDIPacketList+SequenceType.swift
// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/ #if !os(tvOS) import CoreMIDI extension MIDIPacketList: @retroactive Sequence { /// The element is a packet list sequence is a MIDI Packet public typealias Element = MIDIPacket /// Number of packets p...