                          chordReplacements={@state.chordReplacements}
                          formatChordWithAlts={@formatChordWithAlts}
                          playback={not @state.isEditing}
-                         play={play}
+                         play={@state.play}
                          showTransposeModal={=> @toggleState 'showTransposeModal'}
                          setDisplayKey={@setDisplayKey}
                          fontSize={@props.displaySettings.fontSize} />

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 = [
