The main thing to be careful about IMO is to get the right board to communicate directly over USB (Micro, Leonardo, Teensy, see the documentation), otherwise (Uno, Nano) you will need a serial-MIDI converter software like hairless (with GUI) or ttymidi (command line).
For the LED lighting I took inspiration from my other commercial controllers, and set the arduino's code to light up the LEDs by sending a notein and then it off with a noteoff (if you have multiple colors or blinking mode, you can use different velocities, e.g. 36 1 1 for solid green on button 36 (channel 1), 36 2 1 for blinking green, 36 3 1 for red, etc.
You can also hardcode the LEDs status with the buttons status, but you may loose flexibility (especially when using Pd, but it may be more complicated to use a DAW if you have to set up when to light up the LEDs, not sure).
Now I am looking into building another controller with faders and knobs, and there I'll indeed also need multiplexers, as I believe that the bigger Arduino I could find had ~40pins. You will probably need digital pins for the buttons and LEDs, while potentiometers need analog pins (as far as I could understand so far, but I'm also new to this!).
In any case, regardless of how you initially program the arduino (e.g. only notein/noteout to control the LEDs), you can just decide otherwise later on and reprogram it (just like you would update a commercial controller's firmware) to change the note numbers of each button, add special modes to give other functionalities to the same buttons, this kind of things.
Let me know how it goes I'm hoping to get started on mine in 2 weeks or so.
Thank you @oid , I should have thought about that right away!
Turns out that
aseqdumpdoesn't show any difference (NoteOn with velocity 0 is interestingly displayed as NoteOff, but it works anyway on the 64bits machine to turn off the LED).
I found one cause by chance however: If I connect Pd with the MIDI device via ALSA-MIDI, it works fine, but if I connect them via JACK-MIDI, I can't turn off the LEDs!
So when I connect PD with the controller with
aconnect 130:1 24:0it does work fine on both laptops. Not sure whether that might be caused by a2jmidid in the end, but I guess it is solved (and indeed not related to Pd!).
So, continuing my investigations, I have had no more success with [cyclone/xnoteout] and raw hex midi messages sent to [midiout]. And not better either if I start jack with
-Xraw, and both laptops use the same version of a2jmidid.
Two more details:
- laptop where it works: Jack 1.9.14, 64 bits
- laptop where it doesn't work: Jack 1.9.12, 32 bits. I could try to upgrade jack to 1.9.14 but it may have to use different repositories or potentially mess up dependencies.
I am having a weird issue, not sure whether it is actually due to Pd or not: in order to turn on and off the LEDs of my Midi controller, I need to send it a noteon message with a velocity of 1 (turn on), 2 (blink) or 0 (off). This works very well on one of my machines with Debian 10, Pd vanilla version 0.49.0-3 or Pd-L20rk 2.15.2, by sending
[noteout 1], however on another machine with also Debian 10, Pd vanilla 0.49.0-3, only the velocities of 1 or 2 make the LED turn on or blink, but impossible to turn it off with a velocity of 0!
I first thought that it may be due to Pd interpreting NoteOn with velocity of 0 as NoteOff, but it works fine on one of the computers.
Jack is started on both machines with
-dalsa -Xseqand I run
a2j -eto access the Midi devices through Alsa. If I stop a2j I can successfully turn the LEDs on and off with
amidi -phw,2 -S "90 40 01"or
00". So I am ruling out the hardware/driver issue.
What else could it be, any idea anyone? I shall check the version of a2j later today, but they are both up-to-date using Debian buster repos so I doubt I'll find any difference there...
Sorry if this turns out to actually not be related to Pd, but I hope someone may be able to help anyway
@ingox Yeah I've tried to play around with [pd~] before (not very successful so far though), but in this case I'd be considering different patches as different tools that I may or may not want to use together, hence the idea of starting them independently.
@oid Great input, thank you so much! I'll definitely strip down my Bunsenlabs install, but it's already pretty decent out of the box. And I just adjusted the CPU governor as you suggested.
I've fixed Meterec in the meantime but I'll give Nama/Ecasound a try, looks very interesting!
@EEight Good to hear, thanks for your answer! I do start pd in realtime.
In the meantime I found meterec for multitrack recording in a terminal, which works pretty well, except that the ncurses interface blinks at every refresh. Instead of looking into fixing this I will probably focus on Pd then
with fx (delay, reverb, disto)
How do you apply the effects in your setup? are they also custom Pd patches, or is it safe to use external ladspa plugins?
single core doesn't change much for pd (since it's single-thread process)
Do you think that it is then preferable to run one single pd process with subpatches instead of several instances of pd? e.g. I already have one for the drumkit, I would probably make a completely separate one for recording and effects, and maybe a separate one for the mixer, but not sure whether the 3 pd processes would compete for CPU time?
I recently dug out an old Eeepc 701 4G from Asus that I bought second-hand in 2008 - 1-core Intel Celeron inside, with 4GB RAM. I have an audio interface Roland UA22 so that the setup can support realtime audio (Debian 10, RT kernel, jack with RT) with no XRuns and latency <10ms at 44100Hz/128/3. However, obviously, as soon as the CPU is expected to do some calculation, it is much less fun!
In particular I want to use a sampler for some instruments, typically a drumkit connected to MIDI pads, so I wrote a small no-gui Pd patch to load one single wav file in each of 16 clones (for 16 pads) responding to 16 midi notes. I want to keep them in separate clones so that I can assign them to different audio output. Right now it is quite CPU intensive, so I will have to add [switch~] and volume ramps to turn on dsp processing only when the midi note is played and hopefully without clicks.
Further in the workflow, Non-Mixer and Non-Timeline work great for a few tracks, but if I try to record several tracks for several of the drums audio outputs at the same time then the poor laptop is struggling.
TL;DR: Long story short, I'm considering using less fancy mixer and audio sequencer, i.e. command line or Pd patches with no or very basic GUI (no live GUI update as I record for example), BUT I would like to be able to occasionally use some audio effects (reverb, delay and such). Before I get into that, do you guys think that such solution would be bearable for the brave eeepc? Would other languages be more efficient than Pd on this machine?
Or (this is not the right place to ask, but I try anyway) do you know terminal-based utilities that could fulfill this otherwise? I'm thinking of a ncurses mixer similar to alsamixer, or an audio sequencer in the style of CuSE, which would be awesome.
Hi all (and probably most relevant to @jancsika),
I noticed today that Purr-data 2.13.0 systematically crashes when I try to save a patch with an [mknob] in it. Counts for patches that used to work with prior versions, as well as empty patches started from nothing with only a [moonlib/mknob] in it ("Save as" opens the window, but the actually saving crashes and the .pd file is 0b big). I seem to have the exact same issue on OpenSuse 15.2 and Debian 9.0 with the packages hosted on OBS (the Opensuse one says
$ > purr-data -version Pd-L2Ork version 2.13.0 (20200802-rev.70066071) compiled 12:00:00 Aug 24 2019
Not sure if it is a real bug that I should have reported to Purr-data's Gitlab page, if it is known already,or if I should use another knob or anything?