Skip to content

NixOS QSynth Setup Guide

rexim edited this page Jul 16, 2016 · 4 revisions

Currently Dimooper doesn't generate any actual sound and completely relies on an external synth. In this guide we gonna see how to make Dimooper work on NixOS with QSynth and an external MIDI Controller. It is probably possible to use a different similar to QSynth synthesizer, but we gonna focus on QSynth since I use it. We are not gonna use Jack, because for some reason it doesn't work on my system and I still don't know why. We gonna use ALSA sequencer then. It's probably possible to make that thing work with Jack. But I've never have a chance to try that.

Setting up a MIDI Controller

I'm using Novation Launchkey Mini, because that's the only portable MIDI controller that I have. I really hope that Dimooper can work with other MIDI controllers. :)

Not sure what problems could happen during setting up a MIDI controller. I just plugged it in my laptop via USB (because apparently that's the only connection supported by Launchkey Mini) and the system simply picked it up. Try doing the same and check if amidi (it's a part of alsa-utils, by the way) sees your device:

$ amidi -l
Dir Device    Name
IO  hw:3,0,0  Launchkey Mini MIDI 1
IO  hw:3,0,1  Launchkey Mini MIDI 2
$

Setting up QSynth

I assume that you have QSynth installed in your system by whatever convenient way for you. For example with nix-env command:

$ nix-env -i qsynth

The first thing you probably need is some General MIDI SoundFonts for QSynth. I grabbed them from http://schristiancollins.com/soundfonts/

Start QSynth. Go to Setup -> Soundfonts and add the downloaded SoundFonts there. Then Setup -> MIDI and set the MIDI driver to alsa_seq.

Leave QSynth running for your entire Dimooper session.

Setting up Dimooper

Go to the Dimooper development environment:

$ nix-shell dimooper.nix -A dimooperEnv

Build and run Dimooper without arguments:

$ cargo run
     Running `target/debug/dimooper`
0) Output: Midi Through Port-0
1) Input: Midi Through Port-0
2) Output: Launchkey Mini MIDI 1
3) Input: Launchkey Mini MIDI 1
4) Output: Launchkey Mini MIDI 2
5) Input: Launchkey Mini MIDI 2
6) Output: Synth input port (21257:0)
Usage: ./dimooper <input-port> <output-port>
error: Process didn't exit successfully: `target/debug/dimooper` (exit code: 1)

Dimooper just printed all of the MIDI ports it sees. We need to find the input port of the MIDI device and the output port of the synth. In my case they are:

  • 3) Input: Launchkey Mini MIDI 1
  • 6) Output: Synth input port (21257:0)

The next step is to provide the port numbers to Dimooper accordingly:

$ cargo run 3 6

That's the entire setup for now. We really hope to simply this in the future.

Clone this wiki locally