focusrite scarlett 2i4 issues
Hi everyone !
I am a pd new user and I'm trying to do a 4 channel installation for an school art project
Im using a ´Focusrite scarlett 2i4 as an external device, but when I use dac~ 1 2 3 4 outputs 1 2 goes out from the scarlett and 3 4 from the pc i dont know what´´s happening . Does anybody know how to fix this ? Is there any way to configure the external device other than the main menu audio settings ?
thanks
Linux, Jack, and xruns
This query is probably too specific to be relevant to very many people...
But I've been trying to get the best audio performance out of my computer. I am running Debian (Linux), using Jack, and an external soundcard (Focusrite Scarlett 18i20). By using this nifty program called "xruncounter" I was able to determine that my setup prefers a frames-per-period size as a multiple of the sample rate (48k, so 92 or 144), instead of the usual powers-of-two. However, PD absolutely hates that! Basic sine waves are very distorted (sounding like a sample rate mismatch). SuperCollider is much the same.
I don't know if there's a part of PD that I can adjust to compensate for this. I thought maybe making the Buffer Size also 48 or 92 might fix that issue... but, as we all know, PD only allows Buffer Sizes selected from the drop-down menu, all powers of 2.
Any thoughts? I'm just curious, in general, if anyone has anything to say. It's interesting that PD and SuperCollider don't work right with these settings, but other audio software seems to (though I haven't done extensive testing).
And, if you're using Jack and Linux and are curious about this, here's where I started:
https://linuxmusicians.com/viewtopic.php?f=27&t=19268
https://linuxmusicians.com/viewtopic.php?f=27&t=17033
and my thread:
https://linuxmusicians.com/viewtopic.php?f=27&t=19907
PD block size vs audio interface buffer size
Generally, the "blocksize" in the audio setting really is the hardware buffer size and not Pd's global blocksize (which is always 64 samples).
Modern ASIO drivers are multiclient which means that the device can be used by more than one app at the same time. When you set the buffer size in your device app (e.g. Focusrite MixControl) this will set the internal blocksize and consequently the minimum latency possible for all clients. Usually you would want to set the internal buffer size as low as possible (without getting audio glitches).
Individiual clients (e.g. a Pd instance) can request a buffer size from the device. This can't be smaller than the above mentioned internal buffer size, but it can be larger (if you need extra latency). Most DAWs control the latency via the buffer size while Pd has it's own buffering mechanism ("delay").
Note that for Pd the hardware buffer size affects the overall timing resolution (when DSP is on). Pd will calculate several blocks of 64 samples as fast as possible until it has enough samples to send to the device. If the hardware buffer size is 256, Pd will calculate 4 blocks in a row (4 * 64 = 256) and then wait until the device asks for another 256 samples. This causes jitter! (Try [bang~] with [realtime] and [print] to see it yourself). The lower the hardware buffer size, the less jitter you get, so generally it's better to keep "blocksize" as low as possible and rather increase "delay" if you need more latency.
BTW, in case of old single client ASIO drivers, "blocksize" would directly set the hardware buffer size of the device. This is still the case e.g. with ASIO4ALL.
Everything you love will one day be taken from you (prototype)
I like it. Conceptually it reminds me of "I am sitting in a room" or Cory Arcangel's "Iron Maiden's “The Number of the Beast” compressed over and over as an mp3 666 times".
Raspberry Pi Audio Interfaces....
Behringer has a very cheap interface that has two RCA audio inputs, without pre-amp. It should cost around 30 euros. Pisound is one of the latest sounds cards for the Pi with a stereo jack input and output. This costs around 80 euros though.
I've been using Focusrite Scarlett sound cards with embedded computers like the Pi or the Odroid (or even my laptop) and Linux in general and they work really great. Of course they're not meant to be embedded, but if you're up for hacking them and tearing them off their housing, they could be an option. I'm using a Focusrite Scarlett 2i4 in my 3dPd modular synth, which runs on an Odroid-U3, posted here https://forum.pdpatchrepo.info/topic/10845/3dpd-a-physical-modular-synthesizer-programmed-in-pd-and-arduino
Learning data structures
my starting point was that i wanted a multislider in pure data. i was already thinking about learning another programming language like processing or open frameworks to have better interface possibilities. https://github.com/Ant1r/ofxPof or https://forum.pdpatchrepo.info/topic/6666/make-protodrom-pd-and-processing-with-libpd-controlp5-and-oscp5 for example. instead i started to discover data structures for now. i think they are limited but still it is possible to expand the pd gui a little bit and to make some useful objects. and i like the idea from miller puckette to use data structures for visual scores, but i havent seen a lot of them. i would be happy if he expands the data structure possibilities and makes them more handy
Best Audio Interface for a mac?
I second the notion that the Focusrite Scarlett line is a good way to go. I have the 18i8, since my setup needs a lot of inputs, but even that one was relatively affordable. Their newer Thunderbolt interfaces look even more enticing (although I'm biased, since I'm a drummer & always seeking lower latency).
As for Macs: until recently I was running PD on a 2010 iMac and a 2008 Macbook. The former was solid (until the graphics card gave out), the latter still to this day can run my most demanding patch at 70-80% CPU.
When the iMac died, I decided to upgrade to the new 2016 Macbook Pro (I was right in the middle of several Logic/FCP projects, and didn't want to jump ship to Linux at that precise moment). The new MBP is certainly slick & plenty fast enough for PD, but in terms of bang for your buck, you can get comparable processing speeds for far less money with an older Mac, or (as alexandros points out) a different brand of computer that can run Linux.
So, my advice would be to not do what I did....
Best Audio Interface for a mac?
Pd runs on all three OSes, so a mac is only a prerequisite if you want to work with a mac. I switched from mac to linux about a year ago and don't feel the need to go back. On the contrary, I'm fully satisfied with my new OS.
If you don't want to spend too much money on a new laptop, I would suggest to buy a cheaper one that is very likely to have similar specs with a Macbook Pro, only it probably won't be in a metal housing. Focusrite Scarlett sound card series seem to work flawlessly without any effort on Linux. I've used a Scarlett 2i4 with an Odroid-U3 and a Scarlett 6i6 2nd gen with my Debian Jessie XFCE on my Lenovo laptop, both without breaking a sweat (with Jack).
These are my two cents.
6 channel sound
As @whale-av said, the sound card you're thinking of buying doesn't provide 6 outs. I have a Focusrite Scarlett 6i6 and it does give six outputs (though 5th and 6th are digital outputs and I haven't used them yet). Its price is quite higher than the Behringer one, but the quality is much better too.
(1) Many sound cards come with a configuration software that you can use to set it up. You'll might need this to set all six outputs (with the Focusrite one it's not necessary, Pd will probably work out of the box).
(2) No special cable is required, that's what USB is for, to transfer data between devices.
(3) Audio interfaces usually appear with their names, so it's pretty hard to confuse them, and once set in a software, there's no reason why the software should confuse them either.
Help?! Implementing Pd into a hardware device
A decent ADC for the Pi is indeed something pretty hard to find. I've been using a Focusrite Scarlett 2i4 which I've ripped off its case and put it in my project's housing, and it works fine. This requires some hardware hacking though as you'll might need to remove some parts from the sound card's circuit board (like potentiometers) in order to bring them to the desired position in your setup.