gibber-cc / gibber

An audiovisual live coding environment for the browser
MIT License
902 stars 79 forks source link

use of lfo to control decay times returns samples not seconds #65

Closed ianhattwick closed 3 years ago

ianhattwick commented 3 years ago

Right now a workaround is to wrap scaling parameters in Clock.time() - but it would be better if it were able to parse the output of lfo() as seconds instead of samples

s = Synth()
s.note.seq([0,1,2,3], 1/4)
s.decay= lfo('triangle', btof(8), Clock.time( 0.4 ), Clock.time( 0.42) )
charlieroberts commented 3 years ago

OK, so just to be clear, in:

s = Synth()
s.note.seq([0,1,2,3], 1/4)
s.decay= lfo('triangle', btof(8), Clock.time( 0.4 ), Clock.time( 0.42) )

... you'd like to remove the calls to Clock.time, right? I think I can make that work... basically when you assign a gen object to a time property (attack/decay etc.) gibber would wrap that gen object in something that would convert from beats to samples. Does that sound right?

ianhattwick commented 3 years ago

Yes, that is correct. Just to make the syntax consistent with other parameters.

-ian

On Apr 8, 2021, at 8:04 AM, charlie roberts @.***> wrote:

OK, so just to be clear, in:

s = Synth() s.note.seq([0,1,2,3], 1/4) s.decay= lfo('triangle', btof(8), Clock.time( 0.4 ), Clock.time( 0.42) ) ... you'd like to remove the calls to Clock.time, right? I think I can make that work... basically when you assign a gen object to a time property (attack/decay etc.) gibber would wrap that gen object in something that would convert from beats to samples. Does that sound right?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gibber-cc/gibber/issues/65#issuecomment-815724165, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPGSWGY74FFDI6E2URW6FDTHWLUFANCNFSM42R57VRQ.

charlieroberts commented 3 years ago

Fixed in https://github.com/gibber-cc/gibber/commit/987c4c3e52966bd6c3638b5a7421c5a481935dec