digital modular synth - hardware questions

From circuitbending to homebrew stompboxes & synths, keep the DIY spirit alive!

Moderators: lisa, luketeaford, Kent, Joe.

User avatar
felix le chat
Veteran Wiggler
Posts: 683
Joined: Tue Aug 10, 2010 5:38 am

Re: digital modular synth - hardware questions

Post by felix le chat » Tue Jun 30, 2020 6:24 pm

tele_player wrote:
Tue Jun 30, 2020 4:43 pm
Don’t rule out Teensy 4.1. Daisy is still mostly promises.
Teensy 4.1 is fast, has a working audio library, is easily connected to midi and DA converters, and is available now.
I have not ruled it out, but I still did not find enough documentation to decide. Maybe I should watch the 5 hours of video here:
https://www.pjrc.com/store/audio_tutorial_kit.html
https://www.pjrc.com/teensy/td_libs_Audio.html

For example I have no idea how the callback mechanism works (if any), no idea whether it requires to know what Arduino is and learn it (I really have no idea besides the fact it is related to embedded computing), no idea about the audio latency/jitter/etc, no idea about the non-audio analog I/O sampling rate and which clock they use (the same goes for Daisy btw), etc.
Is there a code example that would show something simple like playing a sine wave or modifying a parameter using a MIDI control change? Or a full documentation with an introduction that explains things from a general point of view?

Also, it looks like the Bela system has more processing power (Cortex A8, 512MB of SDRAM) than the Daisy or Teensy systems (M7), which explains the price difference. For sure, processing power is not everything, and for a given task that both can do, maybe the M7 is faster than the A8. That said, both the Daisy and Bela systems have about 1 ms of overall latency, so having more processing cannot be worse (I have no ultra-small size and power consumption constraints)
I’d check on the Teensy forum to see if anybody has gotten Pd patches, compiled with heavy, onto Teensy.
Actually I will not want to use Pd, Max, Faust, Csound, the Teensy Audio System Design Tool, or generally speaking any kind of graphical programming or artist-oriented environment.
I only need a C or C++ hardware API (namely audio, MIDI, digital I/O pins and analog I/Os) and will write almost everything else myself

tele_player
Common Wiggler
Posts: 191
Joined: Fri Feb 15, 2019 10:50 am
Location: Sacramento

Re: digital modular synth - hardware questions

Post by tele_player » Tue Jun 30, 2020 6:45 pm

You won’t get enough info from questions on a forum to decide which system is best for your project and your skills. You should invest some money and time trying some possibilities.

My top choices would be Bela and Teensy, or for a great gadget for experimentation, Axoloti. If Daisy becomes generally available, and grows a good user base, and gets some software, it will be another option. This will take time.

User avatar
emmaker
Veteran Wiggler
Posts: 623
Joined: Sat Mar 10, 2012 5:07 pm
Location: PDX

Re: digital modular synth - hardware questions

Post by emmaker » Tue Jun 30, 2020 6:54 pm

Well my posts were targeted towards felix le chat who seems to know the way around computers and software. Just not DSP and real time stuff. I figure if people need more info they can look it up or ask. But let's move on.

Personally I'd use either a Teensy 4.1 or the Daisy and maybe use more than one.

I've written code for the Teensy 3.2 using the Arduino environment for several projects and am currently porting a LED system from the 3.2 to 3.6. I hate the Arduino environment but it works. When I want to look at memory maps or assembly code it's a real pain and some of the libraries are crap. But stuff works. The Teensy 4.1 looks fun and at some point I'll play with that. Teensys are mature and have a lot of people using them and an audio sub-group on their forum.

https://forum.pjrc.com/

The Daisy is new and just getting going so there isn't the maturity and as much support. I've downloaded its initial library and demo SW and built it using cygwin under Windows. So that makes me happy not having to use the Arduino environment. But the hardware looks interesting because it has an audio interface and extended RAM.

https://forum.electro-smith.com/

I think that either would work well as an audio engine. But if you want to combine audio and cv stuff then you might have issues with the types and number of IO pins.

An example for the Daisy is if I want an UART for a debug port, SPI port, I2C port and use a 4 bit SD card interface.
  • NOTE: Don't know if the USART1/USB is usable since the USB port might be the same one on the connector.
  • There is only one SPI port which isn't shared with any thing other than the SPDIF.
  • 4 bit SD card interface takes out 2 UARTs and 1 I2C.
  • With what's left using an UART for debug takes out an I2C port so you only have a single I2C port left.
