Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

I tested one more option:

sudo raspi-config
-> System Option
-> Wait for Network connection at Boot
-> No

Although the boot plot looks promising (the user env is reached in 8 s now!), the first piano note takes 25 s after power-on as before. Apparently just the chronological order changes:

https://i.postimg.cc/Gt3PTghG/pi400-ptq-boot-plot-nowait-net.png

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

groovy wrote:

I tested one more option:

sudo raspi-config
-> System Option
-> Wait for Network connection at Boot
-> No

Although the boot plot looks promising (the user env is reached in 8 s now!), the first piano note takes 25 s after power-on as before. Apparently just the chronological order changes.

Yes that option just runs dhcpcd in the background so it doesn't block the boot process, but dhcpcd still takes a while to dynamically acquire an IP address.

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

jari_42 wrote:

Yes that option just runs dhcpcd in the background so it doesn't block the boot process, but dhcpcd still takes a while to dynamically acquire an IP address.

Hm, but that I don't understand at the moment. When the dhcpcd is out of the way (running/disappearing in the background) - why doesn't my user command start instantly then?

It seems my user process waits until dhcpcd returns from background anyway.
Probably I just don't understand systemd enough.

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

groovy wrote:

Hm, but that I don't understand at the moment. When the dhcpcd is out of the way (running/disappearing in the background) - why doesn't my user command start instantly then?

It seems my user process waits until dhcpcd returns from background anyway.
Probably I just don't understand systemd enough.

Hmm good question, that is strange. It may be that VNC is blocking until the network is ready?

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

Good idea, but apparently not the reason. When I change my vnc.conf temporarily to ...

$localhost = "yes";

... the vncserver is just bound to the localhost address (127.0.0.1), but without speed-up.

On the other hand starting my (current) pianoteq scripts from commandline alone takes 7-8 s until the Bluesdemo autoplays (option --play).

I guess we can stop the subthread at this point. Until it is examined in deep I stay happy with 25 s boottime. Right amount to wash your hands before touching the keys

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

I tried to integrate Pianoteq some more into Raspberry Pi OS by writing my first systemd "unit", inspired by eriks, thank you!

/etc/systemd/system/pianoteq.service

[Unit]
Description=Pianoteq

[Service]
Type=forking
User=pi
LimitMEMLOCK=500000
LimitRTPRIO=90
ExecStart=/usr/bin/vncserver
ExecStop=/usr/bin/vncserver -kill $DISPLAY

[Install]
WantedBy=multi-user.target

After creating and editing ...

# systemctl daemon-reload

I can start and stop my Pianoteq/VNC environment now manually with ...

# systemctl start pianoteq
# systemctl stop pianoteq

... and automatically at bootime with ...

# systemctl enable pianoteq

Because the unit file has its own Realtime-Prio, I commented/disabled these options in limits.conf/audio.conf.

I don't use options like 'LimitNICE=-10' and 'Nice=-10', because they seem to have no or no positive effect in my system.

Attached an example of the running processes shown by htop.
I hope they look like Modartt intended for a RTPRIO host.

https://i.postimg.cc/HnH5774t/htop-tree-pi400-ptq.png

Last edited by groovy (07-12-2020 21:21)

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

Nice. I also tried this on the weekend but I reverted it because there were no significant gains in my case versus the crontab approach.

I didn't end up with quite the same thing as you:

[Unit]
Description=Run Pianoteq as user pi
DefaultDependencies=no
After=network.target

[Service]
Type=simple
User=pi
Group=pi
ControlGroup=cpu:/
LimitRTPRIO=90
ExecStart=/usr/bin/vncserver :10
TimeoutStartSec=0
RemainAfterExit=yes

[Install]
WantedBy=default.target

It's really curious that I can't gain anything even though this is what the critical chain looks like:

[pi@pianoteq:~ $ systemd-analyze critical-chain network.target
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.

network.target @5.613s
└─wpa_supplicant.service @5.109s +483ms
  └─dbus.service @5.000s
    └─basic.target @4.976s
      └─sockets.target @4.976s
        └─triggerhappy.socket @4.976s
          └─sysinit.target @4.971s
            └─systemd-timesyncd.service @4.622s +347ms
              └─systemd-tmpfiles-setup.service @4.452s +157ms
                └─local-fs.target @4.445s
                  └─boot.mount @4.338s +105ms
                    └─systemd-fsck@dev-disk-by\x2dpartuuid-482a00f1\x2d01.servic
                      └─dev-disk-by\x2dpartuuid-482a00f1\x2d01.device @3.567s

Pianoteq itself only takes a few seconds to be functional, so I ought to be up and running in 10-15 seconds or so... but no. I can't even get to the 25s mark that you achieved. I think the best I got was around 35s but it's really closer to 45s now.

Ultimately I reverted and went back to crontab because it seemed cleaner and doesn't have unexpected issues like failing to acquire realtime permissions. Actually, this is why I gave up on that approach -- even if I sequenced after basic.target, I couldn't save anything over this:

pi@pianoteq:~ $ systemd-analyze critical-chain cron.service
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.

cron.service @4.984s
└─basic.target @4.976s
  └─sockets.target @4.976s
    └─triggerhappy.socket @4.976s
      └─sysinit.target @4.971s
        └─systemd-timesyncd.service @4.622s +347ms
          └─systemd-tmpfiles-setup.service @4.452s +157ms
            └─local-fs.target @4.445s
              └─boot.mount @4.338s +105ms
                └─systemd-fsck@dev-disk-by\x2dpartuuid-482a00f1\x2d01.service @3
                  └─dev-disk-by\x2dpartuuid-482a00f1\x2d01.device @3.567s

Worth mentioning, but I think overclocking the SD card would almost certainly yield an improvement. Boot time is not important enough for me to go down that route, but I believe it should yield some seconds of improvement.

Last edited by navindra (08-12-2020 02:59)

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

Funny that you couldn't relax too

But eventually we are searching in the wrong place. How many seconds does it take, before the kernel starts running? Are the missing seconds here?

The Pi has to do a systemcheck, start a bootloader, eventually waits for a hotkey and finally has to find, read and boot a kernel on the USB SD-card.

PS: Isn't your ControlGroup option obsolete? (can't find it in man systemd.directives)

