Debugging Help Needed!

A
Andrew posted May 2 '16, 16:44:

Hi!

My first time trying to get this to work here, and I've got a little stuck... I've never used a Raspberry Pi before, but as far as I can figure out, I've followed the instructions!

I've formatted the microSD as FAT32 (using my mac), put the image on using the description shown on the Raspberry Pi website
I've loaded the samples onto three different USB sticks, from terrible quality, to something modern and quick.

I've got the PCM2704 based soundcard, but I've not bought the screen or buttons. I'm assuming that's ok, and I'm using an old Midiman Oxygen 8 as a MIDI keyboard...

Any ideas what could be going wrong? Sadly I've not got access to a screen this week, so it's not going to work to connect via HDMI at the moment...

K
Kees posted May 2 '16, 20:27:

Hey Andrew,

1) Which Pi do you use (Pi3 needs another image)
2) Do you power your Oxygen8 via USB? Mine works, but only when powered (via the mains adapter or a powered hub)
3) Do you have wired ethernet? If so, you can plugin your Pi, find the IP-adres (in your router) and ssh to the Pi.

Suc6,
KC

A
Andrew posted May 2 '16, 22:32:

Thanks for the reply!

It's the Pi2, and I've just tried out ssh. Really useful - I've checked the status and ls /media readouts from the terminal, and it all seems correct (I checked against a few other forum posts).

...just the, I decided to check out the keyboard a bit more... drum roll please - it appears the Oxygen8 mk1 isn't class compliant :( I'm assuming yours is the mk2?

A
Andrew posted May 2 '16, 23:11:

Ok, found I have a homebrew Teensy-based midi footpedal at home - works fine with my mac, with class compliance, but not producing sound on the Pi...

So, a few questions...
1) Is the default with the downloadable image to have the samples on this USB stick? If not, is there a specific location to put them on the microSD?
2) The default audio device is set to '2' on the file shown on Github... does the '2' mean the USB, or the Pi's soundcard?
3) Is there any lengthened guide to how to compile my own version, with a non-existant level of Python knowledge? I've been attempting to build it, and just coming up with errors!

/A

K
Kees posted May 3 '16, 00:10:

Andrew,

1) Default location is on a USB-stick, which mounts to /media
2) The software should find your USB-soundcard. Without changing that value mine found the Phat-DAC (I2S Dac).
3) Why compile. You can change the Python code on the SD via ssh:

  • Mount the filesystem in RW: mount -o remount,rw /
  • cd ~/Sampleplayer
  • cp sampleplayer.py sampleplayer.py.org (always good practice to backup ;)
  • nano sampleplayer.py
  • after edit and save restart the software with: systemctl restart samplerbox

What type of midi does the teensy footpedal spit out? It has to be note-on / off messages. You don't have a USB to midi cable?

K
Kees posted May 3 '16, 00:13:

BTW, when you remounted the SD-card in RW, it's a good prectice to shutdown the pi properly with: shutdown -h now of reboot.

E
Erik posted May 3 '16, 18:11:

Some things I learned and my take to modifications (from my head, perhaps I miss some capitals):

First of all: the login is
root
Password:
root

Open read/write access:

Mount -o remount,rw /

cd
cd SamplerBox

Change the startup Script:
nano samplerbox.sh

Add some delay and startup from USB disk for development and testing and perhaps for always
Make the file look like:

sleep 5
cd /media
python samplerbox.py

save:
ctrl-x
y
enter

On the USB stick add your samples and the samplerbox files (samplerbox_audio.so)

After this, you can login as root from ssh or local and modify the setting in samplerbox.py

After logging in, you have to kill the python process first for testing:

top
wait 3 seconds
ctrl-C
notify the process number from python (the top one most probably)
kill the python process
kill 324
cd /media

Now you can test/debug your modifications:

nano samplerbox
save:
ctrl-X
y
enter

run:
python samplerbox.py

To quit:
ctrl-C
And start again with Nano

Now you can just back-up your USB stick, even make modifications from another computer without ever changing the file system to read/write.

A hard-boot will start the samplerbox from the USB stick.
just type

reboot
or powercycle

Works great in my situation. Hope this helps some-one else.

