Post by thetechnobear on Aug 8, 2018 16:57:22 GMT
About a month a go I created my first module for AEM, the BelaMini module
so I thought, Id write a post about, what it is? how i did it? why? and what I got wrong
anyway , quick/poor video showing its alive...
(Im going to be doing some better demos soon, for AEM in general and also this module )
What is it?
This module is an AEM module that interfaces the AEM to a BelaMini to provide a 'sound computer'
BelaMini?
BelaMini is a microcomputer a bit like a Raspberry Pi, but importantly its is much smaller, and also has much lower latency!
What can it do?
just like your computer, its flexible, it can become a full synth, an FX, a sequencer ... or just a lowly digital oscillator
there are two applications that are often used by musicians to create these 'patches',
the first is Pure Data, which is a graphical patching tool (like Max/MSP if your familiar with that) , great for creating Synths and FX.
the second is SuperCollider, this is particularly fun for generative musical coding, or also 'Live coding' (something Im quite interested in)
(there are others including CSound, Chuck etc etc, but these seem to the the most popular)
Background
so when AEM was announced on kickstarter , Id been getting into Axoloti and Bela, which both are hardware boards that can be patched, a bit like a Nord g2 modular, and reading the AEM specs it became quickly apparent (*) that Bela and AEM fitted like hand in glove... as they both used 5v (Axoloti too, but thats another story/project )
my idea was simple, use AEM for analogue sounds and hardware patching, but use Bela as a powerful digital platform relatively easy, as it has audio IO, and 8 analog in/out (for cv), and lots of digital!
as a software developer by profession, this was great for me... a way I could extend AEM in ways I wanted, and Id already ported all the Mutable Instruments digital modules to both Axoloti and Bela... so I even had something to add to AEM from Day #1.
(*) I pestered Robert with many questions, about DIY during the campaign... and he helped reassure me this was a project that could work, and has provide great support along the way!
AEM arrives
so when AEM got delivered, I immediately started playing with integrating AEM with 5v things, and circuits (hence my youtube videos)
then I hit a physical problem, AEM was so much smaller and lighter than i had imagined, in particular, its only about 24mm deep, and the modules are also not that tall...
this meant squeezing in the Axoloti or (full size) Bela into the case was going to be physically impossible.
(Bela is actually a Beaglebone Black with an additional cape, which makes it quite tall, taller than AEM !)
So, I started making plans to put it in an external box, and then link by a ribbon cable, but that has its only problems - and basically stalled the project.
then a lucky strike...this year Bela announced the Bela Mini , this was much smaller , same abilities, apart from no analog out (which meant no CV out, something I could live without) , and so game on...
in early June it arrived... so time to get building
The Build
ok, Im no electronics wizard... I can do a bit of soldering, and know how to do a few things with ICs and similar... and Id been playing with Axoloti in this area a bit. (which means Id already got quite a few components, and tools)
(complete aside: I found Caspers Electronics OMSynth a great way to experiment safely)
my simple first stage was:
- provide power to the belamini from AEM ribbon
- provide 8 CV inputs
- provide 2 audio outputs.
Ok, I have to say, Bela was also a great choice for this as the guys at Bela are fantastically supportive on their forum, and they know both the hardware and the software side, so can field just about any question, which made me feel very confident!
(you can see my conversation with Guilo on the Bela Forum , there are some interesting extra details there too)
Power was easy, BelaMini can be powered directly thru the GPIO power , +5v (top row of AEM ribbon) into VIN, GND (2nd row of AEM ribbon) into any GND pin - you can see this as the RED and GREY wires going to one board
CV input so BelaMini has 8 analog and digital audio output (i.e. 0..5v) this is the other board with lots of wires.
CV input, theoretically you can just take inputs directly from AEM to bela mini
however, AEM is 0..5v, BelaMini is 0..4v, this is ok, has belamini is 5v tolerant (on analogue not on the digital IO, with is 3.3v!!!)
so to avoid a dead zone 4 to 5v, I used a simple voltage divider (as close as I could get with the resistors I had available)
Audio output, this is rather similar, the Bela Mini digital range on the audio output is slightly different , AEM is 0..5V , 2.5V centred, whereas 0.4-2.3, centred 1.34v - again this 'works' if you listen to it, but its got a DC offset, so to fix this I needed an op-amp (rail to rail), I used a MCP6002, this has 2 channels which is what i needed, and then it was a simple case of amplifying the signal , so again using the closes value resistors I had (no need to be perfect here )
so in the pictures you can see i used 3 boards...
2 that just mount on top of the BelaMini connecting to the relevant gpio pins, and then the 3rd which contains the 'circuitry'
I decided to use the 2U of width as that was basically the size of the Bela Midi, and still room above it for the circuit and pin headers for AEM.
it seemed like a good idea, but I soon found that when using protoboards (without strips) this soon become very cramped , there really was barely enough room for the voltage dividers and the op-amp.
so once planned, all that was needing was a bit of soldering (which is when I realised how cramped it was, when putting in the resistors for the op-amp!)
once done, then I realised space was tight for the wires to past down from my AEM board down to the bela mini, since whilst the BelaMini was high enough to go under the AEM faceplate, once i had soldered the pins on the protoboards, it was about 1mm too high (which was ok, I can live with!), but meant the wires had to be pretty tidy.
Testing
ok, so I didnt want to blow up the AEM, nor the BelaMini, so before Id did anything I decided to test the board.
first i check that i hadn't shorted anything during soldering with a simple multi-meter (actually, I do this as i go along, but do a final test before plugging it into anything )
fortunately, Id previously bought an Analog Discovery 2, this is fantastic...
its an oscilloscope, signal generator and voltage supply that runs off your computer - best bit of kit ive bought, Ive found it very educational as well as useful.
basically with this, I could supply the 5v 'dummying' AEM ribbon, then feed signals into the cv and audio outputs, and scope the results, to check I got the intended values.
and indeed, Id accidentally used the wrong value on one of my resistors (in the wrong place in my components box ) , so quick fix, test again.
all looked good,
so time to plug it in, turn on AEM and cross my fingers.....
Yipped, it didnt go bang ... and actually worked
What did I learn? What could be improved?
first and foremost, I was too ambitious going for 2U , really it would have been much better being
Where next with BelaMini?
I need to resolve a noise issue before anything else, see below, then there are a few things Id like to do.
I want to add some digital inputs (trigs), and possibly some outputs , or LEDs
I need to sort out access to USB,
currently I unscrew the faceplate and can lift the module out (this is easier than unscrewing from the back) to gain access to the microUSB port required to program it, also the usb host port is inaccessible 'in place'.
so Id like to panel mount these... or perhaps adapt the case (as I suspect the AEM case is not deep enough to do this... but I will see)
These things all require more space, so I have to decide either to make an extension to the current setup - kind of like a new module, or instead take it apart, and build it all on a bigger board (4U?)
Ive not really decided which yet.
Noise Issue
Initially all seemed good... but after more thorough testing, I noticed there was a quiet high pitch noise, coming from all AEM modules on the same AEM ribbon (=row).
so this is something I need to resolved, since Im not willing to reduce the quality of AEM modules for this module
after some experimentation, Ive determined this is coming from powering the PocketBeagle (ARM) from the AEM ribbon, the issue is it creates noise on the 5v power line, which then ripples through all modules on the same ribbon.
this has pretty much been confirmed in a few ways:
a) I used the analog discovery 2 to generate signals thru my circuit and there was no noise
b) If I power the module via USB rather than AEMs power, no noise
c) if I just power the BelaMini, without my circuit, from AEM , the noise is also present.
Ive contacted robertlanger and also the Bela guys, so I hope between us we can resolve this... as I think its likely to be a problem when using any microprocessor/controller.
current hopes are a small inductor+capacitor might be a quick fix this, just need to work on the details
Conclusion
So thats its, its been a fun process and Ive learnt a lot along the way.
I think AEM is great for DIY projects, since its low voltage, and fairly simple, and Bela is a great companion to add some DSP power, that you can program yourself via C++/Supercollider or Pure Data.
After Ive resolved the noise issue, I'll definitely be doing more, to help build my knowledge up some more...
In fact Ive already built most of the Axoloti module... which I think will be an external module (due to space) , but more on that another time
anyway, I hope this was interesting,
if you have any questions, please post them Id be happy to answer (as well as I can )
also Id love to hear of other projects, or ideas you have...
Cheers
Mark aka TheTechnobear.
so I thought, Id write a post about, what it is? how i did it? why? and what I got wrong
anyway , quick/poor video showing its alive...
http://www.instagram.com/p/BkkV18Tg768
(Im going to be doing some better demos soon, for AEM in general and also this module )
What is it?
This module is an AEM module that interfaces the AEM to a BelaMini to provide a 'sound computer'
BelaMini?
BelaMini is a microcomputer a bit like a Raspberry Pi, but importantly its is much smaller, and also has much lower latency!
What can it do?
just like your computer, its flexible, it can become a full synth, an FX, a sequencer ... or just a lowly digital oscillator
there are two applications that are often used by musicians to create these 'patches',
the first is Pure Data, which is a graphical patching tool (like Max/MSP if your familiar with that) , great for creating Synths and FX.
the second is SuperCollider, this is particularly fun for generative musical coding, or also 'Live coding' (something Im quite interested in)
(there are others including CSound, Chuck etc etc, but these seem to the the most popular)
Background
so when AEM was announced on kickstarter , Id been getting into Axoloti and Bela, which both are hardware boards that can be patched, a bit like a Nord g2 modular, and reading the AEM specs it became quickly apparent (*) that Bela and AEM fitted like hand in glove... as they both used 5v (Axoloti too, but thats another story/project )
my idea was simple, use AEM for analogue sounds and hardware patching, but use Bela as a powerful digital platform relatively easy, as it has audio IO, and 8 analog in/out (for cv), and lots of digital!
as a software developer by profession, this was great for me... a way I could extend AEM in ways I wanted, and Id already ported all the Mutable Instruments digital modules to both Axoloti and Bela... so I even had something to add to AEM from Day #1.
(*) I pestered Robert with many questions, about DIY during the campaign... and he helped reassure me this was a project that could work, and has provide great support along the way!
AEM arrives
so when AEM got delivered, I immediately started playing with integrating AEM with 5v things, and circuits (hence my youtube videos)
then I hit a physical problem, AEM was so much smaller and lighter than i had imagined, in particular, its only about 24mm deep, and the modules are also not that tall...
this meant squeezing in the Axoloti or (full size) Bela into the case was going to be physically impossible.
(Bela is actually a Beaglebone Black with an additional cape, which makes it quite tall, taller than AEM !)
So, I started making plans to put it in an external box, and then link by a ribbon cable, but that has its only problems - and basically stalled the project.
then a lucky strike...this year Bela announced the Bela Mini , this was much smaller , same abilities, apart from no analog out (which meant no CV out, something I could live without) , and so game on...
in early June it arrived... so time to get building
The Build
ok, Im no electronics wizard... I can do a bit of soldering, and know how to do a few things with ICs and similar... and Id been playing with Axoloti in this area a bit. (which means Id already got quite a few components, and tools)
(complete aside: I found Caspers Electronics OMSynth a great way to experiment safely)
my simple first stage was:
- provide power to the belamini from AEM ribbon
- provide 8 CV inputs
- provide 2 audio outputs.
Ok, I have to say, Bela was also a great choice for this as the guys at Bela are fantastically supportive on their forum, and they know both the hardware and the software side, so can field just about any question, which made me feel very confident!
(you can see my conversation with Guilo on the Bela Forum , there are some interesting extra details there too)
Power was easy, BelaMini can be powered directly thru the GPIO power , +5v (top row of AEM ribbon) into VIN, GND (2nd row of AEM ribbon) into any GND pin - you can see this as the RED and GREY wires going to one board
CV input so BelaMini has 8 analog and digital audio output (i.e. 0..5v) this is the other board with lots of wires.
CV input, theoretically you can just take inputs directly from AEM to bela mini
however, AEM is 0..5v, BelaMini is 0..4v, this is ok, has belamini is 5v tolerant (on analogue not on the digital IO, with is 3.3v!!!)
so to avoid a dead zone 4 to 5v, I used a simple voltage divider (as close as I could get with the resistors I had available)
Audio output, this is rather similar, the Bela Mini digital range on the audio output is slightly different , AEM is 0..5V , 2.5V centred, whereas 0.4-2.3, centred 1.34v - again this 'works' if you listen to it, but its got a DC offset, so to fix this I needed an op-amp (rail to rail), I used a MCP6002, this has 2 channels which is what i needed, and then it was a simple case of amplifying the signal , so again using the closes value resistors I had (no need to be perfect here )
so in the pictures you can see i used 3 boards...
2 that just mount on top of the BelaMini connecting to the relevant gpio pins, and then the 3rd which contains the 'circuitry'
I decided to use the 2U of width as that was basically the size of the Bela Midi, and still room above it for the circuit and pin headers for AEM.
it seemed like a good idea, but I soon found that when using protoboards (without strips) this soon become very cramped , there really was barely enough room for the voltage dividers and the op-amp.
so once planned, all that was needing was a bit of soldering (which is when I realised how cramped it was, when putting in the resistors for the op-amp!)
once done, then I realised space was tight for the wires to past down from my AEM board down to the bela mini, since whilst the BelaMini was high enough to go under the AEM faceplate, once i had soldered the pins on the protoboards, it was about 1mm too high (which was ok, I can live with!), but meant the wires had to be pretty tidy.
Testing
ok, so I didnt want to blow up the AEM, nor the BelaMini, so before Id did anything I decided to test the board.
first i check that i hadn't shorted anything during soldering with a simple multi-meter (actually, I do this as i go along, but do a final test before plugging it into anything )
fortunately, Id previously bought an Analog Discovery 2, this is fantastic...
its an oscilloscope, signal generator and voltage supply that runs off your computer - best bit of kit ive bought, Ive found it very educational as well as useful.
basically with this, I could supply the 5v 'dummying' AEM ribbon, then feed signals into the cv and audio outputs, and scope the results, to check I got the intended values.
and indeed, Id accidentally used the wrong value on one of my resistors (in the wrong place in my components box ) , so quick fix, test again.
all looked good,
so time to plug it in, turn on AEM and cross my fingers.....
Yipped, it didnt go bang ... and actually worked
What did I learn? What could be improved?
first and foremost, I was too ambitious going for 2U , really it would have been much better being
Where next with BelaMini?
I need to resolve a noise issue before anything else, see below, then there are a few things Id like to do.
I want to add some digital inputs (trigs), and possibly some outputs , or LEDs
I need to sort out access to USB,
currently I unscrew the faceplate and can lift the module out (this is easier than unscrewing from the back) to gain access to the microUSB port required to program it, also the usb host port is inaccessible 'in place'.
so Id like to panel mount these... or perhaps adapt the case (as I suspect the AEM case is not deep enough to do this... but I will see)
These things all require more space, so I have to decide either to make an extension to the current setup - kind of like a new module, or instead take it apart, and build it all on a bigger board (4U?)
Ive not really decided which yet.
Noise Issue
Initially all seemed good... but after more thorough testing, I noticed there was a quiet high pitch noise, coming from all AEM modules on the same AEM ribbon (=row).
so this is something I need to resolved, since Im not willing to reduce the quality of AEM modules for this module
after some experimentation, Ive determined this is coming from powering the PocketBeagle (ARM) from the AEM ribbon, the issue is it creates noise on the 5v power line, which then ripples through all modules on the same ribbon.
this has pretty much been confirmed in a few ways:
a) I used the analog discovery 2 to generate signals thru my circuit and there was no noise
b) If I power the module via USB rather than AEMs power, no noise
c) if I just power the BelaMini, without my circuit, from AEM , the noise is also present.
Ive contacted robertlanger and also the Bela guys, so I hope between us we can resolve this... as I think its likely to be a problem when using any microprocessor/controller.
current hopes are a small inductor+capacitor might be a quick fix this, just need to work on the details
Conclusion
So thats its, its been a fun process and Ive learnt a lot along the way.
I think AEM is great for DIY projects, since its low voltage, and fairly simple, and Bela is a great companion to add some DSP power, that you can program yourself via C++/Supercollider or Pure Data.
After Ive resolved the noise issue, I'll definitely be doing more, to help build my knowledge up some more...
In fact Ive already built most of the Axoloti module... which I think will be an external module (due to space) , but more on that another time
anyway, I hope this was interesting,
if you have any questions, please post them Id be happy to answer (as well as I can )
also Id love to hear of other projects, or ideas you have...
Cheers
Mark aka TheTechnobear.