Embedded - 356: Deceive and Manipulate You
Episode Date: December 18, 2020Leonardo Laguna Ruiz of Vult spoke with us about modelling electronics, modular synthesizers, and modulating sound. We talked in detail about applied digital signal processing. Leonardo’s website is... www.vult-dsp.com. Check out the Freak Filter, the user manual alone is a course in signal processing. You can buy finished or DIY versions on vult-dsp.com/store. The physical hardware is a Eurorack module (wiki) but the Vult modules are also available for the VCV Rack, a Eurorack simulator that you can use to build your own modular synthesizer. Leonardo has a YouTube channel where he goes in depth on signal processing: youtube.com/c/LeonardoLagunaRuiz. He’s also written about modeling vintage analog sound on the Wolfram blog. For more information about the Vult programming language (or an example for how to build your own, check out the github repository: http://modlfo.github.io/vult/overview/ This episode was sponsored by Qt, a cross platform application framework for desktop, mobile and embedded devices. That means you get a full set of libraries for nearly everything you can think of, plus a world-class GUI that will give you a native look wherever your code runs. Try Qt for free at www.qt.io/download (qt.io/embeddedfm ! And check out Qt for MCUs!)
Transcript
Discussion (0)
Welcome to Embedded.
I am Alicia White, here with Christopher White.
I think this week we should spend a bit of time talking about filtering,
signal processing, music, and programming languages.
Our guest is Leonardo Lacuna-Ruiz.
Hi, Leonardo. Thanks for joining us.
Hello, all embedded listeners.
Could you tell us about yourself?
Yes.
Leonardo, I'm a PhD in electrical engineering,
and I kind of live a double life.
During the day, I work as a software engineer
in Wolfram Research. But during the night, I work as a software engineer in Wolfram Research.
But during the night, I work on my own projects, which is, I have a small company called Vult,
where I do mainly things related to sound synthesis.
What does Vult mean?
Vult. I got the idea
from some crazy dream where I
had
visions of vultures.
And when
I started developing
these things and I needed to set a name,
I said, ah, Vult sounds good
for vulture.
Okay.
It has been there for a while.
Well, I think we're going to do
lightning round now, and you're a listener,
so you know how this goes.
Yeah, and I'm nervous.
Alright, ready?
Ready.
Favorite chord?
F-sharp.
CV or MIDI?
CV, definitely.
What is CV?
Control voltage, yes.
Favorite instrument of all time?
I think it would be definitely the guitar.
Especially the Les Paul model.
I really like that model.
Favorite fictional robot?
This is a difficult question.
I would say that my favorite is Ava from the movie Ex Machina,
because it is like the only robot that,
the only cute robot that shows the real intentions,
which is to deceive and manipulate humankind.
Software or hardware?
I cannot pick one.
I think I will say both.
Complete one project or start a dozen?
I used to be the kind of person that started a dozen,
but in recent years I have moved to starting only half a docent and finishing one.
What is the worst 80s synth song?
I don't know.
I mean, I was born in the 80s, and I'm pretty sure that there are lots of songs that are really bad that I never heard.
So I only know the good ones.
Very good, very good.
Okay, let's get on to the longer questions, because some of these require a whiteboard, so we're going to have to talk around them.
You said that the vultures told you to make filters.
No, wait, that wasn't quite what you said, but something like that.
Yeah, something like that.
What do you actually do in your spare time or in your non-work time?
I like to do a lot of sound synthesis projects.
And the filter part, it came a little bit late. So before I was just trying to program small microcontrollers to do wave generations, etc.
But then one thing that I have seen while doing these projects is that the filters are almost never done digitally.
Because from what I read, they always say, do your sound generators digital, but do your filters analog.
And I was wondering why.
So why the filters are done
always analog
and then I fall into this rabbit hole of filters
and I started
making a lot of analog filters
and modeling filters
and that's how
I ended up in recent years
making mainly
filters, digital filters
Christopher's brother Matthew plays guitar and
has a large number of amps and
says things like, these tubes are the best
and I can only get them from Russia and they're marked radioactive
or something. That's funny, you're just making stuff up. I am totally making stuff up.
But he is very focused on the tube sound.
Yes, and he likes analog stuff.
Why do, I mean, does it really sound different?
Is this like having gold Ethernet cables?
Not quite, but let him answer.
I mean, probably, yeah, that is part of,
is related to the gold internet cables.
Because there is one thing that analog components have.
They are imperfect,
and they tend to sound more pleasant than the digital counterparts. So if I make a guitar amp that uses the lowest distortion,
the best operational amplifier or integrated circuit,
and I plug my guitar, it's going to sound really nice,
but it will not have that charm.
So it's a bit like
eating boiled potatoes and eating french fries the boiled potatoes are i mean they are good you can
they're practically the same thing but for some reason the the French fries taste much better. And in the specific case of the two amplifiers,
the fact that these amplifiers introduce a small imperfection to the sound makes the sound, specifically for the guitars, more interesting.
So amplifiers amplify things based on the name,
and filters filter things,
which seem kind of like the opposite things to do.
Why do we talk about them together?
So, I mean mean filters are they remove
frequencies so we can think
about them as amplifiers
for frequency right
yeah
and in the case of
synthesizers filters
are used in one specific
kind of synthesis which is called
subtractive synthesis
in which
you start with
waveforms
that have a high
that are rich
and have a high content
of harmonics
but then you can
put filters on them to remove some of
those harmonics
or to shape them just to get the kind of sound that you want.
For example, I'm thinking in a very basic synth sound.
Let's say that I want to make a sound of a piano.
It is basically, what I need is to model first the impact of the sound when i
press the key and the and the string is hit that's like the attack right yes the attack and for that
i i need more harmonics to to to have like this initial explosive sound. It's actually a high-frequency sound.
I mean, it's got all of the frequencies.
Yes.
And as the string resonates,
the higher-frequency harmonics are being consumed,
and then you get only the fundamental oscillation of your string,
and that is very close to a sine wave so if i would if i
would want to imitate that it will possible to use like first a hive as a an oscillator that produces
more harmonics then i use a an envelope to to just like open the filter during a small period of time
and then closing the filter gradually
in order to get that sound,
the release sound of the piano.
So one of the things about synthesizers is it's not just
you have a filter and you set it to, okay, here's this notch I'm going to remove, or here's this set of low frequencies I'm going to remove.
You actually manipulate the filter in real time as the sound evolves.
So like change the envelope over time, so that if you press the same note five times, it sounds different?
Even within the same note hit, it might open up or close.
Yeah, that's exactly one big difference between the kind of filters that we study, for example, in electrical engineering. When you design a filter or when you read a text on designing a filter,
you pick a frequency,
you select your components,
and you implement your filter.
But the musical filters need to be controllable.
And they also need to be controllable
in an exponential way.
That way it matches
the way the
notes change. For example
a C note in a piano
you have many C notes in a piano and the difference
between those is that each each note is has the double of the
it doubles the frequency right each octave it doubles the frequency and in in the case of the
musical filters you want to control them in us in the same way so you don't say right now i i have Right now, I'm in 100 Hz, and then I'm in 110.
The relation between the controlling voltage and the frequency is this exponential.
So it sounds nicely in a musical scale.
And you can go pretty far with that, too, to the point where you're only playing the filter.
Like on one of my synths, I can set the filter to get into a kind of self-resonance.
Yes.
And then control it with the keyboard.
And so it's the only thing that's actually, it's getting some noise from inside whatever's left of the synthesizer. And that's resonating in the filter.
But the filter's tuned with the keyboard so
you're actually basically just playing the filter so in a in an electronic and electrical engineering
term this is like terrible yes i mean this is this is the opposite of what you want
but because you're doing music and music is often not intuitively mathematical, graspable.
You go ahead and you use these effects.
And that's also why people like tubes, is because they're imperfect.
Yes. I was thinking, for example, the other day I needed to rate a temperature using an analog voltage,
and I wanted to convert it to use a simple amplifier
just to get a wider range, I mean, a larger signal value.
And the thing is that this sensor that sends,
I don't remember exactly, but let's say that it sends me 10 millivolts
per degree
per Celsius degree
I wanted to convert it to
2 volts
so I need to amplify it a lot
and so I make
an analog amplifier for it
the problem is that
this analog amplifier can only
output voltage that is
between the... with a margin
like less than the positive power supply
and higher than the negative power supply, right? So the two rails.
It cannot... if I feed the amplifier with 12 volts,
I cannot get 40 volts out of it not not for very
long no yeah probably not for not for sure and the thing is is that that filter will be like very
i mean that that amplifier will be very bad because i have very short range but if i plug
my guitar on it and I use exactly that amplifier,
I'm going to sound like Jimi Hendrix.
So from the engineering point of view,
it's a bad design.
But a musician definitely can do something interesting with it.
Why?
Why are our brains...
Is it that our brains are wired to like the imperfections,
or is it that we are culturally wired to prefer these things?
I don't know the answer.
Yeah, there is one thing that the distortion makes, and it's easy to measure.
When there is a little bit of distortion, we're introducing
high-frequency harmonics.
For example, if we have a
pure sine wave and we see the spectrum,
you will only see
one bar, right?
One point.
But when you add a little bit of
distortion into this
waveform, you will see that
in your frequency analyzer,
they appear like small frequencies, higher frequencies.
And the more you distort it, you get more of this,
and it just makes it sound more appealing. So if you're going to make a model of an analog synth
or an analog circuit as part of a synthesizer,
you're actually going to do this in digital,
how do you, do you just play one of the original
and capture it spectrum, an an envelope and then recreate it?
Is this how you go about
modeling it? Or is there a different way?
No, a little
bit different because
if I... Okay, I'm going to
tell you a little bit about the process.
So, what I
usually do is
I take one of the
existing filters.
There are lots of schematics online that you can find.
And let's say that I pick one of those.
And then I start analyzing what's the basic architecture of the filter.
So if we take one, let's say a salen key filter
which is also quite common
salen key
ok that's
it's a high pass low pass filter
yes
and many
of these musical filters
have
a variation of this one
but in order
to change
the cutoff
frequency
in this
architecture
in the
salen key
you need to
change the
resistors
and many
of the
synthesizers
since you
don't want to
put variable
resistors there
you want to
control them
with voltage
there are
different ways
of doing that for example example, with diodes
and changing the biasing of the diodes,
you can put transistors, FETs, etc.
in order to simulate
to have this variable resistor.
So what I started doing is
using this program that I write,
this simulator that I write in Wolfram,
I started making a component model of this circuit.
So, I mean, you can think about it as just making a SPICE simulation
where you put all the components, right?
Okay.
The main problem with the SPICE simulator is that the models
maybe are too complex.
If I put like an operational amplifier model,
it will contain minimum 12 transistors.
I'm simulating like these 12 transistors.
But with the simulator that I use,
I can replace that complex model by a simpler one.
For example, in the case of the operational amplifier,
the simplest model will be just measuring the voltage between the inputs and adding a gain. And then I can consider other
effects. And this is where it starts getting interesting. So let's say that I make my model,
I use resistors, capacitors, and an operational amplifier. If I make this model of the operational amplifier linear,
I will get a linear filter.
And the linear filters sound okay.
But if I want to simulate the analog feeling of this,
what I need to do is to make a model of the operational amplifier
that behaves just like my real amplifier,
which will be, it has clipping.
It is exactly what I mentioned before.
The amplifier cannot output more voltage than its rails.
Then I have to add like this limiter.
And once I put this nonlinear operational amplifier,
my filter is going to be nonlinear.
And from this circuit, just by following the basic electric analysis methodology, like getting all the currents of the nodes, that I can start simplifying more and more until I get the smallest representation
that will be a set of nonlinear differential equations.
And this will be the smallest representation of my model.
And these are the equations that I need to simulate in order to imitate this specific filter.
So it's really a component-level model that you start with,
not a behavioral.
Well, it depends. It's a mix.
It's a mix of it, yes.
But I usually start with the component level
because at the component level is the one that allows me
to analyze which things are the ones that I have to model. So let's
say that my filter has
four operational amplifiers. Maybe not
all the four need to be nonlinear.
And in order to determine that, I usually just do
a comparison with the real circuit,
which I either made it in a PCB or have it in a breadboard.
And then I input a signal and I check, okay, so if I put my filter into this configuration, what's happening?
Okay, this operational amplifier is saturating.
This one, it always works in the linear region.
Then I can replace it for a smaller,
for a simpler model.
And yeah, that's part of the analysis.
Trying to figure out what are the things that matter
and what doesn't matter
in order to get a simpler model.
Are there any popular filters that have just not fallen to this technique that are just
too complicated?
I'm not sure.
I think that at least I have been able of simulating reasonably well most of them.
But the problems that I have had is that since I want to model this filter
and then simulate it in a microcontroller,
I don't have enough CPU to do that.
And then I have to drop details of my models in order to be able to simulate it.
So my model will not sound exactly the same, but it will sound pretty close.
And it will be much more efficient.
To give you a specific example, I was modeling a filter found in a Russian russian synthesizer called the the poly box and they use
this special operational amplifiers that in which you can send a voltage and that controls
the bandwidth of the of the amplifier and in order to model that,
so first I had to get the operational amplifiers,
then making the model.
And the model that I got, it was too complicated.
I mean, the differential equations were very hard to solve.
And then I had to simplify a bit my model
in order to get something that sounds close,
but it doesn't sound exactly as original.
Have you trained yourself to hear the differences,
and does that affect your enjoyment of music?
Yeah.
The worst thing about working with something like this
is that you cannot listen to music while working because I need to be listening to a continuous waves sound for a long time, for a long period.
And also the ears get tired.
So I also use a lot of frequency spectrum just to find out to help me
visualize what I'm hearing.
Yeah, that's
bad. And also
my wife gets very upset
because I'm playing a sound
two hours.
We're sponsored this week by qt or cute i'm super excited to have cute as a sponsor as i've been a fan for years i built entire medical devices using cute as well as tons of small utilities for things
like firmware update and microcontroller config cute is a cross-platform application framework
based on c++ that means you get a full set of libraries for nearly everything you can think of,
plus a world-class GUI that will give you a native look wherever your code runs.
You can target 16 different desktop, mobile, embedded operating systems.
Write your code once and run it nearly everywhere with minimal modifications,
in one SDK, in one language you probably already know.
It's awesome to take something that started on Windows,
move it to Linux, Mac OS, even iOS in a matter of days, and have everything scale and appear
native for the new target. Qt's fast design and development workflow is trusted by over
1 million users worldwide in over 70 industries, including automotive, medical, automation,
and aerospace. Version 6 has just been released and has a bunch of cool new features, including C++ 17 and Python support.
It has a new graphics architecture that supports the latest GPU APIs.
Developing adaptive, scalable user interfaces in Qt has gotten even easier.
They're also announcing a brand new product that I'm super excited about, Qt for MCUs.
I wish I had this two or three years ago.
It is a tiny footprint version of the full-fledged framework.
You've got the same rapid development tools in GUI Designer
now for a smartphone-quality user interface on your embedded project.
Since the tools are the same, you can prototype and test your UI
without hardware right on your desktop.
Qt for MCU targets our test-based systems
or bare metal on a variety of MCU families.
I'm thrilled about this and can't wait to try it.
If you'd like to try Qt or Qt for MCU yourself,
go to qt.io slash embedded FM
and sign up for a free trial.
It includes all the frameworks and development tools
along with a bunch of cool demos of desktop,
mobile, and MCU applications.
Qt made my development life so much easier dozens of times,
and I think it can do the same for you.
Thanks again to Qt for sponsoring this week's show.
I wanted to ask, just briefly before we move on,
about the, you said you get it down to a minimal set of nonlinear differential equations,
and those are not easy.
There's various techniques for solving nonlinear differential equations. And those are not easy. There's various techniques for solving nonlinear differential equations,
but they aren't as approachable as linear differential equations.
What methods do you use to solve them, and how do you fit that into a micro?
Yes, so I use, depending on the filter, I have, I mean, one of the advantages that I think I have is that in my real work, I develop a simulator.
And over the years, I have accumulated a lot of knowledge on how to simulate differential equations.
And in order to fit them in the microcontroller I use a lot of things, for example, one of the
part of my analysis, once I have the differential equations, is to find
a method that is suitable for this set
because if I want to simulate an RC filter
made with one resistor and one capacitor, probably
the Euler differential equation,
the Euler method for solving differential equations will be enough.
So I don't need to have to do more.
And if not, for other filters,
what I do is try all methods that I know,
from Hewn method, from Kekuta
trapezoidal integration and then I try to find
which one fits better into this
to solve the equations
and to have more or less accurate results
and then there comes another problem
which is performing the computations
and since I have non-linear elements and I have to do iterations Then there comes another problem, which is performing the computations.
And since I have nonlinear elements and I have to do iterations,
I have a bag of trickery to write the code.
For example, using a lot of lookup tables in my code to try to speed up the computations.
If I have like a
long formula
that I need to evaluate and
it's only one variable
it works making a lookup table
for it
so yeah from all the equations I try
to do that and also
I try to use
mathematical simplification as much
as possible in order to reduce the number of multiplications,
which are usually the ones that tend to be more expensive.
It sounds like it's mostly time domain, though.
When I was doing this stuff years ago,
one of the techniques was to do a Fourier transform of the nonlinear DE
and then do like Rangakata in frequency space
and then move back or something like that.
But this sounds like all time domain.
Yeah, I usually do the time domain
because once I have this set,
I mean, if I apply this technique
and I make it efficient enough,
it will work fine without doing back and forth Fourier analysis.
That's cool.
Well, one of the problems with doing the Fourier analysis
is you need a window to act upon.
And as soon as you have a window to act upon,
now you're delaying your signal.
Yes.
And that has all kinds of problems associated with music.
Yes, so
one of the big problems in the filters
is that you usually have feedback
paths
in the circuit.
So if I
split
let's think about
one of the popular filters
the Moog Ladder filter which is basically four low-pass stages let's think about one of the popular filters, the MOOC ladder filter,
which is basically four low-pass stages,
and then you have feedback.
If you model this one as four separate low-pass stages,
and then you take the output sample
and you feed it back to the input,
you get a filter that sounds different because you have a delay in the output and and in order to avoid that
i i need to analyze the system including the feedbacks and that's usually why i need to solve
the differential equations because i i need to iterate I need to have the iterative method in order to solve this feedback path.
You've implemented a pretty long list of filters, but I don't know what they sound like.
Are there ones that I would recognize based on certain songs, or are there ones that are special beyond those we've talked about?
I don't know if you, I mean, not you, but a person that is not into the synthesizers will recognize them.
I can't even tell. I've got several, and I kind of know what these things do. I couldn't tell you which filter was which in a song.
Okay, then tell me about this one.
Debridatus, a wave destructor with bit crusher, wave fold and distortion?
Yes.
Yeah, that's not a filter, definitely.
What is it?
That's another.
So in this module for your hack that I make, I included a lot of filters.
So most of my filter models are implemented into this module.
And it's possible to switch between them just by the press of a button.
And since I have a module that can
do that and I have a processor so I decided
to put some of my other
virtual modules
into this one
into this real module and that is
basically a distortion
because you can always
take your audio signal
spice it up a bit with
a bit crushing saturation distortion,
and then put a filter after it to get it back to nice levels.
A bit crusher is that's where you take the bit depth of a digital signal and chop it off, right?
So if you have a 16-bit digital signal, you truncate it to 8,
and it sounds grungy and gross, and then you fix it up with a filter.
You mentioned Eurorack and modular synthesizers.
Could you explain what that is for people who aren't surrounded by a lot of synthesizers?
I have no Eurorack in this house.
Is that what you want for Christmas?
Sorry, go ahead.
Okay, so basically
the common synthesizers that people may have seen, they consist
of a bunch of buttons in a keyboard
form factor. Yes, yes, I see that. And those are the
fixed synthesizers, let's call them that.
So integrated synthesizers
in which the architecture of your
sound, I mean, of your synthesizer
is a little bit fixed.
It follows a traditional path
in which you have sound sources filters and then
you have modifiers and you can do a lot a lot with those synthesizers but there is this other
kind of synthesizers which which are the modular and one of the most common form factors is this
one the euro rack and the main difference is that instead of when you buy
when you want to build a synthesizer instead of buying one that has everything you buy individual
modules so you can say i want an oscillator and i like this one from this manufacturer
because it makes this and that so you you buy that one, and you have an oscillator.
And your panel, the panel of your module has jacks, audio jacks,
and then you can just take that audio signal
and insert it into any other module that you want.
So you can say, I want a filter,
and you buy like a one, two, or like me,
you end up having 32 filters, 32 analog filters.
So you pick one of those, and then you can send your signals.
So the main difference is that you have full freedom
to construct your synthesis machine
and to rewire it with physical cables.
Like, if you were to play this live,
would you be rewiring it live?
Or is it you wire it
and then that's how it sounds
for however long this song takes?
It depends on the artist.
I have seen a lot of videos
of people that actually play live
with modular synthesizers
and they usually have it a little bit fixed
because when you have
a synthesizer that is that big
with so many cables, it may be hard to rewire
live, but you can always do a little bit of patching
so probably changing a few of the
jacks that you remember.
I have a small
Eurohack synthesizer and
I have probably 60 patch cables
and when I'm designing some sound
sometimes I use them all
and I'm not doing anything complicated
like a live performance
so I cannot imagine a live musician
patching 60 cables in a single session
most of the time they're probably twiddling the knobs
and things that affect individual modules and not rerouting things.
Yes.
And there are even modules that help you do that.
If you don't want to change cables live, you can add a module with switches.
Then you can just toggle switches to change your routes usually what happens to me
even when I'm using a non-modular synthesizer
is I'll start
playing with it and then not make any music
because I'll be so busy
changing routing and
getting so into that part of it
like oh I'm designing this sound, oh what if I connect this to
oh what if I turn this knob
three hours have gone by and I haven't actually
I mean it's fun yes I's i agree that that's what i usually do i i never
so i i just get lost in into the sound design
so bad that i haven't made any song in four years or something three or four years or something, three or four years. Just sounds.
But you have been making this unit that can go into the Euro rack
that then can model, simulate, mimic a whole bunch of other different modules
that would normally go in the Euro rack.
Yes.
Yes.
So that's, I mean we before we have been talking a
lot about the filters and i do all this i mean i do all these models because i want to put them
into this module which has another microcontroller and the idea behind that it was to have this digital module that, just like the robots that I mentioned before,
it tries to deceive you and manipulate you
to think that it is an analog filter,
but it is not.
It's digital,
but has the advantages that you don't have
to use a lot of space with a lot of filters,
and maybe if you're just picky like me, you want a specific sound,
and then you can easily just change which filter you want
for this specific sound.
Well, then you don't need to change the patch cables.
You can just change which filter you want.
Yeah, I mean, you can change the filter,
but you can still change a lot of things
in your
sound
generator.
There's a completely
simulated Eurorack
called VCVrack?
Is that right? Yes.
So VCVrack is
this open source
Eurorack simulator,
which was developed by a person called Andrew Veldt.
And since it is open-source, it is very easy to create your own modules.
And it simulates the Eurorack because it follows the same form factor.
You have also traditional Eurorack because it follows the same form factor. You have also traditional Eurorack panels.
And then you can do all the patching with wires.
And it tries to simulate all except the bad things.
For example, you cannot connect outputs to outputs.
Or it doesn't let you input to inputs.
And yeah, it is really nice.
So I actually started developing all this for VCVHack.
Since I've been developing modules for a long time,
when I found that VCVHack was going to be launched. I did...
My first module was this virtual filter for VCVRAC.
And I got excited and I kept doing more and more and more.
And what I did was, once I had all these models,
up to that point, I started thinking,
maybe I should make a Neurorack model with this.
And then I ported back everything to hardware.
And what I'm doing now is backporting again.
So I want to do like a clone of my own Neurorack module,
but for PCBB rack.
So that will simulate all the parts, like even the LCD screens and stuff like that.
So yeah, it is very approachable, VCB rack, because Eurohack is expensive.
I think it's funny that you started modeling hardware with software. in this sense because I have software that simulates analog
and hardware that simulates digital.
Shifting gears a little bit,
you have also made a language to help you with the signal processing pieces.
Could you tell me about that?
Yes, I have the Vult language, which is
a very simple language that I developed
to gain kind of portability
because
some years ago
when I was
doing all these synthesizers
using different microcontrollers,
I would make
some piece of code, for example
for a DSP.
And when I have had something done, then a new development board comes out and I want
it and then I develop something for it.
And I started getting problems like moving my code. So I decided to make this layer on top of C++
that will be a much simpler language,
less things to worry about,
and that I could later create different generators
to target the different platforms that I wanted to do.
So, for example, I will make with this full language
an oscillator, and
then I could, if I wanted to run it on a
web browser, I can generate JavaScript and then use the
Web Audio API to test the sound, or
even develop it directly in the web browser.
Once I'm satisfied with it, I can generate the C++ code that I want to run,
for example, on a TNC board or probably in an Arduino if it's possible,
without making changes.
So I wanted to concentrate all my development into this language
and being able to move it,
but also adding features that I always use.
For example, creation of lookup tables.
And in other projects where I have done with lookup tables,
I use like any external software to do the calculations
and then write a file and then doing it into C++.
But with the Vult language, I can just write a formula
and say, like, this formula is going to be a lookup table of this size.
I'm going to use interpolation, et cetera.
And when compiling the code it does all the calculations and I get
the optimized code. And I also have
features or more restrictions in the language.
For example, when converting integers
and floating point values.
One error that I hit a lot before,
it was in C++,
when you write a number one,
it can be an integer,
it can be a double,
it can be a floating point,
I mean, double precision or single precision.
And if you write the incorrect one,
the C compiler will assume which one it is right.
So it can be that you wanted to use single precision,
but since you didn't write the F after the number,
it thinks it's double precision, and then your compiled code
could be making double precision calculations
and then convert it back to single precision.
And I found that that was actually consuming time.
So in the language, I also put very strict restrictions
on conversion of types.
Everything needs to be explicit.
And yeah, a lot of small things like that
I cover with the Bool compiler.
And that's what I use for my development.
Are other people using the language or is it just for you?
I mean, I'm developing just for me.
And there are a few persons that use it and a lot more trying to use it.
But since I don't have very good documentation on it, maybe that's a key
factor.
But at least the persons that I know that use it, they like it a lot.
And do you, would I have to already have solved all of my equations and this is just putting
in the forward methodology or will it also help me figure out the equations,
the differential equation solutions?
No, for the differential equations,
the full language is just for the final implementation.
Okay.
And for doing all the differential equations,
as I mentioned before, I work in World Frame Research,
and I work in the group that develops Wolfram System Model, which is a tool for modeling systems.
And that's the software I use where I do all my work with the electrical components.
And it's a graphical interface, right?
So I can recreate my whole circuit with that tool.
And then I use Mathematica to extract the equations.
And in Mathematica is where I do all the manipulation
and all the testing and prototyping at the equation level
because it has a lot of tools for doing that.
That's mostly symbolic manipulation at that point,
or is it already numeric?
No, no, it's completely symbolic.
Okay.
Because I want to get, I mean,
I want to really use the symbolic capabilities
to eliminate as much as possible of the calculations.
You say you don't have good documentation,
but I'm looking at the EZDSP with Volt page,
and it walks through the whole thing.
It starts with a filter
and shows how to write a function
that matches that filter,
and then...
So, yeah, I mean,
obviously it's not going to do the hard part for you
of doing the math,
but this starts with that a little bit
and goes through it.
Yes, yes.
Yeah, I mean,
I don't have documentation
for all the cool features
for the new features that I have implemented.
Does it integrate
with the VCV
modular synthesizer?
VCV rack?
It
integrates through a plugin.
In VCV rack, there is a plugin
that is called the VCV Prototype.
And that module allows you to write in a single file code and then test it.
And I use that one a lot as well for my development.
So I actually contributed that part of the plugin,
being able of running Vult code in real time.
So when I'm developing, I open this module,
and then I have my text file with my code,
and I type it, and when you save, you hit save,
it immediately starts running in VCV rack.
And it is really, really useful that you can just test,
prototype and test the code.
Really cool. Look, I don't need any
more hobbies, Leonardo.
This is very awesome
stuff. I will send you some links later.
If someone
hypothetically wanted
to get started with this,
with creating the models
and maybe not having a PhD in this sort of thing.
Is there a way to get started?
Yes.
I think that, I mean, the best,
it totally depends on what you want to achieve.
Because you can do modules that are nice,
that sound nice, that are useful,
and that do not require all the kind of detail
that I put behind.
I just do it because I know how to do it.
And definitely the best way to start
is for example with VCVRAC
and I actually
have some tutorials
I recorded like
a three hour tutorial
on YouTube, on my YouTube channel
where I show the whole process
that I follow
and even
so I show the modeling part
and also the implementation.
That will be one of
the resources that you can use.
But definitely
a person does not need to go into
the modeling in order to do something
interesting. And that sounds
nice. If you want to
go into the modeling, probably
it will work revisiting all the theory behind
electric circuits and simulation methods, etc.
I have a listener question from Emily.
As someone who's always interested in modular synths, but put off by
the price, do you have any advice for how to get started on a budget? Is this going to
be VCV rack?
Yes, I think that the best way of doing that will be using a hybrid set setup.
So you can install VCV rack for free, and then you can get a module that converts, that helps you bridge the modular side
and also the real Eurohack and the virtual Eurohack.
And there are different modules.
For example, the Expert Sleepers modules,
which they are basically a sound card with many channels.
And that helps you combine
virtual modules with
your real modules.
So if you have like
on the
virtual side you can have
a thousand modules, then you have your bridge
and a few Eurohack modules
just for the
sound
design or also, I mean,
the real UroHack has the advantage
that you can
touch the controls.
And that helps you
a lot when performing and
when doing,
when experimenting.
So the
models that you think that are good
for UroHack, to have on the UroHack side, so the models that you think that are good for Eurohack
to have on the Eurohack site
you can
pick those and use them there
so definitely
just going back because a hybrid setup
of something virtual and
analog
sorry, something virtual
something real
in the bridge, it will be a good start point.
Are the VCV rack modules expensive?
No, no, no. The software is open source.
There are like almost 2,000 free modules.
I have myself, I have probably 20-something modules free.
And there are a few that are paid modules.
And those tend to be cheap,
probably less than $20.
So if I wanted to try modular synths for really cheap, I could do
all virtual and then slowly build up into physical world as well.
Yes.
And that will help you a lot to decide what you want in the real world.
I have one more question that I think is just going to be the end of the show.
And that is, I hear you're coming out with something to do with drums.
I didn't tell Christopher that ahead of time oh yeah so the last months i've been modeling drums analog drums and they just go bap bap bap right why are you like this
something like that boom and this this drum modules are kind of fascinating that
how how the the original designer of the circuits
develop them so if if one thinks how how can i make some like a cymbal sound? Oh, yeah, I just need a noise source, envelopes, etc.
Or a clap sound.
That was super interesting for me.
Because how one would make a clap sound?
And while I was analyzing those modules,
I found out a lot of interesting things
that if you don't model something,
if you don't model the behavior or the transition curve of this transistor,
you don't get a good sound.
So, yes, I'm developing drum models,
and probably in the future I will make another hardware module containing those.
Wait a minute, go back.
If you don't model the what part of the drum sound?
The transition, I mean the non-linearity of the transistor.
Oh, okay.
Yeah, because drum sounds are weird.
It's super impulsive.
Synth sounds, you can get your head around it.
Okay, I've got a sine wave or a triangle wave and then I do this and that.
But drums are a very
complex mix of noise and
transients and
also
pure tones and resonances.
Like for a bass drum, bass drum is a very
low pure tone combined
with the slap and all that stuff.
I've always been kind of fascinated by the analog
drum synthesizers because it's like, okay, they always been kind of fascinated by the analog drum synthesizers
because it's like, okay, they have to kind of purpose build a bunch of circuits.
It's not just one synthesizer that you can kind of make anything with.
It's like, oh, I have to have something over here to work to make a snare,
but it doesn't really work for the kick drum,
so I have to have some extra stuff for that.
Is that right?
They kind of have to be a little bit purpose built?
Yes. For example, the case that i mentioned before with the clap you have you have a like some noise source and then you have envelopes to to do the triggers but in order
to uh when i was trying to model it there is a part in which you see a VCA
it's basically a multiplication
and if you do a basic multiplication of the voltages
you don't get the sound
so it needs to be like this specific
transistor based
VCA
that way you get the correct transient
when modulating the amplitude.
And only if you use this VCA,
you will get something that sounds like the original.
Wouldn't it be simpler to model the original sound?
I mean, model the hand clap instead of model the transistor electronics that models the hand clap?
How do you model a hand clap?
I mean, you can always record the hand, like people clapping and use a sample.
That's the simplest model, probably.
I mean, there are physical model physical
modeling synthesis like where you just either piano models I have one that's
quite good and it's totally fake and they've gone through and figured out how
pianos work and model it that way but I know that's more of a simple thing with
you have a hammer and then the pure tone from the. I don't know how you'd metal something as weird as just an impact with skin.
That's interesting.
So one,
one,
one interesting thing about the,
the,
like the drums is that the,
when in the,
for example,
the 808,
the Roland 808 drum machine,
the designers were trying to,
to do something that sounded like drums.
It ended up not sounding like a real drum kit.
But the fact that that sound was different and unique,
it made it super influential in the 80s music.
That's probably like the most famous.
When people think of analog drums, that's the synthesizer I think people gravitate to thinking about.
Yes.
I'm still boggled by you going through electronics because it seems like the physical model would be simpler.
And the electronics people had to have done the physical model at some point.
Well, but correct me if I'm wrong, you're following on from the analog drum sense of the past, so you're trying to recreate
that sound. You're not out there to make realistic
drum sounds in an analog synthesizer.
What I'm actually interested in is learning how these
drums work. In my
learning process, I end up recreating them
and then I can just publish them for other people to use.
Yeah, if you want to make realistic drum sounds, you sample them.
Yes. I have a question from
Tom. Are the virtual synths
really a good try-before-you-buy sort of representation, or are there important differences between hardware and software implementations?
Okay, so actually in this question I didn't understand very well if it's like in general or for my specific…
I think in general or for my specific? I think in general. Yeah, in general.
I mean, I'm hoping that for your specific, you'll say, oh, no, they're rock solid right on.
But in general, are there things people should look for that indicate the differences are likely,
or is this just a matter of reading the reviews?
I actually don't know how to answer this one
because as we were talking before,
almost it's like everything works.
As long as you like the sound, everything works.
Yeah, that's the thing about synths is
you can get into a battle about virtual versus real
and it's like, if it sounds good, who cares?
Yeah, I think that the main difference will be just the interface the fact that you can touch it is
is what makes it different that's a pretty big deal and i mean if if we reroute the question to my own stuff in my
personal case
the
stuff that I have for free
for free
it wasn't intended
as try before you buy but what
ended up happening is that
a lot of the people
that tries my stuff
they tell me yeah I really like the filters.
That's what I decided to get the hardware.
Cool.
And we've talked a lot about all of this,
and you've mentioned your job,
and you've mentioned using the simulators that are part of your job to fuel your side gig, fuel Volt.
How do you lead this double life?
How do you have time to lead this double life?
It's complicated so in Vult I usually work just one hour
two hours
during the night
and during the weekends
but one nice thing is that
since I'm using
the tool that I'm developing
for Wolfram
I usually come up
with things that
okay, maybe, or it will
be something like, probably I found a bug
because I'm using our own tools
or I found something that needs to
that could be improved
and at the same time
I have
published through Wolfram
some of the work that I
do with Vult.
I publish a blog post about how I use the tools to do that.
So I think that we have a kind of symbiotic, a nice symbiotic relation
in which this, that is my hobby,
helps me with the work that I do at Worldfront.
Also, in the development of the compiler,
there are things that I try in my boot language,
experiments that I do,
and sometimes I say,
oh, I really like the way that I made this part of the code.
Probably we could apply it to
the product to do
better code or something
like that.
Leonardo, do you have any thoughts
you'd like to leave us with?
Yes.
I was remembering
the phrase from
a famous statistician
that said that all models are fake,
but some models are useful.
And that's kind of the mantra of my life.
Our guest has been Leonardo Lacuna Ruiz, founder of Vault.
Check out his site, vault-dsp.com.
We have links to that in the show notes,
as well as to his wonderful YouTube
tutorials. Thanks, Leonardo. Thank you. It was my pleasure. Thank you to Christopher for producing
and co-hosting. Thank you to Leonardo again for suggesting he be on the show and in the subject
saying he wasn't a robot. And of course, thank you for listening. You can
always contact us at show at embedded.fm or at the contact link on Embedded FM. And now I have a quote
to leave you with from E.O. Wilson, which I always think of him as the ant guy because that was the
first nonfiction book I read that I enjoyed. We are drowning in information while starving for wisdom. The world henceforth
will be run by synthesizers. People able to put together the right information at the right time,
think critically about it, and make important choices wisely.