I want to create an external object to control a quad DAC board with a Raspberry Pi, namely this https://learn.adafruit.com/adafruit-mcp4728-i2c-quad-dac one. As the object should run at signal rate, I'm confused as to how I should control the rate of values sent to the DAC.
Since all signal objects in Pd work on DSP ticks, processing as many samples as the block size as fast as possible, how should I go about sending values to the DAC on a one-sample based clock? Is resampling the way to go? If so, how can this be done? I'm checking the source files, specifically d_dac.c and m_pd.h, but can't make much out of it. My C skills are very limited, hence all the questions above...
Hi Alexandros, I made an external [pii2c] which should be available via deken along with the source code. You could use that to talk to the dacs, but not at signal rate. What you want is already done by any 4-channel USB audio interface for much less hassle, and better resolution with [dac~ 1 2 3 4]. The 4-DAC board could be used to provide control voltages for an analog synth or something like that at control rate (once per 64-sample block).
Martin
On Sat, Aug 15, 2020 at 2:25 AM Alexandros adrcki@gmail.com wrote:
I want to create an external object to control a quad DAC board with a Raspberry Pi, namely this one. As the object should run at signal rate, I'm confused as to how I should control the rate of values sent to the DAC.
Since all signal objects in Pd work on DSP ticks, processing as many samples as the block size as fast as possible, how should I go about sending values to the DAC on a one-sample based clock? Is resampling the way to go? If so, how can this be done? I'm checking the source files, specifically d_dac.c and m_pd.h, but can't make much out of it. My C skills are very limited, hence all the questions above...
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Actually you're right, signal rate could be an overkill for something like that. I'll go with control rate. Does your object use wiringPi? If so, I'd go for creating a new object as wiringPi is now deprecated as stated here http://wiringpi.com/news/ since the developer got bullied about support and all. I'll try the pigpio software. Still, I'll give your object a try and peek into the code, thanks!
Anyway, thanks for the hints!
Alexandros
On 15/8/20 10:02 μ.μ., Martin Peach wrote:
Hi Alexandros, I made an external [pii2c] which should be available via deken along with the source code. You could use that to talk to the dacs, but not at signal rate. What you want is already done by any 4-channel USB audio interface for much less hassle, and better resolution with [dac~ 1 2 3 4]. The 4-DAC board could be used to provide control voltages for an analog synth or something like that at control rate (once per 64-sample block).
Martin
On Sat, Aug 15, 2020 at 2:25 AM Alexandros adrcki@gmail.com wrote:
I want to create an external object to control a quad DAC board with a Raspberry Pi, namely this one. As the object should run at signal rate, I'm confused as to how I should control the rate of values sent to the DAC.
Since all signal objects in Pd work on DSP ticks, processing as many samples as the block size as fast as possible, how should I go about sending values to the DAC on a one-sample based clock? Is resampling the way to go? If so, how can this be done? I'm checking the source files, specifically d_dac.c and m_pd.h, but can't make much out of it. My C skills are very limited, hence all the questions above...
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Ok, I scanned through your code and your object doesn't depend on wiringPi, and it's actually a really nice object. By no means would I be able to write something as close to this!
I have one question though, in the help patch you write the following comment: "Only one I2C device is available on the Pi.". How come? Don't I2C devices all connect to one bus and listen only when they are addressed? Currently I don't have more than one I2C devices to check, but only one.
Thanks, Alexandros
On 16/8/20 10:31 π.μ., Alexandros wrote:
Actually you're right, signal rate could be an overkill for something like that. I'll go with control rate. Does your object use wiringPi? If so, I'd go for creating a new object as wiringPi is now deprecated as stated here http://wiringpi.com/news/ since the developer got bullied about support and all. I'll try the pigpio software. Still, I'll give your object a try and peek into the code, thanks!
Anyway, thanks for the hints!
Alexandros
On 15/8/20 10:02 μ.μ., Martin Peach wrote:
Hi Alexandros, I made an external [pii2c] which should be available via deken along with the source code. You could use that to talk to the dacs, but not at signal rate. What you want is already done by any 4-channel USB audio interface for much less hassle, and better resolution with [dac~ 1 2 3 4]. The 4-DAC board could be used to provide control voltages for an analog synth or something like that at control rate (once per 64-sample block).
Martin
On Sat, Aug 15, 2020 at 2:25 AM Alexandros adrcki@gmail.com wrote:
I want to create an external object to control a quad DAC board with a Raspberry Pi, namely this one. As the object should run at signal rate, I'm confused as to how I should control the rate of values sent to the DAC.
Since all signal objects in Pd work on DSP ticks, processing as many samples as the block size as fast as possible, how should I go about sending values to the DAC on a one-sample based clock? Is resampling the way to go? If so, how can this be done? I'm checking the source files, specifically d_dac.c and m_pd.h, but can't make much out of it. My C skills are very limited, hence all the questions above...
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
On Sun, Aug 16, 2020 at 5:29 AM Alexandros adrcki@gmail.com wrote:
Ok, I scanned through your code and your object doesn't depend on wiringPi, and it's actually a really nice object. By no means would I be able to write something as close to this!
Thanks Alexandros!
I have one question though, in the help patch you write the following comment: "Only one I2C device is available on the Pi.". How come? Don't I2C devices all connect to one bus and listen only when they are addressed? Currently I don't have more than one I2C devices to check, but only one.
Sorry, I meant to say that on the Pi header there is only one accessible I2C bus. You can have up to 127 devices on it.
Martin
Thanks, Alexandros
On 16/8/20 10:31 π.μ., Alexandros wrote:
Actually you're right, signal rate could be an overkill for something like that. I'll go with control rate. Does your object use wiringPi? If so, I'd go for creating a new object as wiringPi is now deprecated as stated here http://wiringpi.com/news/ since the developer got bullied about support and all. I'll try the pigpio software. Still, I'll give your object a try and peek into the code, thanks!
Anyway, thanks for the hints!
Alexandros
On 15/8/20 10:02 μ.μ., Martin Peach wrote:
Hi Alexandros, I made an external [pii2c] which should be available via deken along with the source code. You could use that to talk to the dacs, but not at signal rate. What you want is already done by any 4-channel USB audio interface for much less hassle, and better resolution with [dac~ 1 2 3 4]. The 4-DAC board could be used to provide control voltages for an analog synth or something like that at control rate (once per 64-sample block).
Martin
On Sat, Aug 15, 2020 at 2:25 AM Alexandros adrcki@gmail.com wrote:
I want to create an external object to control a quad DAC board with a Raspberry Pi, namely this one. As the object should run at signal rate, I'm confused as to how I should control the rate of values sent to the DAC.
Since all signal objects in Pd work on DSP ticks, processing as many samples as the block size as fast as possible, how should I go about sending values to the DAC on a one-sample based clock? Is resampling the way to go? If so, how can this be done? I'm checking the source files, specifically d_dac.c and m_pd.h, but can't make much out of it. My C skills are very limited, hence all the questions above...
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list