migrating from original SamplerBox hardware
Started by hayesey




7 posts in this topic
hayesey

5 posts 1 threads Joined: Jun 2021
03-06-21, 11:14 -
#1
Hi,

I built my Samplerbox using the hardware from the original project shown here:

https://www.samplerbox.org/files/sampler...matics.jpg

I have pretty much that exact setup. I am using the midi din port (with an old yamaha pss680 as the midi controller).

I am using a Pi 2B. I have newer available but thought that would be powerful enough.

However with the original samplerbox I found that it seems very slow, if I press and release a key quickly (less than one second) then the note off isn't actioned so the note keeps playing until I press and release the key again slowly. On their forum I saw someone else describing the same issue and they were suggested to try this port so I have downloaded the 2021 image onto an SD card.

I am trying to setup the samplerbox configuration.txt to work with the hardware setup I have already.

I have set:

USE_I2C_7SEGMENTDISPLAY = True

but cannot see anywhere to define the I2C port and address for a 7segmentdisplay, only for HD44780 LCD.

I can't see where to configure 2 push button switches to move from one sample to the next like you can on the original samplerbox project, is that not possible anymore? How can I use the push buttons with a 7segment display since it wont show a menu system?

I am getting no sound, I have my midi din wired as per that diagram from the original samplerbox website, I do wonder if my issue there is that it's not picking up the correct audio out device (I have the usb dac connected), I can investigate this myself.
noek

40 posts 0 threads Joined: Jan 2021
04-06-21, 22:08 -
#2
(03-06-21, 11:14)hayesey Wrote: I built my Samplerbox using the hardware from the original project

I have set: USE_I2C_7SEGMENTDISPLAY = True
but cannot see anywhere to define the I2C port and address for a 7segmentdisplay, only for HD44780 LCD.

I can't see where to configure 2 push button switches ..... a 7segment display since it wont show a menu system?

I am getting no sound, ...., I can investigate this myself.

Hi Hayesey,
Setting display parm to True should be enough, the 7-segment uses standard I2C with default values or so (quite frankly, I have no clue). Anyway, it's the same as in Joseph's, maybe Hans will comment?

For the buttons to be similar to Joseph's wiring, you have to set:
Code:
#  -- USE_BUTTONS -- ; A valid GPIO value will activate the button
BUT_incr=17    ; Increase button, increases value/proceeds to next menu choice
BUT_decr=18    ; Decrease button, opposite of above.
BUT_sel=xx
BUT_ret=xx
in the configuration.txt. Values there seem to refer to the "trial box" as Hans calls it.

7-segment cannot display the menu (see docs) for pure physical reasons and the two button menu setup starts with preset +/-, so I think what you (are trying to) do reflects Joseph's version, never tried....

For "no sound" there is a faq on the home page.

Good luck, Noek
hayesey

5 posts 1 threads Joined: Jun 2021
07-06-21, 10:18 -
#3
Thanks for the reply, I have made some progress with this.

I have the sound working now, I think there were two issues:

- changed the AUDIO_DEVICE_ID setting from -1 to 2 (from the original samplerbox code, I suspect it was actually using the built-in audio otherwise)
- noticed UART settings commented out in the "config.txt" file in the root of the BOOT partition. There are comments in there saying that this needs uncommenting for midi din to work. I suspect this was my main issue, the device not receiving my midi data

The push buttons seem to work, I changed the button config to match your suggestion Noek and they seem to work. I have 3 sets of samples on a USB stick and I can move between them.

Most excitingly, this has resolved the performance issues I had with the original samplerbox code, I can now play notes quickly and chords etc... all work. It's great!

I still don't have the 7-segment display working. I realised the I2C address is hard-coded and my screen uses 0x70 rather than 0x71. I have changed the code in the ROOT partition but suspect the python bytecode hasn't re-compiled so will try that next.

I have the Pi connected to ethernet now so I can ssh to it and fix that.

I will put in a pull request to add a comment to the samplerbox configuration.txt about enabling the UART for midi din and I will also include code to put the I2C address into the settings file as I think that is useful. My 7-segment display is a cheap ebay alternative that doesn't use the same address as the Adafruit one the original samplerbox used.
hayesey

5 posts 1 threads Joined: Jun 2021
07-06-21, 16:11 -
#4
I now have this working completely including the HT16K33 7-segment display.

Turned out that getting the display to work was a lot more work than simply changing the I2C address as it uses a totally different controller chip to the Sparkfun 7-segment display used in the original samplerbox project.

I had to write a new driver for the display, I have created a pull request into Hans' github repo as this might be useful for others (this 7-segment display is a lot cheaper than the Sparkfun one).

Also added a comment to the configuration.txt file to remind people to enable the UART in the BCM chip's config.txt file as it's not obvious. 

I have to say, this is one of the coolest uses for a Raspberry Pi I've ever come across and I've been using them since they first came out and own most versions.
hansehv

168 posts 17 threads Joined: Dec 2020
08-06-21, 19:45 -
#5
Hi Hayesey,
Thanks for your kind words and contribution - I will merge it soon.

Regarding your observations and assumptions:
  • Using a 2B may work OK; used it myself before the features started to develop. It all depends: producing many notes and/or using the sound effects may cause CPU strain (the "hiccups, clicks & plops" mentioned in the FAQ).
  • The USB DAC should have been auto detected. If you're OK, I'll send you a PM to try some debugging (no hurry, your solution is a perfect bypass).
  • Good to hear the serial midi works as expected; I've recently updated it to adhere to midi standards. Perhaps your device sends realtime messages (like a clock signal), which the original code misinterprets.
hayesey

5 posts 1 threads Joined: Jun 2021
09-06-21, 08:52 -
#6
Thanks, I see that is merged now. Hopefully it will be of use to someone.

I think I will swap for a Pi 3B+ as I have one here anyway. The 2B seems to work fine mostly although I have noticed with some sample sets that I get occasional clicks/pops when playing a bit faster. I had thought it was the cheap DAC I'm using but maybe just the Pi's CPU struggling.

I will try setting the AUDIO_DEVICE_ID back to -1, in hindsight I suspect the issue was simply that my MIDI serial port wasn't working. I will try it later on.

I am using a combination of old Yamaha PSS keyboards (a 680 and a 790) and Cubase 2 on an Atari ST for sequencing. All working very well with MIDI DIN with this software. 

I just need to make an enclosure now and transfer my circuit from breadboard onto veroboard.
hayesey

5 posts 1 threads Joined: Jun 2021
09-06-21, 10:42 -
#7
(08-06-21, 19:45)hansehv Wrote:
  • The USB DAC should have been auto detected. If you're OK, I'll send you a PM to try some debugging (no hurry, your solution is a perfect bypass).

I've just tried setting the audio device id back to -1 and it works fine, detects the USB DAC no problem.

So this was a red herring, it was just the MIDI serial that was my original problem.
hansehv

168 posts 17 threads Joined: Dec 2020
09-06-21, 22:20 -
#8
(09-06-21, 10:42)hayesey Wrote: I've just tried setting the audio device id back to -1 and it works fine, detects the USB DAC no problem.
So this was a red herring, it was just the MIDI serial that was my original problem.
Such things happen - been there, done that  Rolleyes
Thanks for the feedback though, another checkmark set.