Leet linux preset

Home Forums LEET Synthesizer – Support Leet linux preset

Viewing 6 reply threads
  • Author
    Posts
    • #1919
      vicquick
      Participant

      So I think I am close to getting this thing working, and am already pretty excited. However, I get an error message when running SamplerBox that the ‘preset’ is not defined. I am also using a soundcard that is connected to the GPIO pins and might be causing some issues? Would these simply have to be changed in the samplerbox.py? Where and how do I define the preset?

      This is the message I get:

      Opened audio device #1
      /home/pi/SamplerBox/samplerbox.py:374: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.
      GPIO.setup(20, GPIO.IN, pull_up_down=GPIO.PUD_UP)
      /home/pi/SamplerBox/samplerbox.py:375: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.
      GPIO.setup(21, GPIO.IN, pull_up_down=GPIO.PUD_UP)
      Exception in thread Thread-1:
      Traceback (most recent call last):
      File “/usr/lib/python3.7/threading.py”, line 917, in _bootstrap_inner
      self.run()
      File “/usr/lib/python3.7/threading.py”, line 865, in run
      self._target(*self._args, **self._kwargs)
      File “/home/pi/SamplerBox/samplerbox.py”, line 388, in Buttons
      preset += 1
      NameError: name ‘preset’ is not defined

      Preset empty: 0

       

      Thanks a lot in advance!

    • #1920
      vicquick
      Participant

      Due to my soundcard already using GPIO 20,21 I could circumvent the error message by simply wiring the two switches to GPIO 16, 26. However, I still get an error message, now saying that the sound device is invalid.

      Expression ‘parameters->channelCount <= maxChans’ failed in ‘src/hostapi/alsa/pa _linux_alsa.c’, line: 1514
      Expression ‘ValidateParameters( outputParameters, hostApi, StreamDirection_Out ) ‘ failed in ‘src/hostapi/alsa/pa_linux_alsa.c’, line: 2825
      Invalid audio device #1

       

      Any clue on this?

    • #1921
      vicquick
      Participant

      Update for anyone interested:

      I added a line in  /etc/asound.conf to reduce the sample rate to 16000hz:

      pcm.array {
      type dsnoop
      slave {
      pcm “hw:wm8960soundcard”
      channels 2
                     rate 16000
      }
      ipc_key 666666
      }

       

      No more error messages for now at least. Only two out of the six buttons work, and I still have to find a way how to get my first sample played but will see how that works out.

    • #1922
      vicquick
      Participant

      48000 should also work

    • #1923
      vicquick
      Participant

      Everything is working now, after realising I actually needed to load some presets – hence the empty presets earlier.

      I still only use two out of the six tact switches, but will probably discover their function sooner or later. Thanks for publishing such a nice project!

    • #1930
      Johan von Konow
      Keymaster

      Hi, sry for not beeing able to help, but im glad that you figured it out anyway ;)
      “Winners never quit and quitters never win”

      I added the other switches for future use, like menu navigation, volume etc. If you miss a function, modify the python code. Check the BUTTONS THREAD (RASPBERRY PI GPIO), row362

       

    • #2027
      vicquick
      Participant

      Hi Johan,

      thanks for your reply! Indeed, the GPIO error came from the soundcard I have installed as a pi-hat, changed the code, wiring and all good now.

      What you mention about GPIO buttons for volume and menu navigation sounds really interesting! Any info/details I can find on that? Controlling the volume by buttons would be awesome

      cheers

Viewing 6 reply threads
  • You must be logged in to reply to this topic.