Code Monkey home page Code Monkey logo

loop-baby's Introduction

loop-baby

a portable and affordable audio looper with quantization

alt_textalt_textalt_text

how it works:

  • audio input/output via a usb audio adapter
  • midi clock signal via a midi-usb cable
  • raspberry pi (with Raspbian) routes audio through sooperlooper
  • buttons interface with sooperlooper (via looper.py) to control recording/playback/saving/loading/etc.

demo

demo.mov

requirements

hardware:

software:

  • python 3 with various packages (listed in requirements.txt)
  • jackd: for routing audio
  • sooperlooper: for looping

running

python3 looper.py -v -s

the loops will be time quantized if you provide a clock signal via a midi-usb cable

loop-baby's People

Contributors

mobeets avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

ngmacha

loop-baby's Issues

control volume of individual loops?

we want the 'wet' option for each loop

SET PARAMETER VALUES

/sl/#/set  s:control  f:value
   To set a parameter for a loop.

 where control is one of:

  rec_thresh  	:: expected range is 0 -> 1
  feedback    	:: range 0 -> 1
  dry         	:: range 0 -> 1
  wet         	:: range 0 -> 1

sometimes we get lots of mode buttons released at once?

tried reproducing but it seems mostly random. but it's always a random release of mode buttons. a hack solution would be to only count a release that has a registered press. so when we press, we make a tag, and when we release, we must find a matching tag, then clear the tag

mode: save

allow saving all audio in loops as an SL session file (.slsess)

  • only save once we hit the same track button twice, to make sure we don't overwrite
  • set colors
  • call self.client.load_session(infile) where infile = 1.slsess where 1 could be 1-8

better enclosure design

having to glue the nuts in is awful.
I think an improved design would be to just make the lid snap in (rather than being screwed down), like in the original design.

Here is the current design:
Screenshot 2024-01-30 at 3 30 55 PM

If you letter these pieces row-wise (A, B, C on first row, then D, E, F, G on second row), then the only pieces that would need to change are D/E, F, and C/G. We'd first need to make both D/E and C/G higher, and then add two more rectangle slots in D/E (as close to the top as the bottom slots are to the bottom) for the lid. Then we'd just give F the exact shape as B, and remove the four screw holes. Not a big change.

This would be giving up the existence of a top plate, which definitely looks nice. But in this new design we could screw the Trellis board into A and tighten the screws ourselves, before assembling anything else.

Oh, also, I think I did print some ends WITHOUT feet. Does this work better?

systemd fails to start jack

Below are the logs from sudo journalctl -u looper.service from the last startup:

