There should be a way to create input as a function.
The signature of the function is: (Long, Float) -> T?, where the Long parameter is the index of the sample on the timeline, the float is desired sample rate, and T is the output type.
For example the sine might be generated this way:
val amplitude = 1.0
val frequency = 440.0
Input {x, sampleRate -> sampleOf(amplitude * cos(x / sampleRate * 2 * PI * frequency)) }
The returning value is defined by the function, if returned null that means this is the end of the stream.
There should be a way to create input as a function.
The signature of the function is:
(Long, Float) -> T?
, where the Long parameter is the index of the sample on the timeline, the float is desired sample rate, and T is the output type.For example the sine might be generated this way:
The returning value is defined by the function, if returned null that means this is the end of the stream.