chicken scheme on OpenBSD using portmidi C lib via ffi.

(I have a fluidsynth instance waiting in the background
to send some midi events to.)

#openbsd #chicken #midi #fluidsynth



$ make
chicken-csc -s -J -I/usr/local/include -L -lportmidi midi.scm midic.c
chicken-csc -I/usr/local/include -L -lportmidi main.scm -o main.exe
$ ./main.exe
main.exe
(midi) test...
(midi) count devices...
n:18
midic-test i:0 name:default
midic-test i:1 name:default
midic-test i:2 name:midithru/0
midic-test i:3 name:midithru/0
midic-test i:4 name:midithru/1
midic-test i:5 name:midithru/1
midic-test i:6 name:rmidi/0
midic-test i:7 name:rmidi/0
midic-test i:8 name:rmidi/1
midic-test i:9 name:rmidi/1
midic-test i:10 name:midi/0
midic-test i:11 name:midi/0
midic-test i:12 name:midi/1
midic-test i:13 name:midi/1
midic-test i:14 name:snd/0
midic-test i:15 name:snd/0
midic-test i:16 name:snd/1
midic-test i:17 name:snd/1
$

@pkw Nice! sndio is pretty great too if you want to go full OpenBSD. I did a similar sort of thing a while ago with sndio & Guile on OpenBSD. I believe sndio has MIDI too :)

http://patpatpat.xyz/data/scheme/schism/schism.scm

Oh that's cool! I love that OpenBSD has a pretty good and
updated sound stack, including midi :)

Like bluetooth was kicked out, but MIDI is fine :)

I always look to SDL to do this kind of stuff, because I'm
pilled to make code that is ostensibly portable.
Like if I ever made a game I'd feel obligated to make
it work on linux.


@pkw oh yeah, portable is definitely the best way to go (and SDL is magic). I'd probably just use Debian stable if I wasn't so stubborn :)

I'm quite happy making little programs exclusively for myself (and potentially any other OBSD weirdos)