From 1e64d804eda19f52b998f81a2d7fd1fc699f271d Mon Sep 17 00:00:00 2001 From: Grant Shangreaux Date: Fri, 3 Dec 2021 12:52:49 -0600 Subject: Add: sketch of Instrument implementation --- docs/design.org | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'docs/design.org') diff --git a/docs/design.org b/docs/design.org index 4f5e701..d52ce05 100644 --- a/docs/design.org +++ b/docs/design.org @@ -79,3 +79,14 @@ This is how its working now. It is possible this will only get us so far, but I think we can roll with it. The currently implemented [[../klangfarbrs/src/envelope.rs][Envelope]] module is actually wrapping three of the =line~= type objects. ~attack~ ~decay~ and ~release~ could all be described by a ~Line~ struct that has a target amplitude and a duration. + +* Instrument (basic) + +An Instrument is N Sine(?) waves with an Envelope applied to it. + +(OscBank, Envelope) + +it implements Iterator so that ~next()~ sums the oscillators, +scales them down by 1/N, and multiplies by the Envelope value. + + -- cgit v1.2.3