Hopefully that makes some sense. Basically you have limited number of hardware ports/resources so figure out what you need before hand and make sure what ever you chose has what you need.

Happy coding.
Jay S.

User avatar
EATyourGUITAR
has no life
Posts: 4827
Joined: Tue Aug 31, 2010 12:24 am
Location: Providence, RI, USA

Re: digital modular synth - hardware questions

Post by EATyourGUITAR » Wed Jul 01, 2020 7:13 am

Run the SPI at 10MHz. Put as many things as you want on that SPI. You need one cable select (slave select) pin per slave. You can move the SD card over to the SPI bus. All SD memory cards have an optional mode of operation that is based on SPI. This was introduced by the SD association long time ago. It lives on.
WWW.EATYOURGUITAR.COM <---- MY DIY STUFF

User avatar
felix le chat
Veteran Wiggler
Posts: 683
Joined: Tue Aug 10, 2010 5:38 am

Re: digital modular synth - hardware questions

Post by felix le chat » Wed Jul 01, 2020 8:23 am

tele_player wrote:
Tue Jun 30, 2020 6:45 pm
My top choices would be Bela and Teensy, or for a great gadget for experimentation, Axoloti. If Daisy becomes generally available, and grows a good user base, and gets some software, it will be another option. This will take time.
emmaker wrote:
Tue Jun 30, 2020 6:54 pm
Personally I'd use either a Teensy 4.1 or the Daisy and maybe use more than one.
Just curious, why these choices (in a few words)? I mean, these are really different devices (microcontroller vs single-board-computer, etc).

User avatar
felix le chat
Veteran Wiggler
Posts: 683
Joined: Tue Aug 10, 2010 5:38 am

Re: digital modular synth - hardware questions

Post by felix le chat » Wed Jul 01, 2020 8:26 am

emmaker wrote:
Tue Jun 30, 2020 6:54 pm
I think that either would work well as an audio engine. But if you want to combine audio and cv stuff then you might have issues with the types and number of IO pins.

An example for the Daisy is if I want an UART for a debug port, SPI port, I2C port and use a 4 bit SD card interface.
  • NOTE: Don't know if the USART1/USB is usable since the USB port might be the same one on the connector.
  • There is only one SPI port which isn't shared with any thing other than the SPDIF.
  • 4 bit SD card interface takes out 2 UARTs and 1 I2C.
  • With what's left using an UART for debug takes out an I2C port so you only have a single I2C port left.
Hopefully that makes some sense. Basically you have limited number of hardware ports/resources so figure out what you need before hand and make sure what ever you chose has what you need.
Yes, makes a lot of sense, thanks

At least at the beginning, I will not need so many I/O anyway (later maybe, if I really make that polyphonic MIDI-to-CV box)

User avatar
htor
Common Wiggler
Posts: 159
Joined: Sun Dec 01, 2019 6:20 am
Location: Leipzig, Germany

Re: digital modular synth - hardware questions

Post by htor » Wed Jul 01, 2020 8:38 am

felix le chat wrote:
Tue Jun 30, 2020 6:24 pm
[,,,]
I only need a C or C++ hardware API (namely audio, MIDI, digital I/O pins and analog I/Os) and will write almost everything else myself
why haven't you checked out arduino yet?

User avatar
EATyourGUITAR
has no life
Posts: 4827
Joined: Tue Aug 31, 2010 12:24 am
Location: Providence, RI, USA

Re: digital modular synth - hardware questions

Post by EATyourGUITAR » Wed Jul 01, 2020 8:59 am

The Daisy is not a beaglebone or a pi. The Daisy is bare metal as I understand it. The Daisy does not run Linux. The Daisy is closer to a teensy. The difference is that the teensy is already a proven platform with a lot of working code available for audio. Everyone is obviously scared of promises with daisy. How can we buy a daisy now as a beginner when the promise is more software libraries and tutorials tomorrow. Everything is coming soon. The community is mostly wait and see. There are always some early adopters. Rebel tech has a DSP platform but I'm not sure if that will have a lot of volunteer programmers.
WWW.EATYOURGUITAR.COM <---- MY DIY STUFF

recursinging
1-Post Wiggler
Posts: 1
Joined: Wed Jun 17, 2020 1:42 am

Re: digital modular synth - hardware questions

Post by recursinging » Wed Jul 01, 2020 9:23 am

