AudioKit
iOS, macOS 및 tvOS용 Swift 오디오 합성, 처리 및 분석 플랫폼
개요
AudioKit은 코드 저장소, 패키지, 라이브러리, 알고리즘, 애플리케이션, 플레이그라운드, 테스트, 스크립트로 구성된 전체 오디오 개발 생태계(audio development ecosystem)로, 오디오 프로그래머, 앱 개발자, 엔지니어, 연구원, 과학자, 음악가, 게이머 및 프로그래밍을 처음 접하는 사람들의 커뮤니티에 의해 구축되고 사용되는 프레임워크입니다.
AudioKit은 개발 동기를 부여하는 몇 가지 기본 목표를 가지고 있습니다.
- 첫째, AudioKit을 배우는 것이 누구에게나 쉽기를 바랍니다. 사람들이 시작할 수 있도록 Swift Playgrounds, 데모 애플리케이션 및 지원하는 AudioKit 전문가의 Discord 그룹에 대한 액세스를 제공합니다.
- 다음으로, 우리는 AudioKit이 확장성이 있어 더 많은 고급 개발자들이 AudioKit 위에 구축된 자신만의 사용자 지정 앱과 라이브러리를 만들 수 있기를 바랍니다. AudioKit의 일부였던 대부분의 파트가 AudioKit이 확장 가능하도록 하고 개발자들에게 AudioKit의 확장에 대한 여러 가지 접근법의 예를 제공하기 위해 별도의 패키지로 이동되었습니다.
- AudioKit의 중요한 목표는 소수의 자원 봉사자가 성장하고 유지 관리할 수 있도록 하는 것입니다. 이러한 이유로 AudioKit 코드 저장소가 변경될 때마다 실행되는 광범위한 테스트가 있습니다. 우리는 AudioKit을 지원하는 데 많은 시간을 할애하는 사람들에 대한 Github 후원(sponsorship)을 수락하고 권장합니다.
- 우리는 차세대 오디오 앱 개발자들에게 영감을 주며, 오디오킷 기반 앱을 강조하고 세계에서 가장 많이 다운로드된 신디사이저 앱인 “AuidoKit SynthOne“를 비롯한 다른 앱들을 포함하는 “AudioKit Pro” 브랜드를 내세웁니다.
패키지 목록 / 레이어 다이어그램
AudioKit 레이어 자체에는 import 할 수 있는 세 가지 프레임워크가 포함되어 있습니다.
- AudioKit
- AudioKit의 Swift 전용(Swft-only base) 레이어
- Swift Playgoriunds app에서 이용할 수 있음
- AudioKitEX
- C++로 작성된 AudioKit 확장을 위한 API
- CAudioKitEX
AudioKitEX
의 기능을 지원하는 DSP(Digital Signal Processor) 및 기타 Low Level 코드
Cookbook Demo App 계층은 이 다이어그램에서 실행 가능한 앱이 있는 위치의 예입니다. 이 계층은 그 아래에 있는 패키지의 하위 집합에 따라 달라질 수 있습니다.
Cookbook의 모습
패키지는 다른 패키지에 의존할 수 있으며 SoundpipeAudioKit
에 의존하는 SporthAudioKit
의 예(윗부분에 있는 것이 아래 부분에 의존함)가 표시되어 있습니다.
위 레이어 다이어그램의 AAAAudioKit
…ZZZAudioKit
블록은 AudioKit을 확장하는 다양한 패키지의 플레이스홀더(placeholder)입니다. 아래 목록은 다양한 패키지의 몇 가지 예입니다.
- AudioKitUI
- 파형 시각화(waverform visualization) 및 UI 구성 요소
- DevLoop AudioKit
- 기타(Guitar) 프로세서
- Dunne AudioKit
- 코러스(Chorus), 플랜저(Flanger). 샘플러(Sampler), 스테레오 딜레이(Stereo Delay), 신디사이저(Synth)
- SoundPipe AudioKit
- 오실레이터(Oscillators), 이펙트(Effects), 필터(Filters) 등
- Sporth AudioKit
- 간단한 문법으로 복잡한 DSP 작업을 처리
- STK AudioKit
- Stanford Synthesis Toolkit physical models
AudioKit.io
설치 방법
설명법 링크 – https://github.com/AudioKit/AudioKit/
- (Xcode의 프로젝트에서)
File -> Add Packages...
를 선택합니다. - 왼쪽 컬렉션 사이드바의 왼쪽 하단에 있는
+
아이콘을 클릭합니다.
- 팝업 메뉴에서
Add Package Collection
를 선택합니다. - 패키지 컬렉션 추가 대화 상자에서
https://swiftpackageindex.com/AudioKit/collection.json
을 URL로 입력하고Load
버튼을 클릭합니다. - 만약 컬렉션이 서명되지 않았음을 경고한다면 “서명되지 않은 컬렉션 추가”를 클릭하십시오.
- 이제 패키지 목록에서 필요한 AudioKit Swift 패키지를 추가하고 Xcode 내에서 바로 그 기능을 불러올 수 있습니다.
목표 (Targets)
- AudioKit
- AVFoundation Effects에 대한 래퍼(Wrapper)
- 언어: Swift
- AudioKitEX
- Nodes, Parameters, Automation, Sequencing
- 언어: Swift
- CAudioKitEX
- AudioKitEX 기능을 지원하는 DSP 및 기타 Low Level 코드
- 언어: Objective-C++
예제
AudioKit 예제의 기본 소스는 AudioKit Cookbook에 있습니다. 이 앱에는 AudioKit의 사용법에 대한 모든 미니 예제가 포함되어 있습니다.
포맷 변환기 (Format Converter)
FormatConverter
는 보다 복잡한 AVFoundation
및 CoreAudio
오디오 변환을 사용하기 쉬운 형식으로 래핑합니다.
import AudioKit // viewDidLoad나 SwiftUI의 onAppear 등 실행 가능한 영역 .onAppear { var options = FormatConverter.Options() // any options left nil will assume the value of the input file options.format = .wav options.sampleRate = 48000 options.bitDepth = 24 let oldURL = Bundle.main.url(forResource: "file_example_MP3_5MG", withExtension: "mp3")! let documentDir = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] // document 폴더 위치 표시 print("docuDIR:", documentDir) let newURL = documentDir.appending(component: "output - \(Date()).wav") let converter = FormatConverter(inputURL: oldURL, outputURL: newURL, options: options) converter.start { error in // check to see if error isn't nil, otherwise you're good if let error = error { print("Error:", error) } print("good") } }

