Remove unused dependencies
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
dependencies {
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
|
||||
testCompile group: 'junit', name: 'junit', version: '4.12'
|
||||
compileOnly(group: 'org.pf4j', name: 'pf4j', version: "3.2.0") {
|
||||
exclude group: "org.slf4j"
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ dependencies {
|
||||
compile project(':api')
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
|
||||
compile group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: '1.3.61'
|
||||
testCompile group: 'junit', name: 'junit', version: '4.12'
|
||||
compile group: 'org.pf4j', name: 'pf4j', version: '3.2.0'
|
||||
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.13.1'
|
||||
compile group: 'org.slf4j', name: 'slf4j-log4j12', version: '2.0.0-alpha1'
|
||||
|
||||
@@ -28,8 +28,6 @@ subprojects {
|
||||
compileOnly(group: 'org.pf4j', name: 'pf4j', version: "3.2.0") {
|
||||
exclude group: "org.slf4j"
|
||||
}
|
||||
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.5'
|
||||
testCompile group: 'junit', name: 'junit', version: '4.+'
|
||||
}
|
||||
|
||||
jar {
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
dependencies {
|
||||
implementation group: 'org.knowm.xchart', name: 'xchart', version: '3.6.2'
|
||||
}
|
||||
@@ -19,8 +19,5 @@ class AdsrEnvelope(private val p1: Double, private val p2: Double, private val p
|
||||
} else {
|
||||
f3(x)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun name() = "ADSR"
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
package io.smnp.ext.synth.lib.envelope
|
||||
|
||||
class ConstantEnvelope : Envelope() {
|
||||
override fun name() = "Constant"
|
||||
|
||||
override fun eval(x: Double, length: Int) = 1.0
|
||||
}
|
||||
@@ -1,27 +1,9 @@
|
||||
package io.smnp.ext.synth.lib.envelope
|
||||
|
||||
import io.smnp.ext.synth.lib.wave.Wave
|
||||
import org.knowm.xchart.QuickChart
|
||||
import org.knowm.xchart.SwingWrapper
|
||||
|
||||
abstract class Envelope {
|
||||
abstract fun eval(x: Double, length: Int): Double
|
||||
protected abstract fun name(): String
|
||||
|
||||
fun plot() {
|
||||
val max = 100
|
||||
val x = IntRange(0, max).map { it.toDouble() }
|
||||
val chart = QuickChart.getChart(
|
||||
name(),
|
||||
"x",
|
||||
"y",
|
||||
"y(x)",
|
||||
x,
|
||||
x.map { eval(it, max) }
|
||||
)
|
||||
|
||||
SwingWrapper(chart).displayChart()
|
||||
}
|
||||
|
||||
fun apply(wave: Wave): Wave {
|
||||
return Wave(wave.bytes.mapIndexed { index, byte ->
|
||||
|
||||
@@ -1,26 +1,11 @@
|
||||
package io.smnp.ext.synth.lib.wave
|
||||
|
||||
import org.knowm.xchart.QuickChart
|
||||
import org.knowm.xchart.SwingWrapper
|
||||
import java.io.ByteArrayOutputStream
|
||||
import kotlin.math.roundToInt
|
||||
import kotlin.math.sin
|
||||
|
||||
class Wave(val bytes: ByteArray) {
|
||||
|
||||
fun plot() {
|
||||
val chart = QuickChart.getChart(
|
||||
"Sine wave",
|
||||
"X",
|
||||
"Y",
|
||||
"y(x)",
|
||||
IntRange(0, bytes.size - 1).map { it.toDouble() }.toList(),
|
||||
bytes.toList()
|
||||
)
|
||||
|
||||
SwingWrapper(chart).displayChart()
|
||||
}
|
||||
|
||||
operator fun plus(wave: Wave): Wave {
|
||||
val stream = ByteArrayOutputStream()
|
||||
stream.writeBytes(bytes)
|
||||
|
||||
Reference in New Issue
Block a user