411 Music in Ios and Lion V8 DDF

411 Music in Ios and Lion V8 DDF

Music in iOS and Mac OS X Session 411 Michael Hopkins Core Audio Engineering These are confidential sessions—please refrain from streaming, blogging, or taking pictures 1 What You Will Learn • Using Audio Units • Introduction to the AUSampler • CoreMIDI on iOS • Playing of music sequences 2 Music Application EP Piano Sampler Mixer 3 What Is an Audio Unit? • Plug-in for processing audio • Supports real-time input, output, or simultaneous I/O • Organized in an audio processing graph • Controlled by properties and parameters • Can have a view (Mac OS X) 4 Types of Audio Units • Effects • Music effects • Instruments • Generators • Panners • Converters • Mixers • Offline effects • Output units 5 Using Audio Units Organizing Audio Units in a graph • Audio Units can be added to an audio processing network called an AUGraph ■ Each item in the graph Input is an AUNode Reverb Unit ■ Graph defines connections between nodes Output ■ Signal flow goes from input to output ■ Graph ends with a single output unit 6 Using Audio Units AU graphs (cont.) • Graphs can use a mixer unit to combine separate chains prior to the output Instrument Input Delay Unit Reverb Unit Filter Unit Mixer Unit Output 7 Audio Application File Player Distortion Reverb Sampler Unit Unit Unit Unit Mixer Unit Output Unit 8 Interacting with Audio Units Properties • Key-value pairs • Configure state that is managed by the host ■ Sample rate ■ Stream format ■ Number of input buses on a mixer • Set on Audio Unit and take effect at initialization 9 Interacting with Audio Units Parameters • Key-value pairs • Intended to be used during processing ■ Delay time ■ Feedback amount ■ Stereo panning position • Generally set through a UI 10 Demo Exploring Audio Units in AULab Michael Hopkins Core Audio Engineering 11 New Audio Units in iOS • Effects ■ Filters ■ Highpass ■ Lowpass ■ Bandpass ■ Highshelf ■ Lowshelf ■ Parametric EQ ■ Peak limiter ■ Dynamics processor ■ Reverb 12 New Audio Units in iOS • Effects ■ Varispeed ■ SimpleTime ■ NotQuiteSoSimpleTime • Generators ■ AudioFilePlayer ■ ScheduledSlicePlayer • Instruments ■ Sampler 13 Audio Components Finding, loading, and instantiating Audio Units Michael Hopkins Core Audio Engineering 14 Audio Unit Basics • Audio Unit instances are created from Audio Components • Uniquely identified by an AudioComponentDescription ■ Each value is a four-character OSType ■ Type ‘aufx’ ■ Subtype ‘dlay’ ■ Manufacturer ‘acme’ • Name • Version 15 Introducing the AudioComponent API • Provides facilities for Audio Components ■ Finding ■ Loading ■ State management • Available in iOS and Mac OS X • Replaces Component Manager calls on Mac OS X 16 Finding and Loading an Audio Unit Application AudioComponentDesc Audio Component System Audio Audio Audio Audio Audio Audio … Component Component Component Component Component Component 17 Finding and Loading an Audio Unit Application AudioComponentDesc Audio Component System AudioComponentFindNext( ) Audio Audio Audio Audio Audio Audio … Component Component Component Component Component Component 18 Finding and Loading an Audio Unit Application AudioComponentDesc Audio Component System AudioComponentFindNext( ) Audio Audio Audio Audio Audio Audio … Component Component Component Component Component Component 19 Finding and Loading an Audio Unit Application Audio Component System Audio Audio Audio Audio Audio Audio … Component Component Component Component Component Component 20 Finding and Loading an Audio Unit Audio Application Component Audio Component System AudioComponentInstanceNew( ) Audio Audio Audio Audio Audio Audio … Component Component Component Component Component Component 21 Finding and Loading an Audio Unit Audio Application Component Audio Component System AudioComponentInstanceNew( ) Audio Audio Audio Audio Audio Audio … Component Component Component Component Component Component 22 Finding and Loading an Audio Unit Audio Application Component Audio Unit Audio Component System Audio AudioComponentInstanceNew( Component ) Audio Audio Audio Audio Audio Audio … Component Component Component Component Component Component 23 Finding and Creating an Audio Unit • Use AudioComponentFindNext() to find a specific Audio Component AudioComponent AudioComponentFindNext(AudioComponent *inComp, const AudioComponentDescription *inDesc) ■ First argument can be NULL to start at beginning of component list ■ Pass a specific Audio Component to retrieve next match ■ Wildcard searches allowed 24 Registering Audio Components • System scans directories for bundles ~/Library/Audio/Plug-Ins/Components /Library/Audio/Plug-Ins/Components /System/Library/Components • Bundles have a specific extension ■ .audiocomp (registers with Audio Component System) ■ .component (registers with Component Manager and Audio Component System) 25 Registering Audio Components Components can be registered at runtime AudioComponent AudioComponentRegister(AudioComponentDescription *desc, CFStringRef name, UInt32 version, AudioComponentFactoryFunction func) • Component only available in application process 26 Audio Components A look under the hood • All Audio Components have an AudioComponentFactoryFunction ■ Used to create instances of the Component ■ Returns a pointer to an AudioComponentPluginInterface 27 Audio Units A look under the hood • All Audio Components have an AudioComponentFactoryFunction ■ Used to create instances of the Component ■ Returns a pointer to an AudioComponentPluginInterface *Open() Open(self, newInstance) *Close() Close(self) AudioComponentPluginInterface *Lookup() Lookup(selector) 28 Creating an Audio Component Instance Audio Application Component Audio Component System AudioComponentInstanceNew( ) 29 Creating an Audio Component Instance Audio Application Component Audio Component System AudioComponentInstanceNew( ) 30 Creating an Audio Component Instance Audio Application Component Audio Component System Audio AudioComponentInstanceNew( Component ) AudioComponentFactoryFunction ( ) 31 Creating an Audio Component Instance Audio Application Component Audio Component System Audio AudioComponentInstanceNew( Component ) AudioComponentFactoryFunction ( ) AudioComponentPluginInterface 32 Creating an Audio Component Instance Audio Application Component Audio Component System Audio AudioComponentInstanceNew( Component ) AudioComponentFactoryFunction ( ) AudioComponentPluginInterface Open(self, newInstance) 33 Creating an Audio Component Instance Audio Application Component Audio Unit Audio Component System Audio AudioComponentInstanceNew( Component ) AudioComponentFactoryFunction ( ) AudioComponentPluginInterface Open(self, newInstance) 34 Calling into an Audio Unit Application Audio Unit Audio Component System AudioUnitRender( … ) 35 Calling into an Audio Unit Application Audio Unit Audio Component System AudioUnitRender( , … ) 36 Calling into an Audio Unit Application Audio Unit Audio Component System AudioUnitRender( Audio Unit , … ) AudioComponentFactoryFunction ( ) 37 Calling into an Audio Unit Application Audio Unit Audio Component System AudioUnitRender( Audio Unit , … ) AudioComponentFactoryFunction ( ) AudioComponentPluginInterface 38 Calling into an Audio Unit Application Audio Unit Audio Component System AudioUnitRender( Audio Unit , … ) AudioComponentFactoryFunction ( ) AudioComponentPluginInterface Lookup(kAudioUnitRenderSelect) 39 Calling into an Audio Unit Application Audio Unit Audio Component System AudioUnitRender( Audio Unit , … ) AudioComponentFactoryFunction ( ) AudioComponentPluginInterface Lookup(kAudioUnitRenderSelect) Render( AU, … ) 40 The Sampler Audio Unit Doug Scott Core Audio Engineering 41 The Sampler File Player Distortion Reverb Sampler Unit Unit Unit Unit Mixer Unit Output Unit 42 A New Instrument for iOS and Mac OS X • What makes this an instrument? ■ Generates audio output ■ Music events trigger notes and change behavior 43 A New Instrument for iOS and Mac OS X • What makes this an instrument? ■ Generates audio output ■ Music events trigger notes and change behavior • What makes this a sampler? ■ Audio files organized as a playable instrument ■ Drum kit ■ Acoustic piano ■ Sound effects 44 Sampler Features • Accepts samples in multiple formats • Shares resources • Streams large audio files • Lightweight native presets • Flexible instrument preset design • Translates DLS and SoundFont2 instrument presets 45 How a Sampler Patch Is Organized A hierarchy of zones and layers Instrument Layer Zone Zone Zone Zone 46 Zones How to map each sample • Inherit from parent layer Instrument • Root key • Key number range • Key velocity range Layer • Waveform looping • Gain • Detune Zone Zone Zone Zone • etc. 47 Layers Allow zones to share common settings • Collection of zones Instrument • Settings for filters, LFOs, envelopes, etc. • Modulation connections Layer • Zone selection • Key offset • etc. Zone Zone Zone Zone 48 Instrument A collection of layers Instrument Layer Zone Zone Zone Zone 49 A Simple Patch A single layer with multiple zones • Layer spans entire keyboard • Divided into four zones Instrument Layer Zone Zone Zone Zone 50 Sampler Behavior A single layer with multiple zones • MIDI note on received Instrument Layer Zone Zone Zone Zone 51 Sampler Behavior A single layer with multiple zones • MIDI note on received • Zone selected Instrument Layer Zone Zone Zone Zone 52 Sampler Behavior A note-on generates a single voice • MIDI note on received • Zone selected • Voice is activated Instrument Layer Zone Zone Zone Zone Voice 53 A Layered Patch Two layers which overlap to produce a complex instrument

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    109 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us