Topic: Pianoteq (stage) on ARM / Zynthian

Hi all,

I just tested the demo version of Pianoteq(stage) on a RPi3: Works if you tune your RPi for audio setups! Very nice!

I want to use Pianoteq on Zynthian (http://zynthian.org) - an open-source/open-hardware synth based on a Raspi. Due to a limited and small display on the Zynthian, I cannot use the Pianoteq-GUI without a network connection and display forwarding. That's bad for using it as a live instrument. Also using the LV2 plugin inside MOD-UI has the limitation that I cannot switch to other Pianoteq instruments (like the MKI).

For using Pianoteq as a live instrument on Zynthian I need a solution for the following problems. Perhaps someone has an idea?

- headless running (without GUI) but switching between (predefined) setups (via commandline?).
- LV2: switching to other sounds (like Hohner or MKI).

Thanks and regards,

Holger

Re: Pianoteq (stage) on ARM / Zynthian

The Pianoteq executable has some options for selecting prefs/presets etc. Use the --help option to list them all.

--no-prefs        : start Pianoteq STAGE without using any saved preference
--no-audio-prefs  : start Pianoteq STAGE with a clean audio/midi configuration
--prefs FILENAME  : stores the preferences in the specified file
--fxp FILENAME    : load an FXP file on startup
--preset NAME     : load a preset on startup
--list-presets    : display the list of all presets

It's not very to me clear how the headless prefs handling is meant, the "--prefs" options obviously writes a prefs file (something you cannot to from the GUI), but there is not mention about how to load a specific prefs file. I didn't try.

I had to install the raspian GUI only to set up Pianoteq, i.e. activating the product and selecting the audio output. But since the GUI seems to use about 25% of the cpu you should disable the GUI later using e.g. "sudo systemctl set-default multi-user.target" and only start Pianoteq headlessly.

Best
-- erik

Re: Pianoteq (stage) on ARM / Zynthian

Hi Erik,

many thanks! Something seems to be strange with my installation (6.0.3 DEMO):

# ./Pianoteq\ 6\ STAGE --help
Pianoteq STAGE Trial version 6.0.3/20171030 -- http://www.pianoteq .com
Copyright (c) root@minibian#

I don't get any information about the available options. I have tried some of yours, but it seems that some of them also do not work (like "--preset"):

# ./Pianoteq\ 6\ STAGE \
>         --headless \
>         --no-prefs \
>         --no-audio-prefs \
>         --multicore 1 \
>         --internal-rate 22050 \
>         --preset "MKI Gentle Chorus 1"
terminate called after throwing an instance of 'std::bad_cast'
  what():  std::bad_cast
Loading preset MKI Gentle Chorus 1Aborted
root@minibian#

What version do you use?

It seems that there are many other options available but it seems that they are not documented.

Regards, Holger

Re: Pianoteq (stage) on ARM / Zynthian

Hi Holger --

yes, actually "--help" doesn't work with the ARM version of Pianoteq, but it does with the amd64 on my standard Linux laptop.

[erik@twenty ~]$ pianoteq --help
Pianoteq STAGE version 6.0.3/20171030 -- http://www.pianoteq .com
Copyright (c) 2017 Modartt.
Options from command-line:
 --help            : show this help, and quit
 --version         : show current version number and date, and quit
 --no-prefs        : start Pianoteq STAGE without using any saved preference
 --no-audio-prefs  : start Pianoteq STAGE with a clean audio/midi configuration
 --prefs FILENAME  : stores the preferences in the specified file
 --fxp FILENAME    : load an FXP file on startup
 --preset NAME     : load a preset on startup
 --list-presets    : display the list of all presets
 --midimapping NAME: load a midimapping preset on startup
 --midi FILENAME   : load a midi file, or a *.m3u playlist content. If filename is a folder, 
                     the midi files contained in that folder
 --wav FILENAME    : export midi file as WAV file, and quit
 --flac FILENAME   : export as FLAC
 --mp3 FILENAME    : export as MP3
 --rate FREQ       : change the sample rate for the exported wav
 --bit-depth D     : change the bit-depth for the exported wav (16,24 or 32)
 --dither ON/OFF   : turn dithering when exporting on or off
 --normalize       : turn on volume normalization for the exported wav
 --mono            : export the wav file as mono
 --headless        : do not show the graphical interface
 --fullscreen      : start in fullscreen mode
 --play            : immediately start playing the midi file
 --play-and-quit   : start playing the midi file, and quit when it ends
Example of use: Pianoteq STAGE --preset "U4 Small" --midi foo.mid --wav foo.wav

-- erik

Re: Pianoteq (stage) on ARM / Zynthian

Thanks again, Erik!

Ok - on amd64 I can also see the options and I can do someting like that:

#./Pianoteq\ 6\ STAGE --headless --multicore max --internal-rate 22050 --jack-session "Pianoteq" --preset "MKI Tremo"
Loading preset MKI Tremo
Current preset: MKI Tremo, instrument: Vintage Tines MKI

But this does not work on ARM :-(

Regards, Holger

Last edited by C0d3man (05-01-2018 14:15)

Re: Pianoteq (stage) on ARM / Zynthian

Hi Holger,

What is your motivation to use Zynthian, the hardware or software part? My thoughts as standalone solution, without integration into Zynthian:

  • On a PI there is an option to force output to HDMI even when no display is connected, so the gui version runs 'without a display' (or VNC client). Is that a viable alternative to running the "--headless" option?

  • Switching between presets and instruments can be realized via midi buttons from the pianoteq options.

  • Switching between a selection of presets should be possible using the preset manager and filtering the results.

  • My impression was that "--headless" does not respect velocity custom velocity curve, but I didn't investigate that further.

  • No success using the "--preset" option on arm as well, that is probably a bug of the still young arm version.

Lukas

Re: Pianoteq (stage) on ARM / Zynthian

Hi Lucas,

I need to use Zynthian because I need some more instruments (like Dexed, setBfree, ...) beside Pinaoteq and with Zynthian I can store snapshots of my setups. When Pianoteq will work smoothly inside Zynthian I have my absolute favorite (retro-)setup in a small box: DX7 (=>Dexed) , Korg-CX3 (=>setBfree), Rhodes (=>Pianoteq) and much more instruments. I own every of these instruments in real hardware and you can trust me: They all are very heavy :-)

Your idea of a headless Pianoteq is a nice solution. Perhaps I will try this just for fun (and as long the ARM binary has the current bugs) - but buying a license for me (and other Zynthianiacs) would need the possibility of a complete headless integration.

Regards, Holger

Re: Pianoteq (stage) on ARM / Zynthian

Hey Holger,

I have to correct myself, there are no bugs, commandline parameters worked fine today on my Odroid using ssh (stage demo v6.03 arm, md5sum=1b339...). Moreover, the non-functioning of my velocity mapping was a misunderstanding of the concept from my side. It's stored as part of the preset and my custom curve is of course not included in the default presets, but only in the ones saved by me (e.g. preset 'my1').

All this worked for me today, as it should:
  pianoteq --help
  pianoteq --list-presets
  pianoteq --headless --preset "Steinway D 3 Mics"
  pianoteq --headless --preset "Steinway D Jazz"
  pianoteq --headless --preset "My Presets/my1"
  pianoteq  --headless --multicore max --internal-rate 22050 --jack-session "Pianoteq" --preset "MKI Tremo"

If Zynthian is able to call shell scripts, you can at least switch between some (custom) setups.

The Zynthian device looks like a nice little hardware box. Do you plan on using the buttons to modify pianoteq parameters for 'live-tuning' and creating new presets? How is Zynthian intended to realize the interface to pianoteq? Currently, Pianoteq does not expose all of its options to the commandline (e.g. for initially selecting the audio interface), and functionality is limited without the gui. X11 forwarding is another option for initial setup (and creation of the custom presets).

Maybe some X11 libraries are needed to run even in headless mode (just a guess, because I have an installed desktop environment)?

Best, Lukas

Re: Pianoteq (stage) on ARM / Zynthian

Hello Lukas --

yes, as far as I know X11 libraries are needed to run even in headless mode, but it's not necessary to boot into the graphical shell, multi-user target is enough and you can then run Pianoteq non-headless on your remote X11 with "ssh -X <yourhostname_or_ip> <path_to_pianoteq>" for setting up everything graphically.

Best
-- erik

Re: Pianoteq (stage) on ARM / Zynthian

Hi Lukas,

thanks for testing. It seems that the binary has problems with headless mode on a Raspi. I have the same binary (thanks for the MD5!), but got this:

# ./pianoteq  --headless --multicore max --internal-rate 22050 --jack-session "Pianoteq" --preset "MKI Tremo"
terminate called after throwing an instance of 'std::bad_cast'
  what():  std::bad_cast
Loading preset MKI TremoAborted
#

Running with GUI works... strange.

BUT: If I install Minibian (old Raspi-Debian-Distribution from 2016, debian jessie) and I am using ALSA: it loads another sound! Now I am checking what happens if I install and use Jack2 to check if a newer distribution (libraries) are the problem or the newest Jack2 software I am using.

hmmm... strange again:

#  ./Pianoteq\ 6\ STAGE --list-audio-devices
No device type is currently selected.
Current preset: Steinway D Prelude, instrument: Grand Steinway D
#

I cannot see any audio device...

It seems that I cannot switch easily between ALSA and JACK on command line... I never get JACK ports created... Are you suing JACK as audio backend?

Regards, Holger

Last edited by C0d3man (08-01-2018 11:09)

Re: Pianoteq (stage) on ARM / Zynthian

# ./pianoteq  --headless --multicore max --internal-rate 22050 --jack-session "Pianoteq" --preset "MKI Tremo"
terminate called after throwing an instance of 'std::bad_cast'
  what():  std::bad_cast

It's strange because the stage version is running fine on my RPi3 -- can you check which version of Raspbian you are running in /etc/debian_version ? It could be an issue with the libstdc++ of Debian 9

Re: Pianoteq (stage) on ARM / Zynthian

julien wrote:

# ./pianoteq  --headless --multicore max --internal-rate 22050 --jack-session "Pianoteq" --preset "MKI Tremo"
terminate called after throwing an instance of 'std::bad_cast'
  what():  std::bad_cast

It's strange because the stage version is running fine on my RPi3 -- can you check which version of Raspbian you are running in /etc/debian_version ? It could be an issue with the libstdc++ of Debian 9

Yes - I can confirm: It's a problem with the distribution. Yesterday I used Minibian-wheezy and Pianoteq on command line was working. Than I upgraded to stretch and the problems occur again. Today I tried Raspian-minimal (Debian 9.3/stretch) and the same happend again.

Do you think this can be fixed at your side or do I have to try to install an older libstdc++ for backward compatibility?