     @setState showChordAltModal: true, altsModalChord: chord
 
   render: ->
-    lazilyLoadPlay()
     <Grid>
       <Row>
         <Col md={if @state.isEditing then 6 else 12}>

ShareButton = require './ShareButton'
ChordAltModal = require './ChordAltModal'
TransposeModal = require './TransposeModal'

# Lazily load play function
play = null
lazilyLoadPlay = ->
  unless play
    audio.init (err, fns) ->
      if err then alert err
      {play} = fns

# TODO(jsrmath): Fix sharp11 issue #3 and then use plain chord.transpose
transpose = (origKey, newKey, chordStr) ->

    chordReplacements: {} # Maps chord to index of alternate
    altsModalChord: null
    altsModalAlts: []
    play: null # Lazily load the play function before the component mounts

  componentWillMount: ->
    audio.init (err, fns) =>
      if err then alert err
      @setState play: fns.play

  key: ->
    possibleKeys = [