PPS: Because Pianoteq is a systemd unit now, it appears in the plot (large red bar).
https://i.postimg.cc/N2M9yF4q/ptqpi2-unit-boot.png

Last edited by groovy (08-12-2020 16:40)

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

Nice graph. It seems to show that Pianoteq is fully functional within about 11 seconds of kernel boot -- but I take it you still count 25 seconds?

You may be right that ControlGroup is obsolete -- it is straight from the official systemd documentation, but it didn't seem to have the expected effect:

https://www.freedesktop.org/wiki/Softwa...tRealtime/

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

navindra wrote:

Nice graph. It seems to show that Pianoteq is fully functional within about 11 seconds of kernel boot -- but I take it you still count 25 seconds?

Yes, and that's the reason I assume the time is lost outside of kernel- and userspace.

You may be right that ControlGroup is obsolete -- it is straight from the official systemd documentation, but it didn't seem to have the expected effect:

... 2013, could be a bit outdated.

I will take a break, my last changes were finally:

-  purged cpufrequtils (too much SysV-scripts all around)  and replaced it with linux-cpupower. Applied command now:

sudo cpupower frequency-set -g performance

- in my unit pianoteq.service is one more directive now, that places VNC/Pianoteq at the end of the chain, after the login getties:

[Unit]
Description=Pianoteq
After=getty.target

[Service]
Type=forking
User=pi
LimitMEMLOCK=500000
LimitRTPRIO=90
ExecStart=/usr/bin/vncserver
ExecStop=/usr/bin/vncserver -kill $DISPLAY

[Install]
WantedBy=multi-user.target

Result once more:
https://i.postimg.cc/56TV0QHV/ptqpi2-cpupower.png

Last edited by groovy (08-12-2020 22:44)

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

Well, guess what -- I cloned my current older SD card to a newer one (something I was going to do anyway), and now Pianoteq is fully functional in ~23 seconds. A massive improvement over the ~40 seconds average I was experiencing previously. Now competitive with my piano's boot up time.

Basically *nothing* I did really improved anything *except* switching SD cards. I haven't even overclocked the SD card.

The kicker is that all the systemd-analyze timings basically look exactly the same before and after the change.

pi@pianoteq:~ $ systemd-analyze  
Startup finished in 1.674s (kernel) + 6.381s (userspace) = 8.056s 
multi-user.target reached after 6.353s in userspace

pi@pianoteq:~ $ systemd-analyze critical-chain cron.service
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.

cron.service @4.823s
└─basic.target @4.816s
  └─sockets.target @4.815s
    └─dbus.socket @4.815s
      └─sysinit.target @4.801s
        └─systemd-timesyncd.service @4.463s +335ms
          └─systemd-tmpfiles-setup.service @4.304s +139ms
            └─local-fs.target @4.261s
              └─boot.mount @4.211s +48ms
                └─systemd-fsck@dev-disk-by\x2dpartuuid-482a00f1\x2d01.service @3
                  └─dev-disk-by\x2dpartuuid-482a00f1\x2d01.device @2.916s
Last edited by navindra (09-12-2020 06:27)

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

Top!

SD-Card here:
Intenso 16 GB UHS-I, micro SD 1, HC I, CLASS 10, "up to 45 MB/s".

Cheers

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

groovy wrote:

SD-Card here:
Intenso 16 GB UHS-I, micro SD 1, HC I, CLASS 10, "up to 45 MB/s".

That is very interesting indeed.

My previous card was a 5-year old Sony 70MB/s:
https://www.amazon.com/gp/product/B00X1404DA/

And the current one is a relatively new SanDisk 170MB/s:
https://www.costco.com/sandisk-extreme-...85627.html

Both of these seem to outclass the one you have. Perhaps my older card is nearing EOL? Might be worth giving Raspberry Pi OS Lite a try after all...

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

Good to know, thanks!

With raspi-config I changed the behaviour of the power LED "to flash during disk activity".