felix le chat wrote:
Tue Jun 30, 2020 6:24 pm
Actually I will not want to use Pd, Max, Faust, Csound, the Teensy Audio System Design Tool, or generally speaking any kind of graphical programming or artist-oriented environment.
I only need a C or C++ hardware API (namely audio, MIDI, digital I/O pins and analog I/Os) and will write almost everything else myself
I second the Teensy. The GUI design tool is nothing more than a (very) basic code generator to simplify patching components of the Audio library together. The Audio library already has all of the components necessary for a digital synth, and the Audio library object interface is easy to understand, making implementing/integrating your own DSP code dead simple. The Teensy 4.x has a (double precision) FPU so you can write intuitive DSP code without worrying too much about optimization (The existing library components are highly optimized and sometimes hard to understand).

Bela... nah, I don't want to wait for my stuff to boot.

I just got a Daisy. It's a promising platform, but the Teensy is light years ahead in terms of maturity. That being said, a fresh start avoids old baggage. Your mileage may vary.

User avatar
felix le chat
Veteran Wiggler
Posts: 683
Joined: Tue Aug 10, 2010 5:38 am

Re: digital modular synth - hardware questions

Post by felix le chat » Wed Jul 01, 2020 9:44 am

htor wrote:
Wed Jul 01, 2020 8:38 am
felix le chat wrote:
Tue Jun 30, 2020 6:24 pm
[,,,]
I only need a C or C++ hardware API (namely audio, MIDI, digital I/O pins and analog I/Os) and will write almost everything else myself
why haven't you checked out arduino yet?
I started to look at Arduino yesterday at least to know what it is and what it can do, so I still don't know much about it

Can an Arduino system run the synth I described in my second post (ie some patches would be polyphonic, with some parts of the voices oversampled to 16x or with some feedback loops using very small software buffers) with 1 ms input-to-output latency?

The second poster in the link below says: "The AVR microcontrollers used in Arduinos are not suited for audio processing.
They were simply not designed with audio in mind: they lack memory, processing power, ADC resolution and speed, and a DAC."
https://forum.arduino.cc/index.php?topic=599297.0

But if there is an adapted Arduino solution, yes, I am interested in checking it

User avatar
forestcaver
Veteran Wiggler
Posts: 645
Joined: Tue Mar 14, 2017 4:41 pm
Location: UK
Contact:

Re: digital modular synth - hardware questions

Post by forestcaver » Wed Jul 01, 2020 9:52 am

My view (fwiw) - I’ve been going around/gone down this path over the last 6 months to a year.
For me, I coded stuff in matlab/c/c++ etc then decided what I wanted it to do, decided how computationally intensive it was, then looked for a platform. I ended up on stm32 and am playing with stuff on the dev boards. (The advantage for me is that I did some very low level stm32 stuff many years ago and it’s vaguely familiar, but also there are some great designs to copy ideas from - eg the MI stuff). I wanted it to be cheap to build, it’s for personal fun and I dont like IDEs (I like command line make stuff). So stm32 seemed like a good fit. (Teensy is expensive and not elegant on a eurorack module. Raspberry pi uses a lot of energy so a eurorack module, for me, is not a great idea without a separate psu).
For more money but easier start I’d go with the axoloti - been watching it for ages and almost bought one many times.... there’s a large keen community and it is a pretty sorted platform....
Anyway - just my point of view....

User avatar
felix le chat
Veteran Wiggler
Posts: 683
Joined: Tue Aug 10, 2010 5:38 am

Re: digital modular synth - hardware questions

Post by felix le chat » Wed Jul 01, 2020 10:00 am

EATyourGUITAR wrote:
Wed Jul 01, 2020 8:59 am
The Daisy is not a beaglebone or a pi. The Daisy is bare metal as I understand it. The Daisy does not run Linux. The Daisy is closer to a teensy.
Yes, I understand it, but if you compare the Daisy / Teensy on one hand, and the Bela system on the other hand:
- both approaches are adapted to realtime audio with about 1 ms of latency
- both include open source libraries that take care of the parts I did not want to code myself
- the first approach uses a microcontroller (so yes, no Linux operating system running), the second one uses a customized single-board computer (Beaglebone running Linux with the Xenomai extension that allows to run audio with higher priority than the Linux kernel)
- the CPU is completely different, and as far as I understand the RAM is different too

Given this, why would I choose one approach more than the other for this particular project, based on functionality and performance considerations? (not taking in account the price, size, number of I/Os, and power consumption)

