How to use the tonal.Note.enharmonic function in tonal

To help you get started, we’ve selected a few tonal 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 marcel-dancak / bass-app / vue / src / core / note-utils.js View on Github external
export function noteDetune (note, offset) {
  const props = noteProps(note)
  const newNote = Note.props(Note.fromMidi(props.midi + offset))
  return {
    name: unicodeNote(Note.enharmonic(newNote.pc)),
    octave: newNote.oct
  }
}
github marcel-dancak / bass-app / src / components / NoteSelect.vue View on Github external
items () {
      const items = []
      const startCode = Note.midi(this.root)
      for (let i = 0; i < this.length; i++) {
        const note = Note.props(Note.fromMidi(startCode + i))
        const item = {
          fret: i,
          octave: note.oct,
          name: note.pc
        }
        const enharmonic = Note.enharmonic(item.name)
        if (enharmonic !== item.name) {
          item.flatName = item.name.replace('b', '♭')
          item.name = enharmonic.replace('#', '♯')
        }
        items.push(item)
      }
      return items
    }
  },
github marcel-dancak / bass-app / vue / src / components / Fretboard.vue View on Github external
stringNotes (root) {
      const notes = []
      const startCode = Note.midi(root)
      for (let i = 0; i <= this.frets; i++) {
        const note = Note.props(Note.fromMidi(startCode + i))
        const item = {
          fret: i,
          octave: note.oct,
          name: note.pc
        }
        const enharmonic = Note.enharmonic(item.name)
        if (enharmonic !== item.name) {
          item.flatName = item.name.replace('b', '♭')
          item.name = enharmonic.replace('#', '♯')
        }
        notes.push(item)
      }
      return notes
    },
    fretNote (note, octave, fret) {
github marcel-dancak / bass-app / vue / src / components / NoteSelect.vue View on Github external
items () {
      const items = []
      const startCode = Note.midi(this.root)
      for (let i = 0; i < this.length; i++) {
        const note = Note.props(Note.fromMidi(startCode + i))
        const item = {
          fret: i,
          octave: note.oct,
          name: note.pc
        }
        const enharmonic = Note.enharmonic(item.name)
        if (enharmonic !== item.name) {
          item.flatName = item.name.replace('b', '♭')
          item.name = enharmonic.replace('#', '♯')
        }
        items.push(item)
      }
      return items
    }
  },
github marcel-dancak / bass-app / src / components / Fretboard.vue View on Github external
stringNotes (root) {
      const notes = []
      const startCode = Note.midi(root)
      for (let i = 0; i <= this.frets; i++) {
        const note = Note.props(Note.fromMidi(startCode + i))
        const item = {
          fret: i,
          octave: note.oct,
          name: note.pc
        }
        const enharmonic = Note.enharmonic(item.name)
        if (enharmonic !== item.name) {
          item.flatName = item.name.replace('b', '♭')
          item.name = enharmonic.replace('#', '♯')
        }
        notes.push(item)
      }
      return notes
    },
    fretNote (note, octave, fret) {