Skip to content

Commit

Permalink
Fix discovery pair
Browse files Browse the repository at this point in the history
  • Loading branch information
chee committed Feb 24, 2020
1 parent dd81602 commit ed58816
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions op1.control.ts
Expand Up @@ -326,6 +326,24 @@ class OperatorOne {
}
}
}

if (mode == Mode.Perform) {
let encouragement = [
"beep boop",
"and now,",
"make music",
"operate",
"modulate me",
"beepboop",
"fantasy",
"limitations: bigfeature",
"pulse // wave",
"play"
]

this.print(encouragement.random())
}

this._mode = mode
}

Expand Down Expand Up @@ -360,8 +378,8 @@ host.defineController(
)
host.defineMidiPorts(1, 1)
host.addDeviceNameBasedDiscoveryPair(
["OP-1 Midi Device"],
["OP-1 Midi Device"]
["OP-1 Midi Device MIDI 1"],
["OP-1 Midi Device MIDI 1"]
)

let keyboard: NoteInput
Expand All @@ -379,7 +397,7 @@ function init() {

op1 = new OperatorOne()

op1.print("hello")
op1.print("<3\rhappy birthday")

transport = host.createTransport()
// TODO: idea, have a key in perform mode for keyboard.noteLatch
Expand Down Expand Up @@ -411,7 +429,7 @@ function setupObservers(op1) {
position.addValueObserver(function (_: number) {
let time = position.getFormatted()
if (op1.mode == Mode.Arrange) {
op1.print(`song position\r${time}`)
op1.print(`\r${time}`)
}
})
}
Expand Down Expand Up @@ -652,7 +670,6 @@ let arpeggiatorModes = [
"pinky-down",
]


declare interface Array<T> {
random(): T
}
Expand All @@ -664,14 +681,6 @@ Array.prototype.random = function () {
function bindPerform(op1: OperatorOne) {
keyboard.arpeggiator().isEnabled().markInterested()

op1.bind(Encoder.Blue, withEncoder(on => {
on.left(withShift(on => {
cursorTrack.playNote(128, 128)
}))
on.right(withShift(on => {
}))
}))

op1.bind(Key.Sequence, withKey(on => {
on.up(withShift(on => {
let arpMode = arpeggiatorModes.random()
Expand Down

0 comments on commit ed58816

Please sign in to comment.