hexdump0815 / sonaremin

"vcvrack in a box" or "roll your own synth"
60 stars 5 forks source link

IMPORTANT: this repo has been superseeded by https://github.com/hexdump0815/sonaremin-ng

the sonaremin

sonaremin image 01

welcome to the wonderful world of the sonaremin. the name sonaremin is combined from the latin word for sound: sonare and the end of theremin, the name of an unconventional instrument for its time in the 1920s. what is the sonaremin? it is following the philosophy of modular synthesizers by plugging together several excellent open source software projects to create something new. those projects are: vcvrack, raveloxmidi, jack, xpra, overlayroot, fluxbox, linux, ubuntu and many more. the goal is to create a a very flexible and easy to use device which can be used to create electronic music without the need of a computer. as soon as it gets plugged into the power socket it will start and it will be ready in about a minute. one just needs to connect a midi controller to it for playing it and at the end it can simply be unplugged from power to turn it off.

for creating sounds it uses the wonderful vcvrack modular synthesizer by running special sound-patches created for it, which can then be played and/or manipulated by a connected midi controller. the sonaremin has two modes of operation: display mode and virtual mode.

besides that it might also be used as a good prototyping platform for audio experiments running on linux and small arm based computers. it runs on multiple devices, is based on a recent mainline linux kernel (4.19 and 5.0 right now), a long term supported standard ubuntu distribution (18.04 lts), it has some audio optimizations applied and has gpu accelerated opengl support (as good as possible for the different devices).

IMPORTANT: in case you run into problems with vcvrack on the sonaremin, please create an issue in this git repo and not in the vcvrack repo, as the problems might be related to the sonaremin and not to vcvrack in general

changelog

version 1.1.6_8

version 1.1.6_7

version 1.1.6_6

version 1.1.6_5

version 1.1.6_4

version 1.1.6_3

version 1.1.6_2

version 1.1.6

version 1.1.3 (planned only - not released, skipped)

version 1.1.1

version 1.0.0

version 0.5.0

display mode

in display mode the sonaremin will operate like a regular vcvrack installation: you connect the sonaremin to a hdmi monitor, connect a keyboard, a mouse, maybe a midi controller and an amplifier to it and can create or modify vcvrack patches with it.

virtual mode

