Jump to content

qplus as headless midi synthesizer


fizban

Recommended Posts

I just bought a qplus 4GB/64GB and installed the latest buster desktop image from @balbes150 (https://users.armbian.com/balbes150/aw-h6-tv/) with the mid-term intention of building some sort of headless sf2 midi synthesizer that can be connected to a usb midi keyboard with acceptable latency.

I also had lying around an old minix x8-h plus (S812 based), but I was not able to make armbian work on it with an external usb soundcard for more than a few minutes (somehow it always crashed).

 

The qplus works very nicely, although I had problems with lightdm on second boot and the greeter did not apper. I went for the nodm route for autologin and it seems to do the job (although nodm seems to be no longer being developed). The shutdown does not seem to work properly. It seems to restart xwindows and then it suddenly shows the armbian logo.

 

The usb card gets recognized without problems. Mine is a CM108-based one (LogiLink ua0078). This is not one of the really cheap ones that do not have the capacitors required for a low noise sound. There are quite a few cards with the CM108 chip, but most lack the big capacitors. Anyway, I guess that a PCM2704 based one would also work.

 

I first tried the "low complexity solution" explained here and the latency is noticeable without using jack. Once jack is installed, the combination vmpk+qsynth and external keyboard work pretty well and with low latency.

 

Then I also tried an even simpler solution using just fluidsynth and using jack was also fine.

 

The samplerbox code also seems to work fine, but it is not sf2-based.

 

Since the LogiLink card has 4 buttons (and some pcm2704 cards also have 4 buttons), I intend to use them to configure the instrument, the bank and maybe the soundfont itself and the shutdown.

 

Anyway, if anyone has some ideas to ease the way, they will be very welcome.

Link to comment
Share on other sites

@fizban - for me those cheap pcm2704 adapters usually gave much better latency than the other cheap usb audio adapters: https://github.com/hexdump0815/sonaremin/blob/master/images/pcm2704-01.jpg

 

maybe have a look at sfizz as a sampler - it allows to use sfz files (much better than simple sound fonts) of which there are quite a few amazing ones around on the net (quite a few on pianobook for instance):

https://github.com/sfztools/sfizz/

https://github.com/hexdump0815/sfizz-arm-build (my notes on building it on arm)

 

if you want to go a bit furher, you can even run a full modular synth with around 2k avaiable modules (vcvrack) on your qplus - i did builds for h6 tv boxes for an older version - for instance here: https://github.com/hexdump0815/sonaremin/releases/tag/v1.1.6_8 but not yet on the latest improved version https://github.com/hexdump0815/sonaremin-ng ... but for vcvrack you'll have to add a fan to your box as it otherwise will get too hot and throttle the cpu

 

good luck and best wishes - hexdump

Link to comment
Share on other sites

Thank you @hexdump . Great tips!. and great repositories too!.

The fact that those PCM2704 chips always come without an enclosure holds me back slightly. Still, I will try one of them, but the ones with 4 buttons, since the aim is to be able to use the box without monitor, mouse or keyboard. Plug the box, connect a midi keyboard, some heaphones or speakers to the usb DAC and start playing, using those buttons jut to switch the instrument.

The sonaremin looks cool, but it is beyond what I intended.

I followed your instructions to build sfizz. With buster I had to change the name of a component in apt install, but it eventually compiled. I connected the midi keyboard with it using a2jmidid and sfizz with jack normally. I tried a sfz file and it seemed to play nicely but I noticed that one of the cores was reaching 100% while the rest were much lower. As I started adding some simultaneous notes, the sound started crackling and that one core stayed at 100%. With fluidsynth the load was minimal all along. I guess fluidsynth is a more mature development and at the moment, the sf2 format is good enough for me.

 

By the way, I reverted nodm to lightdm-autologin-greeter, which does not do the weird restarting of xwindows upon shutdown, but it still does not really shutdown the box, leaving it at the logo. I guess that is a limitation of the qplus itself.

 

Link to comment
Share on other sites

After some experimentation with different options out there, I decided to create my own simple solution. I called it yafspiano (Yet Another FluidSynth Piano) and it is available in my github: https://github.com/fizban99/yafspiano

 

I must say I was surprised at the low latency you can get. I set jack to 2 periods of 64 frames (that's a theoretical latency of 2.6ms) and I don't seem to get xruns.

 

I included detailed instructions for installing it in Armbian, including how to install Armbian on the QPlus.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines