How to use the tonal.Note.props 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 parseNote (name) {
  const props = Note.props(asciNote(name))
  return {
    name: unicodeNote(props.pc),
    octave: props.oct
  }
}

const BassRootNotes = {
  C: Note.props('C3'),
  G: Note.props('G2'),
  D: Note.props('D2'),
  A: Note.props('A1'),
  E: Note.props('E1'),
  B: Note.props('B0')
}

export function bassFret (string, note) {
  const rootNote = BassRootNotes[string]
  const noteMidi = Note.midi(asciNote(note.name + note.octave))
  // console.log(string.midi, noteMidi)
  return noteMidi - rootNote.midi
}

export function noteProps (note) {
  return Note.props(asciNote(note.name + note.octave))
}

export function noteDetune (note, offset) {
  const props = noteProps(note)
  const newNote = Note.props(Note.fromMidi(props.midi + offset))
github marcel-dancak / bass-app / vue / src / core / note-utils.js View on Github external
} else if (name.includes('â™­')) {
    return SharpNotes[FlatNotes.indexOf(name)]
  }
}

export function parseNote (name) {
  const props = Note.props(asciNote(name))
  return {
    name: unicodeNote(props.pc),
    octave: props.oct
  }
}

const BassRootNotes = {
  C: Note.props('C3'),
  G: Note.props('G2'),
  D: Note.props('D2'),
  A: Note.props('A1'),
  E: Note.props('E1'),
  B: Note.props('B0')
}

export function bassFret (string, note) {
  const rootNote = BassRootNotes[string]
  const noteMidi = Note.midi(asciNote(note.name + note.octave))
  // console.log(string.midi, noteMidi)
  return noteMidi - rootNote.midi
}

export function noteProps (note) {
  return Note.props(asciNote(note.name + note.octave))
}
github marcel-dancak / bass-app / vue / src / core / note-utils.js View on Github external
}

export function parseNote (name) {
  const props = Note.props(asciNote(name))
  return {
    name: unicodeNote(props.pc),
    octave: props.oct
  }
}

const BassRootNotes = {
  C: Note.props('C3'),
  G: Note.props('G2'),
  D: Note.props('D2'),
  A: Note.props('A1'),
  E: Note.props('E1'),
  B: Note.props('B0')
}

export function bassFret (string, note) {
  const rootNote = BassRootNotes[string]
  const noteMidi = Note.midi(asciNote(note.name + note.octave))
  // console.log(string.midi, noteMidi)
  return noteMidi - rootNote.midi
}

export function noteProps (note) {
  return Note.props(asciNote(note.name + note.octave))
}

export function noteDetune (note, offset) {
  const props = noteProps(note)
github marcel-dancak / bass-app / vue / src / core / note-utils.js View on Github external
return SharpNotes[FlatNotes.indexOf(name)]
  }
}

export function parseNote (name) {
  const props = Note.props(asciNote(name))
  return {
    name: unicodeNote(props.pc),
    octave: props.oct
  }
}

const BassRootNotes = {
  C: Note.props('C3'),
  G: Note.props('G2'),
  D: Note.props('D2'),
  A: Note.props('A1'),
  E: Note.props('E1'),
  B: Note.props('B0')
}

export function bassFret (string, note) {
  const rootNote = BassRootNotes[string]
  const noteMidi = Note.midi(asciNote(note.name + note.octave))
  // console.log(string.midi, noteMidi)
  return noteMidi - rootNote.midi
}

export function noteProps (note) {
  return Note.props(asciNote(note.name + note.octave))
}
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 / 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 / core / note-utils.js View on Github external
export function noteProps (note) {
  return Note.props(asciNote(note.name + note.octave))
}
github marcel-dancak / bass-app / vue / src / core / note-utils.js View on Github external
export function parseNote (name) {
  const props = Note.props(asciNote(name))
  return {
    name: unicodeNote(props.pc),
    octave: props.oct
  }
}
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) {