Skip to content

Commit

Permalink
arpegiator extension - works with timbre
Browse files Browse the repository at this point in the history
  • Loading branch information
valsteen committed Jan 4, 2021
1 parent 74e1c0e commit 4651dfc
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/main/java/com/djcrontab/code/extensions/ArpegiatorExtension.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.djcrontab.code.extensions

import com.bitwig.extension.controller.ControllerExtension
import com.bitwig.extension.controller.api.*


class ArpegiatorExtension(definition: ArpegiatorExtensionDefinition, host: ControllerHost) : ControllerExtension(definition, host) {
protected lateinit var application: Application

private val project: Project
get() {
return host.project
}

override fun init() {
application = host.createApplication()
val host = host

val midiIn = host.getMidiInPort(0)

// setting a wildcard expression makes sure that timbre is properly interpreted
// ( actually cc 74, mask "B?40??" )
val noteInput = midiIn.createNoteInput("", "??????")
noteInput.includeInAllInputs().set(false)


noteInput.setUseExpressiveMidi(true, 0, 48)
}

override fun flush() {

}

override fun exit() {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package com.djcrontab.code.extensions

import com.bitwig.extension.api.PlatformType
import com.bitwig.extension.controller.AutoDetectionMidiPortNamesList
import com.bitwig.extension.controller.ControllerExtensionDefinition
import com.bitwig.extension.controller.api.ControllerHost
import java.util.*

class ArpegiatorExtensionDefinition : ControllerExtensionDefinition() {
override fun getName(): String {
return "Arpegiator"
}

override fun getAuthor(): String {
return "Vincent Alsteen"
}

override fun getVersion(): String {
return "0.1"
}

override fun getId(): UUID {
return UUID.fromString("5ae001a9-42a3-4aaa-a8f8-4e700118c09d")
}

override fun getHardwareVendor(): String {
return "dj-crontab"
}

override fun getHardwareModel(): String {
return "Arpegiator"
}

override fun getRequiredAPIVersion(): Int {
return 12
}

override fun getNumMidiInPorts(): Int {
return 1
}

override fun getNumMidiOutPorts(): Int {
return 1
}

override fun listAutoDetectionMidiPortNames(list: AutoDetectionMidiPortNamesList, platformType: PlatformType) {}
override fun createInstance(host: ControllerHost): ArpegiatorExtension {
return ArpegiatorExtension(this, host)
}
}
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
com.djcrontab.code.extensions.ControlSurfaceExtensionDefinition
com.djcrontab.code.extensions.ArpegiatorExtensionDefinition

0 comments on commit 4651dfc

Please sign in to comment.