saebekassebil / teoria

Javascript taught Music Theory
http://saebekassebil.github.io/teoria
MIT License
1.31k stars 114 forks source link

Check if two notes are equal #104

Closed amitgur closed 7 years ago

amitgur commented 8 years ago

What is the best way?

I'm doing this..

var checkEqualNotes = function(a,b){

var interval = teoria.interval(teoria.note(a),teoria.note(b)).toString();

if (interval ==='P1' || interval === 'd-2' || interval === 'd2'){ return true; } else { return false; } }

saebekassebil commented 8 years ago

Hey Amit,

Equal in which way? Pitch equal or harmonically (theoretically) equal?

Use Nota#key or Note#chroma for pitch equal and maybe just compare Note.coord if they should be harmonically equal?

// Jakob

Den 12. apr. 2016 kl. 12.22 skrev Amit Gur notifications@github.com:

What is the best way?

I'm doing this..

var checkEqualNotes = function(a,b){

var interval = teoria.interval(teoria.note(a),teoria.note(b)).toString();

if (interval ==='P1' || interval === 'd-2' || interval === 'd2'){ return true; } else { return false; } }

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub

amitgur commented 8 years ago

Pitch equal a#3 === bb3 this are not equal by key???

saebekassebil commented 8 years ago

Yea, they should be equal by key?

Den 12. apr. 2016 kl. 20.03 skrev Amit Gur notifications@github.com:

Pitch equal a#3 === bb3 this are not equal by key???

— You are receiving this because you commented. Reply to this email directly or view it on GitHub

amitgur commented 8 years ago

:+1: Gotit

saebekassebil commented 7 years ago

Closing this as I see no outstanding issue(?)