User avatar
EATyourGUITAR
has no life
Posts: 4827
Joined: Tue Aug 31, 2010 12:24 am
Location: Providence, RI, USA

Re: digital modular synth - hardware questions

Post by EATyourGUITAR » Wed Jul 01, 2020 10:31 am

That is completely up to you to decide. For me, it comes down to both price and power requirements. If I have an Arm M4 for $6 or $8, 50mA, I can put that in every module in my rack. If I have something like a pi, I would use 450mA per pi. Two Pi's would be the limit. 4 Pi's is when you go back to using a x86 machine with pure data. There is also juice which is all C++. Csound is another. Chuck is another programming language for audio on x86. The Daisy is in that sweet spot I would estimate 150mA. You can have a few of them in the rack. You could even develop that into a product with a socket for a daisy. You could do the same with teensy bit that would be an arm M4. 1ms is a long time for me. I like the M4. The H7 would be as far as I can go without bringing in linux. As I said earlier, bare metal pi is really not an option. If you don't plan to release anything as a product then there really is no need to reduce your CPU speed moving to an SBC. But there is no rule what you can do for fun. Do whatever you enjoy. Whatever you think will be interesting and fun to try. You will learn a lot regardless what language you use or what hardware you use. Maybe you will be a maintainer contributing to daisy if your code is good enough.
WWW.EATYOURGUITAR.COM <---- MY DIY STUFF

User avatar
felix le chat
Veteran Wiggler
Posts: 683
Joined: Tue Aug 10, 2010 5:38 am

Re: digital modular synth - hardware questions

Post by felix le chat » Wed Jul 01, 2020 2:20 pm

recursinging wrote:
Wed Jul 01, 2020 9:23 am
Bela... nah, I don't want to wait for my stuff to boot.
This is really something I did not think about. For my use it does not matter too much, but thanks for pointing it because it is a simple and practical reason for choosing a microcontroller solution
I just got a Daisy. It's a promising platform, but the Teensy is light years ahead in terms of maturity. That being said, a fresh start avoids old baggage. Your mileage may vary.
I understand about the maturity, but provided the hardware APIs work correctly it is ok for me. This project is rather simple, also I would not use the Teensy or Daisy signal processing libraries too much, only for the rare cases it would be reinventing the wheel.
But people who make more complex projects or use the dsp libraries a lot may be more careful about this


forestcaver wrote:
Wed Jul 01, 2020 9:52 am
My view (fwiw) - I’ve been going around/gone down this path over the last 6 months to a year.
For me, I coded stuff in matlab/c/c++ etc then decided what I wanted it to do, decided how computationally intensive it was, then looked for a platform. I ended up on stm32 and am playing with stuff on the dev boards. (The advantage for me is that I did some very low level stm32 stuff many years ago and it’s vaguely familiar, but also there are some great designs to copy ideas from - eg the MI stuff). I wanted it to be cheap to build, it’s for personal fun and I dont like IDEs (I like command line make stuff). So stm32 seemed like a good fit. (Teensy is expensive and not elegant on a eurorack module. Raspberry pi uses a lot of energy so a eurorack module, for me, is not a great idea without a separate psu).
This looks like a great strategy. I don't like large/complicated IDEs either, especially for simple projects. Did you use dev boards with converters, I/O, memory, etc and code libraries to use all this, or did you build it from more open dev boards and additional hardware boards?


EATyourGUITAR wrote:
Wed Jul 01, 2020 10:31 am
That is completely up to you to decide. For me, it comes down to both price and power requirements. If I have an Arm M4 for $6 or $8, 50mA, I can put that in every module in my rack. If I have something like a pi, I would use 450mA per pi.
Actually I never mentioned it but my synth will be a standalone machine that I can bring to live concerts. I do have a compact modular synth but I never planned to use it outside.
1ms is a long time for me.
I meant 1 ms from analog audio input to analog audio output, therefore including the latency of the A/D and D/A audio converters. None of the ready-to-use solutions discussed here (Teensy, Daisy, Axoloti, Bela, etc) can do better than that, and most of their latency comes from the converters
I like the M4. The H7 would be as far as I can go without bringing in linux. As I said earlier, bare metal pi is really not an option. If you don't plan to release anything as a product then there really is no need to reduce your CPU speed moving to an SBC.
Almost no Linux/Windows/MacOS latptop or desktop, no matter which audio interface and converters, can have a round trip latency as low as 1 ms; moreover they are less compact.
That makes 2 good reasons for "reducing the CPU speed" but I agree it's just because the systems with 1 ms latency that I am aware about happen to have slower CPUs than "normal" computers

