Skip to content

Commit

Permalink
Update samples
Browse files Browse the repository at this point in the history
  • Loading branch information
stashymane committed Feb 13, 2024
1 parent 7bb1a4f commit 42538da
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ implementation group: 'dev.stashy.midifunk', name: 'midifunk', version: 'x.x.x'
### Opening device for reading inputs

```kotlin
val device = Midifunk.descriptors[index].device as InputDevice
device.input.open().onEach { println(it) }.launchIn(coroutineScope)
val device = MidiDevice.list()[0]
device.input.open(coroutineScope).onEach { println(it) }
```

### Opening output channel

```kotlin
val device = Midifunk.descriptors[index].device as OutputDevice
val channel: SendChannel<MidiEvent> = device.output.open()
channel.trySend(event)
val device = MidiDevice.list()[0]
val channel: SendChannel<MidiData> = device.output.open()
channel.send(event)
```

### Creating type-safe MIDI events with DSL
Expand Down

0 comments on commit 42538da

Please sign in to comment.