I'll make a release of my modifications soon, they include:

  • RPI3 support (done)

  • Accurate velocity (done)
    in the original python script the sample is always played a the default velocity (if a sample is played in a velocity range it is always played that the maximum level, now the level is according the actual played velocity). I assume all samples are nomalized.

  • Shift samples. (done)
    Added a parameter that can be used to shift the played samples in the multiple velocities, while maintaining the velocity level. Suppose there are 4 levels of velocity in a piano, adding this value to 64 (50%), the top 2 samples are played over the full velocity of 127 levels. As the top samples are typically more bright, this make the sound much brighter. For a piano this works great to make it more brighter but keeping it dynamic. Lowering will make it more authentic (ballads, solo) while increasing will make it more suitible for a band context.

  • Added Freeverb (done)
    Full implementation of freeverb is working, All parameters can be freely assigned to midi CC. I'm pretty critical to reverb, but I'm astound by the quality of the verb. Very useful!!! Full floating implementation, hardly any grain in the tail. nice one!
    Only adds a few percent of extra CPU load.

  • Added 2x2 channel playback of backing tracks (done)
    Using a 4 channel Audio interface, I can play a stereo backingtrack and a stereo clicktrack together with the sample. In the python code it is easy to use any midi parameter for selecting the backingtrack and any midi parameter to start/stop the backing track.
    I use a Maya 44 USB+ fro this now and for some reason the 44.1 KHz frequency is not stable (some clicks), after changing all samples to 48KHz it is super stable

  • Limited the polyphony for sustain pedal actions.
    In the original code the notes where added for every note press of the same key when the sustain pedal is pressed, this creates too many notes.

I'm finalizing now and make the option for selecting 2 channel playback and 4 channel a configuration item, I want to optimize the audio code to full C++ instead of cython and move some other stuff from python to C++. Freeverb is done in C++, so i got the interface working. Also want to disable Freeverb when the wetlevel is 0.
On very dense actions, I now need to limit the polyphony to 40, otherwise I get some ticks.
Hope those optimizations will help to increase it.
Even with the 40 notes of polyphony, my piano sounds great. The best piano I ever heard from a module.
I sampled my Yamaha CVP609 CFX piano on 6 levels every 3th key at 48KHz. Really nice result.

Once I have everything cleaned up I'll release my version.

K
Kees posted May 3 '16, 21:09:

Nice addition to transfer the scripts to USB! Did you never had problems with the USB-drive not unmounted properly (due to the RW state)? My pi is nagging about this every time. Gives no problems though.

I am wondering how your mods are behaving on a PI2. Specialy the velocity and freeverb part.

Did you add some control surface? (I did with a Adafruit-like (MPC23017) lcd-plate. Now trying to add a couple of rotary encoders instead of buttons. Very handy to scroll trough a long list of samplebanks :)

E
Erik posted May 3 '16, 21:26:

I've ordered a LCD display and will add this, but as i control everything from my Kurzweil PC3, everything is fully under control via USB-midi.
the LCD is only nice to have some feedback.
I assume the freeverb will work correct, also the other. Perhaps the 4 channel is too much, but doing everything in C++ might help.
Putting the samples on the SD card (and picking a fast SD card) might also help with faster loading. I am not able to free more memory on my version of the SamplerBox image.
There is no Raspi-config to Get access to the full SD card.
For me there is no problem, as I only use one sampleset (my piano). Al other sounds are great from my Kurzweil PC3.

E
Erik posted May 3 '16, 21:32:

Another thing to remember for new users:

If you remount as read/write for doing modifications, do NOT use
mount -o remount,r /

After this, there is no mount possible anymore and you have to start from scratch.

Just reboot, after a reboot the disk is mounted as read-only.

E
Erik posted May 3 '16, 21:32:

Another thing to remember for new users:

If you remount as read/write for doing modifications, do NOT use
mount -o remount,r /

After this, there is no mount possible anymore and you have to start from scratch.

Just reboot, after a reboot the disk is mounted as read-only.

K
Kees posted May 5 '16, 09:58:

Hey Andrew,

Was wondering if it already worked out for you?

Cheers,
Kees

A
Andrew posted May 8 '16, 06:25:

Hi!

I managed to borrow an Akai LPK25 keyboard last night from a friend - I'll be trying it out a little later, and will then get back to you :)

Thanks for all the help so far by the way!

A
Andrew posted May 9 '16, 22:13:

We have lift off! At some point the microSD card had corrupted. Just wiped it and started again! Works great! I can't wait to get the extra bits and pieces to finish off the build now!

J
Jon posted Oct 3 '16, 07:25:

I know its a while back but wondered if anyone here who has Midiman Oxygen8 tried using
sudo apt-get install midisport-firmware
as described here: https://ubuntuforums.org/showthread.php?t=96506

I know the driver is for the midisport usb-to-midi box, but I think looking at this, http://usb-midi-fw.sourceforge.net/ some of the older midiman/maudio controllers used the same technique to support midi over usb.

...

  (not published)
  I want to post as guest
 

Post