Introduce some new commands and reduce their names to mostly single letter
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
package io.smnp.ext.midi
|
||||
|
||||
import io.smnp.environment.Environment
|
||||
import io.smnp.ext.provider.NativeModuleProvider
|
||||
import io.smnp.ext.midi.function.MidiFunction
|
||||
import io.smnp.ext.midi.function.MidiHelpFunction
|
||||
import io.smnp.ext.midi.lib.midi.Midi
|
||||
import io.smnp.ext.provider.HybridModuleProvider
|
||||
import org.pf4j.Extension
|
||||
|
||||
@Extension
|
||||
class MidiModule : NativeModuleProvider("smnp.audio.midi") {
|
||||
class MidiModule : HybridModuleProvider("smnp.audio.midi") {
|
||||
override fun files() = listOf("command.mus")
|
||||
|
||||
override fun functions() = listOf(MidiFunction(), MidiHelpFunction())
|
||||
|
||||
override fun dependencies() = listOf("smnp.music")
|
||||
|
||||
3
modules/midi/src/main/resources/command.mus
Normal file
3
modules/midi/src/main/resources/command.mus
Normal file
@@ -0,0 +1,3 @@
|
||||
function i(instrument: int) {
|
||||
return { instrument -> instrument };
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
function vel(value: float) {
|
||||
function v(value: float) {
|
||||
return { velocity -> value };
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.pf4j.Extension
|
||||
class SynthModule : HybridModuleProvider("smnp.audio.synth") {
|
||||
override fun functions() = listOf(WaveFunction(), SynthFunction())
|
||||
|
||||
override fun files() = listOf("envelope.mus")
|
||||
override fun files() = listOf("envelope.mus", "command.mus")
|
||||
|
||||
override fun onModuleLoad(environment: Environment) {
|
||||
Synthesizer.init()
|
||||
|
||||
15
modules/synth/src/main/resources/command.mus
Normal file
15
modules/synth/src/main/resources/command.mus
Normal file
@@ -0,0 +1,15 @@
|
||||
function o(overtones: list<float>) {
|
||||
return { overtones -> overtones };
|
||||
}
|
||||
|
||||
function e(envelope: map<string><>) {
|
||||
return { envelope -> envelope };
|
||||
}
|
||||
|
||||
function t(tuning: float) {
|
||||
return { tuning -> tuning };
|
||||
}
|
||||
|
||||
function bpm(bpm: int) {
|
||||
return { bpm -> bpm };
|
||||
}
|
||||
Reference in New Issue
Block a user