Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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))
} 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))
}
}
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)
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))
}
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
}
}
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) {
export function noteProps (note) {
return Note.props(asciNote(note.name + note.octave))
}
export function parseNote (name) {
const props = Note.props(asciNote(name))
return {
name: unicodeNote(props.pc),
octave: props.oct
}
}
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) {