.value returns the scheduled value at time=now

This commit is contained in:
Yotam Mann 2016-03-03 13:04:02 -05:00
parent 366e61562f
commit 18b2136148
2 changed files with 4 additions and 2 deletions

View file

@ -124,7 +124,7 @@ define(["Tone/core/Tone", "Tone/signal/TimelineSignal",
*/
Object.defineProperty(Tone.Envelope.prototype, "value", {
get : function(){
return this._sig.value;
return this.getValueAtTime(this.now());
}
});

View file

@ -54,7 +54,9 @@ define(["Tone/core/Tone", "Tone/signal/Signal", "Tone/core/Timeline"], function
*/
Object.defineProperty(Tone.TimelineSignal.prototype, "value", {
get : function(){
return this._toUnits(this._param.value);
var now = this.now();
var val = this.getValueAtTime(now);
return this._toUnits(val);
},
set : function(value){
var convertedVal = this._fromUnits(value);