doctype html
html
  head
    meta(charset='utf-8')
    meta(name='viewport', content='width=device-width, initial-scale=1, maximum-scale=1')
    title Space your face

    link(rel='stylesheet', type='text/css', href='build/build.css')

  style.
    .hello {
      background-image: url('images/hello-tharr.gif')
    }
    
    .space {
      background-image: url('images/space-your-face.jpg')
    }
    
    .maxwell {
      background-image: url('images/maxwell.gif')
    }
    
    .krang {
      background-image: url('images/krang.gif')
    }
    
    .brain {
      background-image: url('images/brain.gif')
    }
    
    .trippy {
      background-image: url('images/trippy.gif')
    }
    
    .trippy-too {
      background-image: url('images/trippy-3.gif')
    }
    
    .melon-head {
      background-image: url('images/melon-1.png')
    }
    
    .no-ear {
      background-image: url('images/melon-2.jpg')
    }
    
    .melon-head-two {
      background-image: url('images/melon-4.jpg')
    }

    .melon-head-three {
      background-image: url('images/melon-3.jpg')
    }
    
    .melon-head-four {
      background-image: url('images/melon-5.jpg')
    }
    
    .doors {
      background-image: url('images/doors.gif')
    }
    
    .taco {
      background-image: url('images/taco.gif')
    }
    
    .hearing {
      background-image: url('images/hearing.gif')
    }
    
    .elf {
      background-image: url('images/elf.gif')
    }
    
    .sad-melon {
      background-image: url('images/sad-melon.jpg')
    }
    
    .coffee {
      background-image: url('images/coffee-filter.gif')
    }
    
    .ear-placement {
      background-image: url('images/ear-placement.gif')
    }
    
    .math {
      background-image: url('images/math.gif')
    }
    
    .binaural-dummy {
      background-image: url('images/binaural-dummy.jpg')
    }
    
    .binaural-experience {
      background-image: url('images/binaural-experience.jpg')
    }
    
    .weirdo-binaural {
      background-image: url('images/weirdo-binaural.jpg')
    }
    
    .seal {
      background-image: url('images/seal.gif')
    }
    
    .cool {
      background-image: url('images/cool.gif')
    }
    
    .sphere {
      background-image: url('images/spherical-harmonics.jpg')
    }
    
    .maticulous {
      background-image: url('images/maticulous.jpg')
    }

    .omnitone {
      background-image: url('images/omnitone.png')
    }
    
    .melted-face {
      background-image: url('images/melted-face.gif')
    }

  body

    article

      section
        h2 Space your face:
        h3 this is your brain on spatialized audio
        h4 With your host @MylesBorins
        p  DenverScript - June 2017
        
      section(data-bespoke-backdrop='hello')
        h1 Oh Hai!
        
      section
        h1 My Name is Myles
        img.headroom(src='images/me.jpg' alt='itsa me!' width='200px' height='200px')
      
      section
        h3 I am gainfully employed by Google as a Developer Advocate
        h4 Focusing on the Node.js ecosystem running on GCP
        
        img(src='images/gcp.png' alt='Google Clud Platform' style='background-color:white;')
        
        h5.headroom The opinions expressed in this talk are solely my own

      section(data-bespoke-backdrop='maxwell')
        h1 Today we are going to talk about sound
      
      section(data-bespoke-backdrop='krang')
        h1 Specifically how brains interpret sound in space
        
      section(data-bespoke-backdrop='brain')
        h1 So we can hack our brains
        
      section(data-bespoke-backdrop='trippy')
        h1 Placing sounds in space.
      
      section(data-bespoke-backdrop='space')
        h1 To space your face.

      section(data-bespoke-backdrop='melon-head-two')
        h1 Imagine, your head is a melon
        //- img.headroom(src='images/melon-1.png' alt='melon head with headphones' width='200px')
      
      section
        h1 I know what you are thinking
      
      section(data-bespoke-backdrop='no-ear')
        h1 Melons do not have ears silly
        //- img.headroom(src='images/melon-2.jpg' alt='melons do not have ears' width='500px')
      
      section
        img(src='images/bear-with-me.jpg' alt='bear with me')
      
      section(data-bespoke-backdrop='melon-head-two')
        h1 imagine, your head is a melon
      
      section(data-bespoke-backdrop='melon-head-three')
        h1 with two holes for ears
      
      section(data-bespoke-backdrop='melon-head-four')
        h1 Floating in an anechoic chamber

      section(data-bespoke-backdrop='trippy-too')
        h1 Trippy, eh?
      
      section(data-bespoke-backdrop='taco')
        h1 Your perception would be tripping too!
        
      section(data-bespoke-backdrop='elf')
        h4 Our brains can easily decipher
        h3 how far away a sound is.
        h3 and if the sound is coming from the left or right.
        
      section(data-bespoke-backdrop='hearing')
        h1 The amount of energy reaching each ear gives this away
      
      section
        h1 Louder sounds are closer, softer further away
      
      section
        h2 If the sound reaches a particular ear first
        h3 we know about the direction it came from

      section(data-bespoke-backdrop='melon-head-four')
        h1 But if we were a floating melon with holes for ears in an anechoic chamber
      
      section
        h1 We would have no way of knowing the height of the sound
      
      section
        h1 We would also have no idea if it was coming from in front or behind
      
      section(data-bespoke-backdrop='sad-melon')
        h2 Thankfully we are not floating melon heads
        h3 with holes for ears in anechoic chambers!
        h4 That would be sad.
      
      section(data-bespoke-backdrop='coffee')
        h2 Our ear lobes and body act as a filter,
        h3 leaving a unique signature on the waveform
      
      section(data-bespoke-backdrop='ear-placement')
        h2 Our brains are able to decode this signature
        h3 and place the sounds accordingly
      
      section(data-bespoke-backdrop='doors')
        h2 The Doors of Perception are Opened
        h3 What can we do with this knowledge?
      
      section(data-bespoke-backdrop='melon-head-four')
        h1 It turns out that sometimes our heads are melons with holes for ears in an anechoic chamber
        
      section(data-bespoke-backdrop='melon-head')
        h1 Everytime we put on headphones!
      
      section
        h2 We can use principles of signal processing
        h3 to create filters
        h4 that can emulate our body's signature
      
      section
        h1 HRTF
        h4 Head related transfer function
        
      section
        h1 What is a transfer function
      
      section(data-bespoke-backdrop='math')
        h2 Some mathy math
        h3 fancy way of saying a black box
        h4 with defined input and output
        h5 and no side effects
      
      section
        img(src='images/transfer-function.png' alt='a simple flat block diagram')
        //- h3 signal ➡️ transfer-function ➡️ modified-signal
      
      section
        h2 An HRTF takes a signal
        h3 a location to position that signal in space
        h4 and returns a stereo signal with binaural encoding
      
      section(data-bespoke-backdrop='binaural-dummy')
        h2 Binaural is a classic form a spatialized recording
        h3 where two microphones are placed on a model where the ears should be
        h4 this model could likely be a melon with two holes
        
      section(data-bespoke-backdrop='binaural-experience')
        h2 When you later play back and listen to the binaural recording
        h3 You will experience the spatialization of the original recording
        h4 Like VR for your melon!

      section(data-bespoke-backdrop='weirdo-binaural')
        h2 These various binaural recoring setups
        h3 Are pretty rad
        h4 but they require special hardware
      
      section(data-bespoke-backdrop='seal')
        h1 Why bother with all that proprietary jazz
      
      section
        h1 We have an HRTF panner in the browser!

      section
        img(src='images/cool.gif' alt='wow that is cool said the panda')

      section
        h1 The panner node!
      
      section
        pre
          code.language-javascript.
            // slightly simplified for clarity
            var context = new AudioContext();
            var osc = context.createOscillator();
            var panner = context.createPanner();
            panner.panningModel = 'HRTF';
            panner.setPosition(x, y, z);
            osc.connect(panner);
            panner.connect(context.destination);
            osc.start();
      section
        h1 Demo Time
        h2.headroom Surf to
        h3
          a(href="https://github.com/MylesBorins/perceptual-tux/") https://kni.sh/pertux/
      
      section
        h1 HRTFs and Binaural are cool
      
      section
        h1 But it would be nice to not have to use headphones
      
      section
        h1 Ambisonics
        h3 A standard for encoding spatial audio
      
      section
        img(src='images/the-machine.jpg' alt='ambisonics algorithmic installation' width='50%')
        h3.headroom
          a(href="http://roberthenke.com/installations/the_machine.html") the machine
      
      section(data-bespoke-backdrop='sphere')
        h1 Higher Order Spherical Harmonics
        
      section
        img(src='images/listening-room.jpg' alt='omg the listening room at ccrma is so cool' width='70%')
        p.headroom the listening room at ccrma
      
      section
        h1 Super portable between ambisonics decoders
      
      section
        h1 Limited to sounds coming from an outer sphere
      
      section(data-bespoke-backdrop='maticulous')
        h1 Your speaker system needs to be maticulously arranged
      
      section
        h1 Do you like maticulously arranged speakers?
      
      section
        h1 You are going to love wave field synthesis arrays
      
      section
        img(src='images/array.jpg' alt='omg the a super duper cool wave field array' width='70%')
      
      section
        img(src='images/wave-field.png' alt='wavefield is way too cool' width='70%')
      
      section
        h1 Literally AR for your ears
      
      section
        h1 One of the coolest things?
      
      section
        h1 Most of the research for this stuff
      
      section
        h1 Is open
        
      section 
        h1 So there are browser implementations
        
      section
        h2 You can encode your sound ambisonically
        h3 mapped to the movement of a VR headset
        h4 pipe it through virtual speakers
        h5 and decode it to headphones binaurally
      
      section(data-bespoke-backdrop='omnitone')
        h1 ALL IN THE FREAKING BROWSER
        p.headroom
          a(href="https://www.npmjs.com/package/omnitone") Diagram from the omnitone library

      section(data-bespoke-backdrop='melted-face')
        h1 You may now pick your melted faces up from the ground

      section
        h1 These systems are not perfect

      section
        h1 Alogithms have bias

      section
        h2 If only male bodies are used to design the HRTFs
        h3 The exprience will not work nearly as well for people with other body types

      section
        h1 We cannot pretend algorithms are apolotical

      section
        h2 While bad binaural sound is not going to kill a person
        h3 An algorithm affected by unconcious bias could

      section
        h2 Thank You
        img.headroom(src='images/best-gif-evar.gif' alt='a surfing puppy' width='20%')
        h3 @MylesBorins

    script(src='build/build.js')
