Create envelope factory functions
This commit is contained in:
@@ -7,9 +7,11 @@ import io.smnp.ext.synth.Synthesizer
|
||||
import org.pf4j.Extension
|
||||
|
||||
@Extension
|
||||
class SynthModule : NativeModuleProvider("smnp.audio.synth") {
|
||||
class SynthModule : HybridModuleProvider("smnp.audio.synth") {
|
||||
override fun functions() = listOf(WaveFunction(), SynthFunction())
|
||||
|
||||
override fun files() = listOf("envelope.mus")
|
||||
|
||||
override fun onModuleLoad(environment: Environment) {
|
||||
Synthesizer.init()
|
||||
}
|
||||
|
||||
13
modules/synth/src/main/resources/envelope.mus
Normal file
13
modules/synth/src/main/resources/envelope.mus
Normal file
@@ -0,0 +1,13 @@
|
||||
function adsr(p1: float = 0.1, p2: float = 0.3, p3: float = 0.8, s: float = 0.8) {
|
||||
return {
|
||||
name -> "adsr",
|
||||
p1 -> p1,
|
||||
p2 -> p2,
|
||||
p3 -> p3,
|
||||
s -> s
|
||||
};
|
||||
}
|
||||
|
||||
function constant() {
|
||||
return { name -> "const" };
|
||||
}
|
||||
Reference in New Issue
Block a user