LPK25 + program doesn't seem to work

Francis posted Jan 20 '17, 22:30:

So, this project is otherwordly: the fact that I can take my sounds on the go and play them live with the band without spending thousands of dollars, buying a rare old sampler or using preset sounds from a keyboard is just great.

THE ONE PROBLEM I seem to be facing, thought, is that I can't move inbetween the sounds I've put on the USB stick by using the program button.
It's problably me doing something wrong, but here's how I do it:

1 - I put the sounds on the USB stick(I've only put the sound libraries provided over here for now, so this step is pretty streamlined)
2 - I plug all the cables and the usb stick in the Raspberry PI and then I power it
3 - I push the program button on the LPK25 and then, at the same time one of the 4 program buttons (A,A#,B,C)

What happens is that it always reloads library 0, every time.
Am I doing something wrong?
Somebody let me know, and once again THANK YOU for this amazing project! You're empowering people's creativity with this stuff.

Kees posted Jan 20 '17, 23:43:

The programm button of the LPK is only to change the programm of the LPK itself... and not of connected devices.

Francis posted Jan 20 '17, 23:56:

So I reckon there is now way to change the sound folder that's being used on this particular model of keyboard but to change usb stick altogether (or add hardware buttons). Am I right?

Kees posted Jan 21 '17, 00:43:

Yes, you are right and adding two hardware buttons is pretty simple...

Francis posted Jan 21 '17, 17:36:

... Tutorial? :)
Sorry for begging, total newb

Kees posted Jan 21 '17, 21:15:
Francis posted Jan 22 '17, 01:24:

Sorry... so simple... I can be very thick at times :)
Ok, I think this is all. Thank you for your help!!

Kees posted Jan 22 '17, 12:01:

Succes and let is know if you all went ok!

Jordi FG posted Feb 14 '17, 23:38:

Ook, I have more or less the same concerns as I also own and LPK25. I plan to do the buttons and screen thingy but meanwhile I thought about a possible solution. Maybe its a dumb thing, as my programming and midi skills are low...

As I have seen LPK25 does send only one midi command, CC64 (the sustain button). Would it be possible to tweak Samplerbox program to "listen" to this CC in order to advance programs?

AlexM posted Feb 17 '17, 08:57:

Hey Jordi,

Good idea! And quite a simple fix...

Open your samplerbox.py in a simple text editor and find this section:

    elif (messagetype == 11) and (note == 64) and (velocity < 64):  # sustain pedal off
        for n in sustainplayingnotes:
        sustainplayingnotes = []
        sustain = False

    elif (messagetype == 11) and (note == 64) and (velocity >= 64):  # sustain pedal on
        sustain = True

Replace it all with:

    elif (messagetype == 11) and (note == 64) and (velocity >= 64):  # LPK25 sustain button pushed
        if preset < 10:
            preset += 1
            preset = 0
        print 'Program change [%d]' % preset

There is a problem with this solution (and the current official SamplerBox release) is that SamplerBox doesn't know how many samplesets/folders you have. Since you're using only 1 button to iterate up through presets you have no way of going down again. A quick workaround: I set the number to 10 before it goes back to the 1st folder. Change "if preset < 10:" to however many samplesets you have :)

I haven't tested this - so let me know how you go!

Jordi FG posted Feb 17 '17, 18:33:

Sounds like a plan, will give it a try on Monday!

Roger posted Feb 20 '17, 00:40:

I tested out Alex's solution above to use the LPK25 Sustain button to iterate through sample sets. It works like a charm.

Thanks so much!

AlexM posted Feb 20 '17, 02:47:

Thanks @Roger! I actually hadn't tested it myself so this is good to know :)

If you're feeling adventurous, you can program the script to count the number of sample-set folders so that you don't need to manually edit the line "if preset < 10" to match your number of sample-sets

Jordi FG posted Feb 27 '17, 17:57:

Yay, a bit late but must confirm that also worked for me. Nevertheless, I finally added two external buttons (not even with screen). Cheap good stuff!


  (not published)
  I want to post as guest