Closed hjek closed 7 years ago
It can sort of be worked around by taking the duration of the root (or tonica for scales). It would still be slightly more intuitive if either there was a method for setting it or it just left the 4 out.
//Assuming note.play() plays a note
teoria.Chord.prototype.play = function(){
var that = this
that.notes().map(
function(note){
//set duration to that of the root
if (that.root){
note.duration = that.root.duration
}
note.play()
}
)
}
teoria.Chord.prototype.play = function(){
var that = this
that.notes().map(
function(note){
//set duration to that of the root
if (that.root){
note.duration = that.root.duration
}
note.play()
}
)
}
Hi Pelle. I personally think that the duration stuff should be removed. This library could focus on the theory, and then another library could extend the theory with features important for playback and sheet music.
Do you use the duration features?
If they work well, I want to use them. The harmonics are really well worked out with loads of scales and chord,s and it works to the point where you can just give the midi pitch to some MIDI API; whereas the time/duration stuff maybe has some way to go before being able to do that, such as for example knowing when a note is being played; maybe both in bar/beat and (milli)seconds.
I'd suggest either cutting it or improving it.
I pushed my tiny >100 line library for rhythm here, because I couldn't find any here. If that kind of stuff is within the scope of teoria, fell free to incorporate it..
Should be fixed by #110
If I set a duration in the root note of a chord and also as an argument to the chord constructor, like this:
then none of these are used, and instead duration is set to 4:
Wouldn't it be better to be able to set duration of a chord either in the chord constructor (like note), or just set it to be the duration of the root note?