mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 16:48:00 +00:00
parse the frequency from a note
This commit is contained in:
parent
338f0f683c
commit
936424b356
1 changed files with 6 additions and 1 deletions
|
@ -92,9 +92,14 @@ define(["Tone/core/Tone", "Tone/source/Source", "Tone/signal/Signal"], function(
|
|||
|
||||
/**
|
||||
* set the note to happen at a specific time
|
||||
* @param {[type]} note [description]
|
||||
* @param {number|string} note if the note is a string, it will be
|
||||
* parsed as (NoteName)(Octave) i.e. A4, C#3, etc
|
||||
* otherwise it will be considered as the frequency
|
||||
*/
|
||||
Tone.Monophonic.prototype.setNote = function(note, time){
|
||||
if (typeof note === "string"){
|
||||
note = this.noteToFrequency(note);
|
||||
}
|
||||
time = this.toSeconds(time);
|
||||
if (this.portamento > 0){
|
||||
var currentNote = this.frequency.getValue();
|
||||
|
|
Loading…
Reference in a new issue