Dec 12 21:10:33 raspberrypi systemd[1]: Started My service.
jackd: no process found
jackd was not running.
sooperlooper: no process found
sooperlooper was not running.
/home/pi/loop-baby/startup.sh: line 13: jackd_er
SooperLooper 1.7.3
Copyright 2007 Jesse Chappell
jackdmp 1.9.11
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2014 Grame.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to re
under certain conditions; see the file COPYING f
JACK server starting in non-realtime mode
self-connect-mode is "Don't restrict self connec
audio_reservation_init
Acquire audio card Audio1
creating alsa driver ... hw:1|hw:1|512|3|44100|0
configuring for 44100Hz, period = 512 frames (11
ALSA: final selected sample format for capture: 
ALSA: use 3 periods for capture
ALSA: final selected sample format for playback:
ALSA: use 3 periods for playback
JackTemporaryException : now quits...
Jack main caught signal 2
system:capture_1
system:playback_1
system:playback_2
JackPosixProcessSync::LockedTimedWait error usec
Driver is not running
Cannot create new client
cannot connect to jack
cannot connect to audio driver
cannot initialize sooperlooper
Cannot read socket fd = 3 err = Connection reset
CheckRes error
Could not read result type = 22
Client name = jack_connect conflits with another
Cannot connect to the server
JackShmReadWritePtr1::~JackShmReadWritePtr1 - In
JackShmReadWritePtr::~JackShmReadWritePtr - Init
JACK server not running?
error connecting audio (1)
Released audio card Audio1
audio_reservation_finish
Cannot connect to server socket err = No such fi
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init
JACK server not running?
error connecting audio (2)
Cannot connect to server socket err = No such fi
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init
JACK server not running?
error connecting audio (3)
16:
Connecting USB Midi to Sooperlooper
invalid destination address :0
Setting up Sooper Looper OSC client...
Initializing trellis interface...
Loading empty session from file: /home/pi/loop-b
Set param=input_gain, value=1.0, loop=None
Set param=dry, value=1.0, loop=None
Set param=quantize, value=0, loop=0
Set param=quantize, value=0, loop=1
Set param=quantize, value=0, loop=2
Set param=quantize, value=0, loop=3
Set param=sync_source, value=0, loop=None
Set param=sync, value=0, loop=0
Set param=sync, value=0, loop=1
Set param=sync, value=0, loop=2
Set param=sync, value=0, loop=3
Looper on!

SL and looper sometimes out of sync on loop count

sometimes I can only record to one loop
and it turns out it's because SL thinks there's only one loop, so it ignores commands to a loop that doesn't exist
the hacky solution is to add a track via the loop-baby by being in mode==None, and then pressing the next track button (according to loop-baby). this will call add_loop() to SL, which will then add the 2nd loop. so then you can record to that 2nd track now.

in general, i think i don't have a way of getting state from SL.

settings: eighth_per_cycle

for quantize's settings options, instead of just having 'cycle' we should have 'cycle + 1/2' (which would set quantize -> cycle, and 8th/cycle -> 4), and 'cycle +1' (which would set quantize -> cycle, and 8th/cycle -> 8), etc.

mode: clear

clear the audio recorded to a track

undo_all osc command for that track

make settings hierarchical

we are currently out of available settings buttons.

probably the best path forward is this: for each setting, have the sub-option be based on pressing that button a certain number of times. e.g., sync_source might be button 1, and as you press it the colors go through a cycle indicating which option is selected

multipress -> settings

it's too easy to accidentally hit shortcuts like restart, and it's too hard to remember them anyway. let's just make them each a button in settings:

  • soft restart
  • hard restart
  • shutdown

mode: record/overdub

will save a button, and it makes intuitive sense to group record with overdub rather than it having its own function

mode: recall

related to #18

  • only recall once we hit the same track button twice, to make sure we don't overwrite
  • handle button colors to show what's available
  • call self.client.load_session(infile) where infile = 1.slsess where 1 could be 1-8

NOTE: will have to somehow fetch the number of loops; also, unmute everything

Upgrade to sooperlooper 1.7.6?

Hi Jay,
I attempted a similiar project in 2019 but stopped because sooperlooper 1.7.3 crashed randomly.
Reading the issues.txt file, I noticed that you have the same issue.
According to http://essej.net/sooperlooper/, there is an updated version 1.7.6 with bugfixes.
However, there is no binary for Raspberry Pi. Looks like you have to build from source code.
Do you still use 1.7.3 or did you already upgrade to 1.7.6?

Best Regards,
Klaus

audio quality degrades randomly?

things to check:

  • the cheap usb interface?
  • clipping because signal too hot?
  • my shitty speaker?
  • something to do with alsamixer?

edit: sometimes it was the signal being too hot. but most of the time it's because of silent xruns.

settings: setting sync_source also enables 'sync'

just to clarify, this is not a new settings option. but whenever the sync_source is set to something other than 'None', we should also enable 'sync' on each track, otherwise sync_source itself does nothing, so that would be silly

settings: quantize

i believe this is a global setting in the gui, but in OSC commands it might be per track? will have to verify

connect midi to SL programatically

in qjackctl, I connected the midi from my usb into sooperlooper
ALSA: "16:USB Midi > 0:USB Midi MIDI 1" => "129:sooperlooper > 0:sooperlooper"
these ports don't show up in 'jack_lsp -c' so it might be a separate thing to make this link programmatically

way to boot into debug mode?

we don't want to have to stop the system thing because it takes so long.
maybe if you hold a button down while booting it skips it?

settings: undo/redo

'clear' is basically an 'undo_all'. (related: #20) probably just having a simple undo/redo would be helpful too though!

will have to think about how to handle this in the UI though.
e.g., is this a separate mode? or is it a toggle for clear? (but that could be confusing.) who knows.

update saved_sessions differently

we are updating saved_sessions so quickly that SL hasn't had time to write to it yet. when this happens, the button colors are off because it hasn't found the saved files yet, even though it soon WILL be saved.

instead, we could update it manually, assuming it's saved.
and then later, when we hit the load button, we should recheck.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.