앱 실행 전 (변환 전) 원래 파일 (oldURL
)

앱 실행 후 (변환 후) 파일 (newURL
)
미디 (MIDI)
AudioKit MIDI는 MIDI 신호의 생성과 응답을 단순화하기 위해 사용되는 CoreMIDI
의 구현(implementations)입니다.
다음과 같은 MIDI 리스너(MIDIListener
)를 추가합니다.
var midi = MIDI() midi.openInput() midi.addListener(someClass)
someClass
는 MIDIListener
프로토콜을 준수(conform)해야 합니다.
그런 다음 MIDILlistener
에서 필요한 메서드 등을 구현하고 필요한 방법으로 데이터를 사용합니다.
테이블 (Tables)
테이블은 Float
데이터의 배열일 뿐입니다. 파형 데이터를 저장하는 데 가장 많이 사용되며 가장 일반적인 경우에는 몇 가지 기본값이 있습니다.
- sine wave (사인파)
- triangle wave (삼각파)
- square wave (사각파)
- sawtooth wave (톱니파)
- reverse sawtooth wave (역톱니파)
- positive sine (양의 사인파)
- positive triangle (양의 삼각파)
- positive square (양의 사각파)
- positive sawtooth (양의 톱니파)
- positive reverse sawtooth (양의 역톱니파)
테이블은 오디오 또는 제어 데이터를 저장하는 것도 됩니다.
시퀀싱 (Sequencing)
AppleSequencer는 검증된(tried-and-true) CoreAudio/MIDI 시퀀스를 기반으로 합니다.
🚧 이 글은 작성중입니다.
빠른 시일 내에 포스트 작성을 완료하겠습니다.
Taps
Taps are a way to get access to the audio stream at a given point in the signal chain without inserting a node into the signal chain, but instead sort of syphoning off audio “tapping” it and using the data for some side purpose like plotting or running analysis of the stream at that point.
Topics
Articles
Classes
class Amplitude Tap
class Apple Sampler
class Apple Sequencer
class Audio Engine
class Audio Player
class Band Pass Filter
class Base Tap
class Compressor
class Decimator
class Delay
class Distortion
class Dynamics Processor
class Expander
class FFTTap
class Format Converter
class High Pass Filter
class High Shelf Filter
class Low Pass Filter
class Low Shelf Filter
class MIDI
class MIDICallback Instrument
class MIDIClock Listener
class MIDIFile Track Note Map
class MIDIHelper
class MIDIInstrument
class MIDIMono Poly Listener
class MIDINote Duration
class MIDIOMNIListener
class MIDIPlayer
class MIDISampler
class MIDISystem Real Time Listener
class MIDITempo Listener
class MIDITimeout
class Mixer
class Multi Channel Input Node Tap
class Multi Segment Audio Player
class Music Track Manager
class Node Parameter
class Node Recorder
class Parametric EQ
class Peak Limiter
class Playground Noise Generator
class Playground Oscillator
class Preset Builder
class Raw Data Tap
class Reverb
class Ring Modulator
class Settings
class Table
class Thread Locked Accessor
class Time Pitch
class Vari Speed
class Waveform Data Request
Protocols
protocol Dynamic Waveform Node
protocol Has Audio Engine
protocol MIDIBeat Observer
protocol MIDIFile Chunk
protocol MIDIListener
protocol MIDIMessage
protocol MIDISystem Real Time Observer
protocol MIDITempo Observer
protocol MIDITransformer
protocol Multi Channel Input Node Tap Delegate
protocol Named Node
protocol Node
protocol Node Parameter Type
protocol Observer Protocol
protocol Occupiable
protocol Processes Player Input
Structures
struct Apple MIDIEvent
struct Device
struct Duration
struct Endpoint Info
struct MIDICustom Meta Event
struct MIDIEvent
struct MIDIFile
struct MIDIFile Chunk Event
struct MIDIFile Tempo Track
struct MIDIFile Track
struct MIDIFile Track Chunk
struct MIDINote Data
struct MIDIProgram Change Event
struct MIDIStatus
struct MIDISys Ex Message
struct MIDIVariable Length Quantity
struct Node Parameter Def
struct Parameter
struct Time Signature
Variables
let note Off Byte: MIDIByte
let note On Byte: MIDIByte
Functions
func Log(Any?..., log: OSLog, type: OSLog Type, file: String, function: String, line: Int)
func ceil(Duration) -> Duration
func four CC(String) -> UInt32
func load Audio Signal(audio URL: URL) -> (signal: [Float], rate: Double, frame Count: Int)?
Operators
func - (AVAudio Time, Double) -> AVAudio Time
func - (AVAudio Time, Int) -> AVAudio Time
Type Aliases
typealias AUValue
typealias BPM
typealias BPMType
typealias CMIDICallback
typealias CVoid Callback
typealias Device ID
typealias Float Channel Data
typealias MIDIByte
typealias MIDICallback
typealias MIDIChannel
typealias MIDINote Number
typealias MIDIVelocity
typealias MIDIWord
typealias Sample Index
Enumerations
enum Analysis Mode
enum Disconnect Strategy
enum FFTValid Bin Count
enum MIDIControl
enum MIDICustom Meta Event Type
enum MIDIFile Chunk Type
enum MIDIStatus Type
enum MIDISystem Command
enum MIDISystem Command Type
enum MIDITime Format
enum Node Status
enum Sample Trigger Mode
enum Stereo Mode
enum Table Type
0개의 댓글