User avatar
forestcaver
Veteran Wiggler
Posts: 645
Joined: Tue Mar 14, 2017 4:41 pm
Location: UK
Contact:

Re: digital modular synth - hardware questions

Post by forestcaver » Wed Jul 01, 2020 3:20 pm

dev boards with added strip boards etc (with tssop to dip converter boards for multiplexors, dacs, etc). With the plan to then turn it into a fully independent board when I am happy. I’ve got quite a few dev biards and playing with a few different ideas! I mostly use the mi framework and code (to save rethinking drivers) but I’ve been thinking about using freertos and libopencm3 (just started exploring them for a new idea)

User avatar
EATyourGUITAR
has no life
Posts: 4827
Joined: Tue Aug 31, 2010 12:24 am
Location: Providence, RI, USA

Re: digital modular synth - hardware questions

Post by EATyourGUITAR » Wed Jul 01, 2020 5:28 pm

forestcaver wrote:
Wed Jul 01, 2020 3:20 pm
dev boards with added strip boards etc (with tssop to dip converter boards for multiplexors, dacs, etc). With the plan to then turn it into a fully independent board when I am happy. I’ve got quite a few dev biards and playing with a few different ideas! I mostly use the mi framework and code (to save rethinking drivers) but I’ve been thinking about using freertos and libopencm3 (just started exploring them for a new idea)
Try STM32F407 with CMSIS-DSP. No OS needed. SPI drivers are there in a library. I have a few M3 boards and one M4 board. Not all of them are ST. You can use any ADC any DAC.
WWW.EATYOURGUITAR.COM <---- MY DIY STUFF

User avatar
emmaker
Veteran Wiggler
Posts: 623
Joined: Sat Mar 10, 2012 5:07 pm
Location: PDX

Re: digital modular synth - hardware questions

Post by emmaker » Wed Jul 01, 2020 5:30 pm

felix le chat wrote:
Wed Jul 01, 2020 9:44 am
I started to look at Arduino yesterday at least to know what it is and what it can do, so I still don't know much about it

Can an Arduino system run the synth I described in my second post (ie some patches would be polyphonic, with some parts of the voices oversampled to 16x or with some feedback loops using very small software buffers) with 1 ms input-to-output latency?
One thing here is there are two components to Arduino. There is the SW IDE and then there is the hardware. You can program things like the Teensy and Daisy (and a number of other chips/boards) with the Arduino IDE. It's setup to support the boards/processors and have libraries available. Some of the libraries are really great and some are really bad. For the hardware Arduino started out with the AVR processors but some of the newer Arduino boards are using ARM chips. I would stay away from the Arduino hardware, they are typically lower end processors. Boards like Teensy 4.1, Daisy, Raspberry and Beaglebone are pretty high end processors.
felix le chat wrote:
Wed Jul 01, 2020 9:44 am
Just curious, why these choices (in a few words)? I mean, these are really different devices (microcontroller vs single-board-computer, etc).
A few words?

The reasons that I wouldn't use something like a Raspberry or Beaglebone are:
  • OS can add a lot of issues that can get in your way. You don't have control of things like interrupts and multi-tasking which can effect your timing.
  • Power requirements. These can take a fair amount of power to run.
  • I understand HW and SW and can do this. It would probably take me longer or just as long to figure out the OS and tweak it (below) than start from scratch with a Teensy/Daisy.
That being said. Something like a SBC running Linux could be used but I would get in there and tweak things. If you aren't using certain peripherals remove them from the OS and power them down if you can. You'll be removing interrupts and saving power. For example: WIFI/Blue Tooth/radios, networking, video controller, USB, ....
felix le chat wrote:
Wed Jul 01, 2020 9:44 am
I understand about the maturity, but provided the hardware APIs work correctly it is ok for me. This project is rather simple, also I would not use the Teensy or Daisy signal processing libraries too much, only for the rare cases it would be reinventing the wheel.
I do not know how embedded/integrated (if at all) the IO libraries and DSP libraries are. You may have to optimize and rebuild them.

Out in the real world engineering and products can be driven by a number of things and there usually isn't any perfect or optimal solution. Things like easy of development, time to market, cost of parts and labor, functionality and company politics. To some extent these are true for a home project but the bottom line is there is no perfect or optimal solution you just have to make some decisions and start from there.

Good sound making to everyone.
Jay S.

Post Reply

Return to “Music Tech DIY”