adding toMidi()

This commit is contained in:
Yotam Mann 2017-12-17 14:48:08 -05:00
parent 456dd7ceb3
commit 2138d2c26f

View file

@ -1,4 +1,4 @@
define(["Tone/core/Tone", "Tone/type/TimeBase"], function (Tone) {
define(["Tone/core/Tone", "Tone/type/TimeBase", "Tone/type/Frequency"], function (Tone) {
/**
* @class Tone.Time is a primitive type for encoding Time values.
@ -142,11 +142,11 @@ define(["Tone/core/Tone", "Tone/type/TimeBase"], function (Tone) {
};
/**
* Return the time in milliseconds.
* @return {Milliseconds}
* Return the value as a midi note.
* @return {Midi}
*/
Tone.Time.prototype.toMilliseconds = function(){
return this.toSeconds() * 1000;
Tone.Time.prototype.toMidi = function(){
return Tone.Frequency.ftom(this.toFrequency());
};
return Tone.Time;