-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
arpegiator extension - works with timbre
- Loading branch information
Showing
3 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
src/main/java/com/djcrontab/code/extensions/ArpegiatorExtension.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() { | ||
|
||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
src/main/java/com/djcrontab/code/extensions/ArpegiatorExtensionDefinition.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
src/main/resources/META-INF/services/com.bitwig.extension.ExtensionDefinition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
com.djcrontab.code.extensions.ControlSurfaceExtensionDefinition | ||
com.djcrontab.code.extensions.ArpegiatorExtensionDefinition |