I see that it starts flashing after 11 s from power-on. The Bootloader seems to be the missing link.

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

navindra wrote:

I now have Pianoteq running on a compact and silent keyboard form factor. It is a top-notch experience. Computers and wires are out of sight — it’s just me and my piano.

With a touch on my iPad, I instantaneously have a full-screen touch-responsive Pianoteq!

Thank you navindra for your original post!

It inspired me to go back to Pianoteq that I haven’t touched for several years, ever since I bought the Yamaha Avantgrand N3X piano with its excellent Yamaha CFX binaural sampling (I didn't care much about the other on-board sounds as they didn't sound realistic).

However, in addition to using the fixed Avantgrand on-board samples, I always wanted to expand my choices with what Pianoteq can offer. Since I really hated having a laptop next to the piano and all the cables dangling around, your clean Pi 400 approach via an VNC/iPad sounded intriguing and I decided to give it a try. I bought the Pi 400 and a Motu M2 external USB sound card.

At the start of my process I was a complete newbie to Raspberry Pi, Linux, Terminal CLI, SSH, VNC and whatnot, and I stumbled several times. The experience was occasionally frustrating so I decided to start documenting what I do. This helped me if I needed to backtrack.

While this is primarily for my own records in case I need to replicate the process in the future, I am sharing my experience report, including some of my own tips, to help any other users who may want to follow this route:


Installing Pianoteq on Raspberry Pi 400: my experience


Happy to hear comments from this forum on how to further tweak the process.

Last edited by Yacob (18-12-2020 12:43)

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

Yacob wrote:

While this is primarily for my own records in case I need to replicate the process in the future, I am sharing my experience report, including some of my own tips, to help any other users who may want to follow this route:


Installing Pianoteq on Raspberry Pi 400: my experience


Happy to hear comments on how to further tweak the process.

This is extremely cool, Yacob! You have some great tweaks here, such as being able to change instruments directly with your piano! That's really great indeed.

If someone from Modartt sees this, they might consider sharing your write-up with a larger audience via the FAQ. Thanks for sharing!

Last edited by navindra (13-12-2020 19:27)

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

I like the idea to switch some presets with the keyboard!
Thanks

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

I just got around to fiddling with this again today. As an update, I got a hifiberry. It seems to work pretty well!

Thanks for showing the rest of your config files, groovy. It saved me a lot of fiddling with vncserver. I was able to replicate this setup and I think I will be using it now!

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

Nice to hear you continued and had success!
May I ask, which hifiberry soundmodule you are using with your Pi400?

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

Here's something I performed and recorded live on the Raspberry Pi 400 (second half):

https://youtu.be/_QCaMsV8gMs

I'm a beginner pianist, but what Pianoteq afforded me here was the ability to create something individually unique, and hopefully, something musically interesting.

The Raspberry Pi 400 never broke a sweat with this piece. It was flawless and invisible.

I ran Pianoteq on it at 48000 Hz, 128 samples, and 256 polyphony (never got this high), in real time. I had two simultaneous VNC sessions open to it to monitor recordings. I controlled switching purely from the Novus touch screen.

General Pianoteq highlights:

  • I never lost a recording -- MIDI auto-archiving is priceless.

  • Capturing MIDI with the ability to tweak voice settings and re-render extremely high quality audio is priceless.

  • Reviewing my performance on Pianoteq allowed me to identify many mistakes, such as missed or silent notes, and diagnose issues with my performance. Even when I wasn't performing on Pianoteq, it was always recording. Truly instrumental to the learning process, when you can no longer have a teacher by your side. It taught me to me listen more intently while playing.

I left the Pi on for many hours and it was rock-solid.

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

I was tipped off on Twitter that Pianoteq ARM64 on Raspberry Pi yields a significant performance boost.

Indeed it does!

This is a glissando from the lowest bass notes with sustain pedal down the entire time. I show both the configurations I actively use here (courtesy of PianoWorld):

http://forum.pianoworld.com/gallery/42/full/14169.png

http://forum.pianoworld.com/gallery/42/full/14170.png

This was a significantly less taxing test on ARM32 (from before):

http://forum.pianoworld.com/gallery/42/full/13954.png

It's a remarkable achievement. No spikes whatsoever on a challenging test.

I only hacked up my current installation to support 64-bit ARM temporarily, this isn't even a proper install.

Last edited by navindra (14-01-2021 04:53)

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

Hui, these are interesting numbers! Great!
Would be nice to see also a screenshot of a normal load with the MIDI file "Blues Demo".

Cheers

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

groovy wrote:

Hui, these are interesting numbers! Great!
Would be nice to see also a screenshot of a normal load with the MIDI file "Blues Demo".

This is Blues Demo with the NY Steinway D Classical Recording.

http://forum.pianoworld.com/gallery/42/full/14171.png

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

Thank you, navindra,
will install the beta-version!

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

navindra wrote:

I only hacked up my current installation to support 64-bit ARM temporarily, this isn't even a proper install.

Oh, I would like to try this as well. But how to do that? Is it easy to explain?

Thanks and regards,
Martin

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

MartinGr wrote:
navindra wrote:

