How to use the st/auto_chords.AutoChords.coerceChord function in st

To help you get started, we’ve selected a few st examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github leafo / sightreading.training / static / js / song_parser.es6 View on Github external
state.position += duration
          break
        }
        case "keySignature": {
          state.keySignature = new KeySignature(+command[1])
          break
        }
        case "timeSignature": {
          let [, perBeat, noteValue] = command
          state.beatsPerNote = 4 / noteValue
          state.beatsPerMeasure = state.beatsPerNote * perBeat
          break
        }
        case "macro": {
          let [, macroName] = command
          let chord = AutoChords.coerceChord(macroName)

          if (chord) {
            if (!song.autoChords) {
              song.autoChords = []
            }
            song.autoChords.push([state.position, chord])
          }

          break
        }
        default: {
          console.warn("Got unknown command when parsing song", command)
        }
      }
    }
github leafo / sightreading.training / static / spec / song_spec.es6 View on Github external
      [["Cb", "dimM7"], () => AutoChords.coerceChord("cbdimM7")],
    ].map(function([expected, fn]) {
github leafo / sightreading.training / static / spec / song_spec.es6 View on Github external
      [["B", "m"], () => AutoChords.coerceChord("bm")],
      [["Fb", "M"], () => AutoChords.coerceChord("fbM")],
github leafo / sightreading.training / static / spec / song_spec.es6 View on Github external
      [["G#", "m"], () => AutoChords.coerceChord("g#m")],
      [["Cb", "dimM7"], () => AutoChords.coerceChord("cbdimM7")],
github leafo / sightreading.training / static / spec / song_spec.es6 View on Github external
      [["G", "M"], () => AutoChords.coerceChord("g")],
      [["A", "M"], () => AutoChords.coerceChord("aM")],
github leafo / sightreading.training / static / spec / song_spec.es6 View on Github external
      [["Fb", "M"], () => AutoChords.coerceChord("fbM")],
      [["G#", "m"], () => AutoChords.coerceChord("g#m")],
github leafo / sightreading.training / static / spec / song_spec.es6 View on Github external
      [["A", "M"], () => AutoChords.coerceChord("aM")],
      [["B", "m"], () => AutoChords.coerceChord("bm")],
github leafo / sightreading.training / static / spec / song_spec.es6 View on Github external
      [undefined, () => AutoChords.coerceChord("hello world")],
      [["G", "M"], () => AutoChords.coerceChord("g")],