in virtual mode the sonaremin does not need a mouse, a keyboard and a monitor. it will work either completely on its own endlessly playing a generative patch or can be used as an instrument with a midi controller attached. both is possible by simply copying a properly prepared patch to a certain location which it will then automatically use on startup. even in virtual mode it is possible to connect to the sonaremin via ethernet and share the screen with its running vcvrack via the xpra software (https://xpra.org/ - a good commandline on linux for instance is 'xpra --opengl=no --encoding=rgb --title="sonaremin" attach ssh/sonaremin@sonaremin/100'), which offers desktop viewing applications for linux, macos and windows. this mode is only useable for checking the operation or changing some settings (like jack connection or midi learn setup), as in this mode there is no gpu acceleration available for the screen rendering which results in all cpu power being eaten up by the graphics and close to none being left for audio, but for simple tasks this is still sufficent.

rtpmidi and jack network mode

more info coming soon ...

supported hardware

the sonaremin currently runs (more or less) on the following arm cpu based devices:

the comments in the brackets mean:

the basic functionally is the same for all devices, but their cpu performance and thus possible maximum size of the possible patches differs a bit.

as a result recommended is the odroid c2 as it has a good performance and does not need cooling. also recommended are amlogic s905w/s905x based tv boxes as they have a good performance, do not need cooling and are cheap (around 30 euro for a box with 1gb ram, a bit more for a box with 2gb ram which is even better, but 1gb works well too) and come with a case and power supply already. the raspberry pi's are good as well, but need very good cooling.

please keep in mind, that with the exception of the raspberry pi's all other devices will need an extra pcm2704 usb audio adapter (just google for pcm2704, they cost around 3 euro on ebay, have low jitter and good latency - see the pictures in the images folder for which device to get exactly: https://github.com/hexdump0815/sonaremin/raw/master/images/pcm2704-01.jpg and https://github.com/hexdump0815/sonaremin/raw/master/images/pcm2704-02.jpg) as the internal audio is not working well enough for low latency audio or does not support a 32khz sampling frequency. the raspberry pi's work with the built in audio, but it has slightly worse latency and and quality compared to the pcm2704.

the qjackctl in the sonaremin images includes prepatched connections for an akai apc key 25 and for an worlde mini midi controller and the vcvrack patches have their midi-cc connections learned for the akai apc key 25. if any other controller should be used it is required to adjust and save the qjackctl patch configuration and relearn the midi-cc connections in the sample patches to properly use them with other controllers.

installation

for installing the sonaremin on one of the supported devices the provided images need to be downloaded (see the releases section on github), decompressed (gunzip to get rid of the .gz) and then flashed to an sd card of at least 8gb size (more is not a problem). please refer to the many ressources on the internet on how to decompress the .gz files and how to flash the images properly to an sd card depending on what operating system you are using for this task.

in the case of the amlogic s905w/s905x/s905 tv boxes there is an extra step required to enable multi boot mode. first a disclaimer: this worked for me and for lots of others for many amlogic s905w, s905x and s905 based tv boxes and is usually a very easy and reliable process, but there is always a small risk that it might brick the tv box - you have been warned. the procedure to enable multi boot mode is described here: https://forum.armbian.com/topic/2419-armbian-for-amlogic-s905-and-s905x-ver-544/ - the basic steps relevant are:

for some devices an adjustment for the dtb file is required - see the comments in the file menu/extlinux.conf (if there are any comments) in the BOOT partition of the written sd card.

configuration

the basic configuration of the sonaremin device is done in the menu/extlinux.conf file on the BOOT partition of the written sd card (see above as well) for setting the overlayroot mode or not and the file config/sonaremin.txt in the DATA partition of the written sd card: here the display mode (display or virtual) is the most important. besides that it is possible to turn off the audio tuning on boot, turn off the automatic start of qjackctl and vcvrack and change the maximum cpu clock in the case of a tinkerboard to avoid it overheating. it is possible to enable samba to be able to access to the BOOT and DATA partitions over the net as smb shares to change the configuration or to up- or download patches to the sonaremin.

there are more options to configure the sonaremin, which will be described at a later time here (rc.boot-local, rc.xsession-local, config/systems directory, qjackctl directory)

the default patch used in virtual mode is always vcvrack-v1/sonaremin.vcv on the DATA partition of the sd card, so the desired patch to be run in virtual mode should be copied there. by default the generative-01.vcv patch is copied there, so that the sonaremin should give some sound about a minute after it starts if everything is working well. in display mode vcvrack will use the patch last used in display mode - the initial default is the generative-01.vcv sample patch.

the username to use when logging in remotely via ethernet to the sonaremin is "sonaremin" and the password is "sonaremin" as well - please change the password with the "passwd" linux command for security reasons if you plan to connect the device more often to a network. the hostname you should able able to find the device at in the network is "sonaremin" as well and remote login is possible via ssh and in virtual mode an xpra desktop sharing connection is possible too.

in display mode the right mouse button opens a menu to open a terminal window, an editor, start qjackctl, vcvrack (if not already running), select some keyboard layouts, reboot or shutdown the sonaremin. in display mode it should always be shutdown properly via the shutdown or reboot commands. in virtual mode it can be simply powered off without any shutdown assuming it is configured to run in overlayroot mode.

please be aware, that vcvrack will always start in iconified mode in the sonaremin. this is because in in virtual mode otherwise the missing gpu acceleration would result in a lot of cpu being wasted to software-render the ui into nirwana - if started iconified no cpu cycles are used for rendering. in display mode vcvrack has to be deiconified from the applications tab at the bottom of the screen before using it.

overlayroot mode

by default the sonaremin is running in overlayroot mode, i.e. the rootfilesystem is mounted read-only and and top of that a memory filesystem is mounted read-write. this means, that all changes to the systems are lost when the device is powered off and this allows to simply power off the device without a proper shutdown in virtual mode. the DATA and BOOT partitions are mounted regularly in read-write mode, so that configuration changes done in files located on them and patches saved onto the DATA partition are not lost after a reboot. this is also the reason while various configuration files of qjackctl, vcvrack etc. are symbolically linked from the system partition to the DATA partition.

if permanent changes should be done to the system (for instance installation of software or more fundamental configuration changes) it can be switched between overlayroot and non overlayroot mode in the menu/extlinux.conf file and by rebooting the sonaremin afterwards. do not forget to switch it back to overloayroot mode afterwards. temporary access to the root filesystem in read-write mode is possible with the "overlayroot-chroot" command. to get root simply use "sudo -i".

upgrading the installed vcvrack version

it is possible to upgrade the vcvrack version used in the sonaremin in case there is a newer build of vcvrack for available at https://github.com/hexdump0815/vcvrack-dockerbuild-v1/releases ... the following is a short summay to do the upgrade (requires some command line experience and assumes a machine with an ssh and scp client installed to connect to the sonaremin)

  # first switch the sonaremin into no_overlayroot mode by following the comment on top of the
  # menu/extlinux.conf file on the BOOT partition (should be accessible from any linux, macos
  # or windows machine as its a normal dos filesystem) 
  # second disable qjackctl and vcvrack autostart by changing the setting for QJACKCTL_START
  # and VCVRACK_START from "yes" to "no" in config/sonaremin.txt on the DATA partition (should
  # be accessible from any linux, macos or windows machine as its a normal dos filesystem)
  # third start the sonaremin with ethernet connected
  # then download the latest release from the above link - assuming it to be named
  # vcvrack.aarch64-v1.tar.gz in this example now
  # then copy it to the sonaremin
  scp vcvrack.aarch64-v1.tar.gz sonaremin@sonaremin:.
  # then login to the sonaremin - see above for the password
  ssh sonaremin@sonaremin
  # on the sonaremin, unpack the new version - it will take a while
  tar xzf vcvrack.aarch64-v1.tar.gz
  # move aside the old vcvrack version
  mv vcvrack-v1 vcvrack-v1.old
  # move the unpacked new version to its place
  mv vcvrack.aarch64-v1 vcvrack-v1
  # go to the old versions directory and copy some config files over to the new version
  cd vcvrack-v1.old
  cp template.vcv autosave.vcv settings.json ../vcvrack-v1
  # shutdown the sonaremin
  sudo -i
  shutdown -h now
  # undo the changes in menu/extlinux.conf and config/sonaremin.txt above and on the next start
  # the sonaremin should use the new vcvrack version

known problems and things to keep in mind

in general the sonaremin already works quite well - this is a list of things i have noticed and which should be kept in mind and maybe should be fixed one day:

technical notes

a lot more info will come here over time - just some basic points already:

tips and tricks

a lot more info will come here over time - just some basic points already:

possible future plans and ideas

thanks, issues, more documentation

a lot of thanks go to all who made this possible, like the respective authors of the included or used open source projects like andrew belt for vcvrack, rui nuno capela (rncbc) for qjackctl, dave kelly for raveloxmidi, armbian - especially the tv box related part maintained by oleg, the vc4 raspberry pi gpu driver by eric anholt, the linux-meson project for amlogic arm linux mainline support and many many more ...

the generative-01.vcv patch is based on this patch https://www.youtube.com/watch?v=WVeP1a04DOs from omri cohen, but modified to fit the sonaremin, the other patches are built by myself.

please use the issues for this github project to give feedback if it works well or not, for which hardware it works well, if you find solutions for possible problems or if you run into unexpected problems, but please keep in mind that this is a one person project so far and my time to work on it is limited.

this documentation is the first draft to get the initial version of the sonaremin out - it is by far not complete yet and does not cover all topics, but it is at least a start and i tried to cover the most important parts.

now enjoy the sonaremin!

best wishes - hexdump

sonaremin image 02