I only hacked up my current installation to support 64-bit ARM temporarily, this isn't even a proper install.

Oh, I would like to try this as well. But how to do that? Is it easy to explain?

  • Backup your SD card. I skipped this, but it is needed.

  • sudo apt update

  • sudo apt upgrade

  • These are the steps you want to think twice about:

    https://www.raspberrypi.org/forums/view...p;t=250730

    After these steps, I found:

    • The new firmware breaks the Power On/Off button on the Pi 400. I reverted the firmware by force reinstalling the regular raspberrypi-bootloader package and that fixed the issue.

    • With the 64-bit kernel, my external USB device occasionally remains powered with "sudo halt" but does power down correctly with the button.

  • The next step is simple conceptually but harder to explain here. The Pianoteq 7 64-bit binary wouldn’t load without the 64-bit loader and libraries being present.

    What I did was copy over the binaries from the image at https://downloads.raspberrypi.org/raspi...020-08-24/ — and this is the bit that’s hard to explain. I had Ubuntu running via Multipass so that I could read ext4, then I pointed a loopback device to the Raspberry 64-bit image, and I mounted the ext4 partition on the Ubuntu instance. I made a tar archive of the binaries I needed, scp’ed them over to the Pi, and untar'ed them there.

There are different ways of accomplishing the same thing (you don't need Ubuntu at all), but this isn’t very intrusive to my current installation, and is trivial to revert.

You might also just want to install the Raspberry Pi OS 64-bit beta on a different SD card and start fresh.

Last edited by navindra (15-01-2021 03:52)

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

navindra wrote:

You might also just want to install the Raspberry Pi OS 64-bit beta on a different SD card and start fresh.

Thanks a lot for your explanations, Navindra. But finally, I did it like this... and it seems to work great, as far as I can say.

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

Ok, installed the beta-version of raspios_lite_arm64 now ...

cat /proc/version
Linux version 5.10.5-v8+ (dom@buildbot) (aarch64-linux-gnu-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1392 SMP PREEMPT Sat Jan 9 18:56:30 GMT 2021

... and more or less replicated my environment with tigervnc-standalone-server and the remote wireless GUI.

The performance index with pure 64-bit is higher than with 32-bit raspios, but still too edgy to use pianoteq's internal samplerate of 48000 Hz. Blues Demo with NY Steinway D Classical recording for example:
https://i.postimg.cc/hjKZ0cBJ/Pi400-arm64-Korg-B2-internal-48000-Hz.png

With the standard non-overclocked kernel (1800 MHz) the performance index is 29 on my arm64 system.

To be on the rock solid side I have to reduce to 32000 Hz internal sample rate on the 64-bit system (like before):

https://i.postimg.cc/0QZWWFkV/Pi400-arm64-Korg-B2-internal-32000-Hz.png

Because I have a self-compiled kernel on my 32-bit system (1000 Hz systemtimer) and the arm64 has a few issues with the halt/power-button I probably wait with the migration until arm64 is finally released.

Last edited by groovy (16-01-2021 10:52)

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

Argh, forgot to switch to MIDI local-off on the Korg B2, so its internal audio/midi-interface had to render both audio signals in my previous test, that of Pianoteq v7.1.0 and that of the Korg factory piano.

With local-off the audio load with internal sample rate 48000 Hz is nearly acceptable:
https://i.postimg.cc/9QMNSqct/Pi400-arm64-Korg-B2-internal-48000-Hz-localoff.png

I guess when I close the remote wireless GUI (my WLAN is poor) additionally it will be playable with more than 32000 Hz internal sample generation. - Have to check this.

Last edited by groovy (16-01-2021 12:44)

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

MartinGr wrote:
navindra wrote:

You might also just want to install the Raspberry Pi OS 64-bit beta on a different SD card and start fresh.

Thanks a lot for your explanations, Navindra. But finally, I did it like this... and it seems to work great, as far as I can say.

Thanks for the tips everyone, I also did this today on my overclocked Pi4 and while it took the best part of the day to replicate my setup, it was well worth it as the performance increase is quite substantial! The performance index went from 20 to 29

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

For the first time I tried to cross-compile a Raspberry kernel as described. Works fine, but to my surprise the compiled kernel has a lower version number ...

Linux version 5.4.83-v8-1000Hz+ (pi@ano) (gcc version 8.3.0 (Debian 8.3.0-2)) #1 SMP PREEMPT Sat Jan 16 17:05:44 CET 2021

... than the "normal" kernel in the Raspberry Pi OS distribution:

 

Linux version 5.10.5-v8+ (dom@buildbot) (aarch64-linux-gnu-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1392 SMP PREEMPT Sat Jan 9 18:56:30 GMT 2021

Do I have to compile and install a kernel branch to get a version >= 5.10 on the Pi 400?

Can I expect that branches rpi-5.10.y or rpi-5.11.y work inside my Raspberry Pi OS?
What is a recommended criterion to select a "branch"?


Late EDIT:
Gave the branch rpi-5.11.y a try and it works. FWIW.

Linux version 5.11.0-rc3-v8-1000Hz-rc+ (pi@ano) (aarch64-linux-gnu-gcc (Debian 8.3.0-2) 8.3.0, GNU ld (GNU Binutils for Debian) 2.31.1) #1 SMP PREEMPT Sun Jan 17 12:31:54 CET 2021
Last edited by groovy (17-01-2021 16:01)

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

Let me ask what might be a stupid question (please be gentle):

How much simpler would this list of instructions be if we forgo the whole VNC iPad controller idea?  Meaning, you configure the RP4 to boot into PianoTeq, load a preset, and just run like that? 

If this would make the instructions noticeably easier, perhaps we could fork the instructions for such a use case.

While changing all of the presets can be fun, for my kid's piano lessons and practice, we just need one default piano (for us the Steinway D).

Let me know.

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

klaberte wrote:

Let me ask what might be a stupid question (please be gentle):

How much simpler would this list of instructions be if we forgo the whole VNC iPad controller idea?  Meaning, you configure the RP4 to boot into PianoTeq, load a preset, and just run like that? 

If this would make the instructions noticeably easier, perhaps we could fork the instructions for such a use case.

While changing all of the presets can be fun, for my kid's piano lessons and practice, we just need one default piano (for us the Steinway D).

Let me know.

I'll answer my own question.  Basically, we
  1. follow Yacob's excellent instructions for all of Section 1,
    a.  Between step 1.8 and 1.9, connect your external USB sound interface using the USB port of the pi.  If you won't use an external USB sound interface, connect your headphones to the pi 3.5 mm audio jack, or install a DAC (hat) to your pi (e.g. https://www.pishop.us/product-category/audio/dacs/, details of which is beyond the scope here).
  2. skip all of Section 2
  3. [optional, but recommended to improve performance] follow all of Section 3
  4. [optional, but not recommended until system is working well]. Alternatively, connect a small touch screen to the pi, and mount it where it is convenient.

I have not performed this yet, but will be trying this soon.

Last edited by klaberte (26-01-2021 00:13)

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

Yacob wrote:
navindra wrote:

I now have Pianoteq running on a compact and silent keyboard form factor. It is a top-notch experience. Computers and wires are out of sight — it’s just me and my piano.

With a touch on my iPad, I instantaneously have a full-screen touch-responsive Pianoteq!

Thank you navindra for your original post!

It inspired me to go back to Pianoteq that I haven’t touched for several years, ever since I bought the Yamaha Avantgrand N3X piano with its excellent Yamaha CFX binaural sampling (I didn't care much about the other on-board sounds as they didn't sound realistic).

However, in addition to using the fixed Avantgrand on-board samples, I always wanted to expand my choices with what Pianoteq can offer. Since I really hated having a laptop next to the piano and all the cables dangling around, your clean Pi 400 approach via an VNC/iPad sounded intriguing and I decided to give it a try. I bought the Pi 400 and a Motu M2 external USB sound card.

At the start of my process I was a complete newbie to Raspberry Pi, Linux, Terminal CLI, SSH, VNC and whatnot, and I stumbled several times. The experience was occasionally frustrating so I decided to start documenting what I do. This helped me if I needed to backtrack.

While this is primarily for my own records in case I need to replicate the process in the future, I am sharing my experience report, including some of my own tips, to help any other users who may want to follow this route:


Installing Pianoteq on Raspberry Pi 400: my experience


Happy to hear comments from this forum on how to further tweak the process.

@Yacob, excellent instructions!  I think I will try this soon.

A few questions/clarifications (I too am a raspberry/linux newbie):
  1 At the end of Section 3.1, "sudo cpufreq-set -f 2200MHz", Does this just make sure that the freq is 2200 for the current session?  And will be unnecessary if/when we reboot?
  2 How do we reverse the action of Section 3.2?  Meaning, after this reboot, assuming you had a mouse and keyboard, how could you choose to go back to Desktop?

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

Sorry, another newbie Raspberry Pi question.  How much RAM (i.e. which Pi 4B board) do I need to run Pianoteq 6 or 7?  Can I run the full Desktop version of the OS with Pianoteq within 2 GB of RAM?

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

klaberte wrote:

  1 At the end of Section 3.1, "sudo cpufreq-set -f 2200MHz", Does this just make sure that the freq is 2200 for the current session?  And will be unnecessary if/when we reboot?

This will not stick unless you put it in a script right before you start Pianoteq:

pi@pianoteq:~/scripts $ cat Pianoteq7.sh
#!/bin/bash

sudo cpufreq-set -c 0 -g performance
sudo cpufreq-set -c 1 -g performance
sudo cpufreq-set -c 2 -g performance
sudo cpufreq-set -c 3 -g performance

# OR if you install cpupower, you can delete the cpufreq-set commands and uncomment:
# sudo cpupower frequency-set -g performance

/home/pi/Pianoteq7/arm-32bit/'Pianoteq 7' --multicore max --fullscreen
klaberte wrote:

  2 How do we reverse the action of Section 3.2?  Meaning, after this reboot, assuming you had a mouse and keyboard, how could you choose to go back to Desktop?

Log in and run "startx" from the command line.

You can also also run "sudo raspi-config" to change your desired settings more permanently.

You can also run "vncserver" which will run a new virtual (full) desktop that you can access via VNC.

klaberte wrote:

Sorry, another newbie Raspberry Pi question.  How much RAM (i.e. which Pi 4B board) do I need to run Pianoteq 6 or 7?  Can I run the full Desktop version of the OS with Pianoteq within 2 GB of RAM?

Yes, I believe that is enough.

Good luck!

Last edited by navindra (27-01-2021 08:16)

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

klaberte wrote:

Sorry, another newbie Raspberry Pi question.  How much RAM (i.e. which Pi 4B board) do I need to run Pianoteq 6 or 7?  Can I run the full Desktop version of the OS with Pianoteq within 2 GB of RAM?

I have a 2GB pi4. It is certainly adequate to run a desktop with Pianoteq but morphing and layering would probably do better with more memory and a faster system. I originally bought it to run Pianoteq. If I had to do it over I would have gotten the 4GB. I find that it runs well enough to use for other purposes. In particular, browsers are memory hungry and if one opens too many tabs the system will hit a performance wall rather quickly.

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

navindra wrote:
klaberte wrote:

  1 At the end of Section 3.1, "sudo cpufreq-set -f 2200MHz", Does this just make sure that the freq is 2200 for the current session?  And will be unnecessary if/when we reboot?

This will not stick unless you put it in a script right before you start Pianoteq:

pi@pianoteq:~/scripts $ cat Pianoteq7.sh
#!/bin/bash

sudo cpufreq-set -c 0 -g performance
sudo cpufreq-set -c 1 -g performance
sudo cpufreq-set -c 2 -g performance
sudo cpufreq-set -c 3 -g performance

# OR if you install cpupower, you can delete the cpufreq-set commands and uncomment:
# sudo cpupower frequency-set -g performance

/home/pi/Pianoteq7/arm-32bit/'Pianoteq 7' --multicore max --fullscreen

I think you are confusing overclocking with setting the cpu frequency to performance mode (leave the frequency to max).  If you are following Yacob's guide, we had already put an overclock set of commands in the /boot/config.txt file.  And in Section 1.8, we created the script to put the cpu's in performance mode.

So again, given the steps in the guide,
"sudo cpufreq-set -f 2200MHz", Does this just make sure that the freq is 2200 for the current session?  And will be unnecessary if/when we reboot?

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

klaberte wrote:

I think you are confusing overclocking with setting the cpu frequency to performance mode (leave the frequency to max).  If you are following Yacob's guide, we had already put an overclock set of commands in the /boot/config.txt file.  And in Section 1.8, we created the script to put the cpu's in performance mode.

So again, given the steps in the guide,
"sudo cpufreq-set -f 2200MHz", Does this just make sure that the freq is 2200 for the current session?  And will be unnecessary if/when we reboot?

Overclocking is done via /boot/config.txt. You reboot and you're done -- if it worked, overclocking was achieved.

Then you set the performance governor before running Pianoteq and you're done. The kernel will optimize for performance and lock at the highest speed it can.

For final verification that everything is correct and working, check the Perf/CPU tab in Pianoteq and make sure the CPU frequency is locked at the expected value (it's been known to turbo to higher frequencies than expected but that's OK) and doesn't fluctuate when you play.

That command you're concerned about is extra and can be safely eliminated.

Last edited by navindra (28-01-2021 03:22)

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

I am going down this path after being inspired by the folks on this thread  -- I do have some prior experience in linux, etc. but am getting stuck somewhere -- I've created all of the scripts, performance tweaks, perms, etc. downloaded the v 7 and followed Yacob's excellent step by step through 1.9. I have the pretty icon on my desktop, but nothing happens when I launch the icon or the file  in the home/pi/pianoteq folder. The cursor goes to hourglass briefly and then nothing - no indications in task manager. I'm using a 400 with Raspbian installed. Thanks in advance for any tips and advice.

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

chauncey wrote:

I am going down this path after being inspired by the folks on this thread  -- I do have some prior experience in linux, etc. but am getting stuck somewhere -- I've created all of the scripts, performance tweaks, perms, etc. downloaded the v 7 and followed Yacob's excellent step by step through 1.9. I have the pretty icon on my desktop, but nothing happens when I launch the icon or the file  in the home/pi/pianoteq folder. The cursor goes to hourglass briefly and then nothing - no indications in task manager. I'm using a 400 with Raspbian installed. Thanks in advance for any tips and advice.

Just try launching the Pianoteq binary directly first and see what happens? If you're using stock Raspberry Pi OS, make sure to use the 32-bit binary. You should get some output on the command line at least.

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

navindra wrote:
chauncey wrote:

I am going down this path after being inspired by the folks on this thread  -- I do have some prior experience in linux, etc. but am getting stuck somewhere -- I've created all of the scripts, performance tweaks, perms, etc. downloaded the v 7 and followed Yacob's excellent step by step through 1.9. I have the pretty icon on my desktop, but nothing happens when I launch the icon or the file  in the home/pi/pianoteq folder. The cursor goes to hourglass briefly and then nothing - no indications in task manager. I'm using a 400 with Raspbian installed. Thanks in advance for any tips and advice.

Just try launching the Pianoteq binary directly first and see what happens? If you're using stock Raspberry Pi OS, make sure to use the 32-bit binary. You should get some output on the command line at least.

If I click on the extracted Pianoteq_7.so file that is in the arm-32bit folder right after extracting the zip, I get a prompt to "select an application to open "shared library" files"  What file is the executable in this case? I downloaded Version 6 and it actually has an "app" in the download and that launches for me, but I don't see the equivalent binary / executable in the 7 extracted folder.

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

It is mentioned several times in this thread. Type in a terminal-window or commandline for example:

/home/pi/Pianoteq7/arm-32bit/'Pianoteq 7'

Replace the path in the line if it differs in your installation.
If you get an error post the message in a new thread for basic problems.
Good luck!

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

navindra wrote:

Here's something I performed and recorded live on the Raspberry Pi 400 (second half):

https://youtu.be/_QCaMsV8gMs

I'm a beginner pianist, but what Pianoteq afforded me here was the ability to create something individually unique, and hopefully, something musically interesting.

The Raspberry Pi 400 never broke a sweat with this piece. It was flawless and invisible.

I ran Pianoteq on it at 48000 Hz, 128 samples, and 256 polyphony (never got this high), in real time. I had two simultaneous VNC sessions open to it to monitor recordings. I controlled switching purely from the Novus touch screen.

General Pianoteq highlights:

  • I never lost a recording -- MIDI auto-archiving is priceless.

  • Capturing MIDI with the ability to tweak voice settings and re-render extremely high quality audio is priceless.

  • Reviewing my performance on Pianoteq allowed me to identify many mistakes, such as missed or silent notes, and diagnose issues with my performance. Even when I wasn't performing on Pianoteq, it was always recording. Truly instrumental to the learning process, when you can no longer have a teacher by your side. It taught me to me listen more intently while playing.

I left the Pi on for many hours and it was rock-solid.

Really interesting!
I am curious, are you / can you feed the Pianoteq sound back into the Novus to take advantage of its amplification and speakers?

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

I think I would like to take this plunge to the Raspberry Pi dedicated solution.

Any particular reason to use the RPi 400 keyboard setup vs. a standard RPi4?

I was looking at this setup of the RP4 with the Allo Digione Signature Board. See the link below.

https://www.allo.com/sparky/digione-sig...layer.html

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

riskun wrote:

I think I would like to take this plunge to the Raspberry Pi dedicated solution.

Any particular reason to use the RPi 400 keyboard setup vs. a standard RPi4?

I was looking at this setup of the RP4 with the Allo Digione Signature Board. See the link below.

https://www.allo.com/sparky/digione-sig...layer.html

I know the the Pi 400 is faster out of the box. Seem to remember it runs at 1.8Ghz vs 1.5 in the normal pi. So maybe you can get a smaller buffer or more polyphony. On the downside you lose the small form factor.

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

Things continue to work really well on this configuration. My update is that there is no update. The Raspberry Pianoteq 400 continues to be my daily driver.

I think I clocked it at 18 seconds of cold boot time now (at best) and I'm on the latest 64-bit OS image.

I also control my most often used features directly from my piano via MIDI mapping. For more complex stuff, I use the iPad. I'm looking forward to enjoying the innovations that the new JSON-RPC API will enable:

https://forum.modartt.com/viewtopic.php?id=9053
https://forum.modartt.com/viewtopic.php?id=9073

Then I may just run Pianoteq headless, kill the need for VNC, and instead let the UX be drawn entirely by the browser.

Ultimately, the entire point of this is to enjoy the piano. The magic is that there is no Pi:

https://youtu.be/y6rJvdodNfM

Last edited by navindra (31-12-2021 08:26)

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

Hi navindra. Thank you for sharing your experience.

I have a few question and hope you can answer them to help me better understand the general function/purpose of various VSTs.

For now I have no intention of running the PI 400 setup as you described in this thread. I'm not that bothered about the cables etc, so I will want to connect my NV10S (once it hopefully arrives in about a month) to my PC which has a 10700K, 32 GB RAM, PCIe SSD etc. The reason is that I want to run Pianoteq (or similar) from a device that (at least from what you said) will not break a sweat running even the most extreme scenarios.

Thus, my questions are general in nature regarding these types of software and what they do in comparison to running the piano with default out of the box software.

I'll give you a bit of background to help you answer my questions with as little effort as possible.

I bought the piano because I have neighbour troubles when practicing. They don't mind the teaching, but apparently the repetitive nature of practicing is really annoying to them (and I can appreciate that). I can still practice a small amount per day non silently, but I will need to practice mostly with headphones. I went for the NV10S because after trying it out 45mins per day for 4 consecutive days (unlike with the Yamaha N1X and N2) I was fairly convinced that for all intents and purposes it behaves just like an acoustic grand. The sound from the speakers doesn't quite represent a concert grand, but for me it's as good as a small grand and certainly better than my truly excellent Yamaha U3 upright.

I'm sure you've noticed that I wrote "fairly convinced" and that's because in the end I was still left with maybe 0.1% of doubt. Of course it's difficult to make a definitive determination after 4 days of short practice; and once I get the instrument this might quickly be dispelled through regular use. However once I found out about different possibilities (partly through your YT videos:) I have decided to prepare in advance and investigate if perhaps it's possible to dispel that remaining 0.1% of doubt in case it doesn't get dispelled just through regular use of the piano in it's default state.

In the process I worked out what I think is the key difference between the pianos default functioning (+ other sampled software doing essentially the same) and Pianoteq; and which was possibly the cause of the small amount of niggling doubt. Namely, the number of velocity layers on the Pianoteq is 127 vs up to only 16 using sampled sound, giving infinitely better dynamic control an making it in that respect essentially indistinguishable form an acoustic piano to the human ear. This to me is actually the key parameter to be able to convincingly mimick the acoustic grand on a digital instrument. The other is the action and of course the NV10/S has that and then some (which is also why I didn't get the Yamaha's: no proper pedal mechanism and the action is only OK while the Millenium lll is simply amazing!).

So with the background out of the way these are some of the questions I have and would greatly appreciate if you can offer your findings/opinions:

- with Pianoteq you can tell that you get infinitely more dynamic graduation and this in turn allows the instrument to without a shadow of a doubt feel and behave 100% like an acoustic piano? Or is it all about just a better quality of sound? Or both?

- if the answer to above is yes would this be the same with the Garritan software? Or is that still only a sample so the velocity layers are once again limited to max 16? (I ask this because I really like the CFX sound in that software, at least from what I've heard on YT).

- once set up, whichever software I chose, the sound can be reproduced through the speakers and the headphones? And in terms of the sound is it an improvement through the speakers, too, or only through the headphones? I ask this because as mentioned I will use the instrument to teach on, as well as for my practice.

-  how does it all work? This is what I understood so far and you can let me know where I might be wrong or have perhaps misunderstood: you connect the PC using a printer type USB cable with the NV10/S. You also connect from PC line out to NV10/S line in using a dual male headphone jack type cable. So it's 2 cables total running from PC to the piano? Then you install the software and you're pretty much good to go?

- while using these VSTs do you still retain the virtual technician and other functions on the NV10? For example, when trying out I found that unless I set the minimum touch to 1 the piano is a lot less convincing as an acoustic instrument. Also some headphone settings really make things a lot better vs other settings etc.

I tried to condense it as much as possible and I sincerely hope it's not all to much. Any response will be greatly appreciated. Thank you.

Last edited by Zveki (07-02-2022 19:25)

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

I would definitely live with the NV10S for a while and give it a fair chance first. This would simplify things quite a bit for you with regards to teaching and such.

I don't think you can look at objective numbers like velocity layers and come to a subjective conclusion that you might like Pianoteq better. There are many factors involved, but I think a large component also has do with how resonance is handled. This might be why people coming from acoustic pianos often take to Pianoteq. Garritan CFX is definitely very popular as well, though I have never tried it.

You can get the free trial of Pianoteq and experiment with it. Personally I hooked up an external audio interface and I used regular MIDI cables to avoid a ground loop situation. I only use speakers but headphones work perfectly. I'm happy with the setup.

You can post detailed questions or comments about the Novus directly in the forum here:
http://forum.pianoworld.com/ubbthreads....oards.html

Have fun and enjoy your piano!

Last edited by navindra (08-02-2022 07:19)

Re: Pianoteq 7 on Raspberry Pi 400 -- with iPad as interface!

Having come across this thread and the very helpful posts on here from navindra and yacob in particular I bought a pi400 which arrived last Saturday and thanks to those posts and the outstanding procedural document that Yacob created, by the next day Sunday I had my near 20 year old Clavinova CLP115 running Pianoteq and controlled by my Ipad. No screen for the pi400, as per navindra, it just boots straight into Pianoteq in less than 30 seconds.

I had been considering buying a new Clavinova but to get anything decent would have cost at least £2500. Having replaced the felts the keyboard is perfectly adequate for my standard of play and now with Pianoteq playing to external monitors (the 115 can't take an input) the sound is better by far than anything within my budget.

However I find the external monitors a bit overpowering and I would really like a complete solution where there is no visible change to the Clavinova. To that end I have ordered a 100w amplifier and a pair of 50w speakers to replace the CLP 115's 2 x 20w speakers. I see no issues with fitting them into the Clavinova and then when I can get a raspberry pi4 (they're out of stock everywhere just now) I shall put that into the Clavinova as well (the pi400 won't fit).

So when that's all done I will have a near 20 year old bottom of the range Clavinova sounding like....whatever Pianoteq makes DP's sound like!......and the only visible signs will be two extra power cables emerging from the bottom and a midi cable visible for an inch or two.

At the moment I see no issues with achieving this. If the amplifier and speakers I've chosen aren't quite right it will be a simple matter to change them. Having saved £2000+ I feel I've got some money to play around with!

So again thank you for all the helpful posts on here.