Create smnp.music.commands module
This commit is contained in:
0
modules/music-commands/build.gradle
Normal file
0
modules/music-commands/build.gradle
Normal file
7
modules/music-commands/gradle.properties
Normal file
7
modules/music-commands/gradle.properties
Normal file
@@ -0,0 +1,7 @@
|
||||
version=0.0.1
|
||||
|
||||
pluginVersion=0.1
|
||||
pluginId=smnp.music.commands
|
||||
pluginClass=
|
||||
pluginProvider=Bartłomiej Pluta
|
||||
pluginDependencies=
|
||||
@@ -0,0 +1,9 @@
|
||||
package io.smnp.ext.audio
|
||||
|
||||
import io.smnp.ext.provider.LanguageModuleProvider
|
||||
import org.pf4j.Extension
|
||||
|
||||
@Extension
|
||||
class MusicCommandsModule : LanguageModuleProvider("smnp.music.commands") {
|
||||
override fun dependencies() = listOf("smnp.collection")
|
||||
}
|
||||
12
modules/music-commands/src/main/resources/main.mus
Normal file
12
modules/music-commands/src/main/resources/main.mus
Normal file
@@ -0,0 +1,12 @@
|
||||
function vel(value: float) {
|
||||
return { velocity -> value };
|
||||
}
|
||||
|
||||
function cresc(begin: float, end: float, ...notes: <note, int>) {
|
||||
return cresc(begin, end, notes);
|
||||
}
|
||||
|
||||
function cresc(begin: float, end: float, notes: list<note, int>) {
|
||||
return (notes as (item, index) ^ [vel((index+1) * (end-begin)/notes.size + begin), item]).flatten();
|
||||
}
|
||||
|
||||
@@ -16,4 +16,5 @@ include 'modules:music'
|
||||
include 'modules:math'
|
||||
include 'modules:mic'
|
||||
include 'modules:dsp'
|
||||
include 'modules:music-commands'
|
||||
include 'modules:music-tools'
|
||||
Reference in New Issue
Block a user