Discussion:
[LAU] Online resources/books for programming sound synthesis software?
Thomas Janu
2007-04-12 10:22:38 UTC
Permalink
Hi all!

I just subscribed to this list as I now feel confident enough in my programming
skills and my ability to understand mathematical descriptions to finally start
what I always wanted to do: program my own synthesizers ;) Now I just wonder if
there are any recommendations on what to read to get started fairly quickly. Any
suggestions?

Greetings,
Thomas
j***@dis-dot-dat.net
2007-04-12 10:44:41 UTC
Permalink
Post by Thomas Janu
Hi all!
I just subscribed to this list as I now feel confident enough in my programming
skills and my ability to understand mathematical descriptions to finally start
what I always wanted to do: program my own synthesizers ;) Now I just wonder if
there are any recommendations on what to read to get started fairly quickly. Any
suggestions?
The Jack examples are a great place to start looking at code. Also, I
wrote a howto for people writing Jack apps for the first time:

http://www.dis-dot-dat.net/index.cgi?item=/jacktuts/starting/

I hope you get more sources in this thread, because I would like to
read more myself.

James
Post by Thomas Janu
Greetings,
Thomas
_______________________________________________
Linux-audio-user mailing list
http://lists.linuxaudio.org/mailman/listinfo.cgi/linux-audio-user
Thomas Janu
2007-04-12 10:59:35 UTC
Permalink
Post by j***@dis-dot-dat.net
The Jack examples are a great place to start looking at code. Also, I
http://www.dis-dot-dat.net/index.cgi?item=/jacktuts/starting/
That's already great, thanks a lot! ;)
Post by j***@dis-dot-dat.net
I hope you get more sources in this thread, because I would like to
read more myself.
More specifically I'm looking for commented code examples/tutorials on how to
emulate sound synthesis, so writing oscillators, filters and so on as well as
nice examples of the ``big picture'' so that i can see how it's all put together
to form a synth. That'd be really nice.

Thomas
Lars Luthman
2007-04-12 11:02:09 UTC
Permalink
Post by Thomas Janu
Post by j***@dis-dot-dat.net
The Jack examples are a great place to start looking at code. Also, I
http://www.dis-dot-dat.net/index.cgi?item=/jacktuts/starting/
That's already great, thanks a lot! ;)
Post by j***@dis-dot-dat.net
I hope you get more sources in this thread, because I would like to
read more myself.
More specifically I'm looking for commented code examples/tutorials on how to
emulate sound synthesis, so writing oscillators, filters and so on as well as
nice examples of the ``big picture'' so that i can see how it's all put together
to form a synth. That'd be really nice.
http://musicdsp.org


--ll
Marc-Olivier Barre
2007-04-12 12:38:32 UTC
Permalink
Post by Lars Luthman
Post by Thomas Janu
Post by j***@dis-dot-dat.net
The Jack examples are a great place to start looking at code. Also, I
http://www.dis-dot-dat.net/index.cgi?item=/jacktuts/starting/
That's already great, thanks a lot! ;)
Post by j***@dis-dot-dat.net
I hope you get more sources in this thread, because I would like to
read more myself.
More specifically I'm looking for commented code examples/tutorials on how to
emulate sound synthesis, so writing oscillators, filters and so on as well as
nice examples of the ``big picture'' so that i can see how it's all put together
to form a synth. That'd be really nice.
http://musicdsp.org
Now, who said there was never anything of interest said on this list ?
I want names !

Lars, James: thanks for the links ;-)
__________________
Marc-Olivier Barre,
Markinoko.
Loki Davison
2007-04-12 12:53:51 UTC
Permalink
Post by Thomas Janu
Post by j***@dis-dot-dat.net
The Jack examples are a great place to start looking at code. Also, I
http://www.dis-dot-dat.net/index.cgi?item=/jacktuts/starting/
That's already great, thanks a lot! ;)
Post by j***@dis-dot-dat.net
I hope you get more sources in this thread, because I would like to
read more myself.
More specifically I'm looking for commented code examples/tutorials on how to
emulate sound synthesis, so writing oscillators, filters and so on as well as
nice examples of the ``big picture'' so that i can see how it's all put together
to form a synth. That'd be really nice.
Thomas
_______________________________________________
Linux-audio-user mailing list
http://lists.linuxaudio.org/mailman/listinfo.cgi/linux-audio-user
Have a look at some of the DSSI and LV2 synths/plugins. You could also
help out on some of the lv2 synths others are writing as then you can
get some help easily and have some direction from someone with a bit
more experience. I found this useful. You can also try implementing
some of you ideas in a modular like Ingen first.

Loki
Damon Chaplin
2007-04-12 13:06:33 UTC
Permalink
Post by Thomas Janu
Post by j***@dis-dot-dat.net
The Jack examples are a great place to start looking at code. Also, I
http://www.dis-dot-dat.net/index.cgi?item=/jacktuts/starting/
That's already great, thanks a lot! ;)
Post by j***@dis-dot-dat.net
I hope you get more sources in this thread, because I would like to
read more myself.
More specifically I'm looking for commented code examples/tutorials on how to
emulate sound synthesis, so writing oscillators, filters and so on as well as
nice examples of the ``big picture'' so that i can see how it's all put together
to form a synth. That'd be really nice.
I've been learning the same stuff recently as well.

I've attached my first attempt at a very basic synth using ALSA MIDI for
input and JACK for output. (Note that I'm not an audio expert so there
may be a few errors in it. If anyone spots an error please let me know.)

Wikipedia seems to have quite a few articles on synthesis:
http://en.wikipedia.org/wiki/Audio_synthesis

I just read "The Computer Music Tutorial" by Curtis Roads, which was
recommended by a few Linux audio developers. It's a fairly good
introduction, though it seems slightly dated. I'm also reading "Elements
of Computer Music" by F.Richard Moore, but I wouldn't recommend it as a
first book as the maths is pretty difficult.

Damon
Robin Gareus
2007-04-12 13:40:26 UTC
Permalink
Post by Damon Chaplin
Post by Thomas Janu
Post by j***@dis-dot-dat.net
The Jack examples are a great place to start looking at code. Also, I
http://www.dis-dot-dat.net/index.cgi?item=/jacktuts/starting/
That's already great, thanks a lot! ;)
Post by j***@dis-dot-dat.net
I hope you get more sources in this thread, because I would like to
read more myself.
More specifically I'm looking for commented code examples/tutorials on how to
emulate sound synthesis, so writing oscillators, filters and so on as well as
nice examples of the ``big picture'' so that i can see how it's all put together
to form a synth. That'd be really nice.
I've been learning the same stuff recently as well.
when learning to code, it's easier and more fun to start from scratch
rather than jumping on some existing project! - But I agree with Loki
that linuxaudio is lacking resources and the wheel has been re-invented
too often already..

http://apps.linuxaudio.org/apps/categories/software_sound_synthesis_and_music_composition_packages
http://apps.linuxaudio.org/apps/categories/softsynths_and_samplers
http://apps.linuxaudio.org/apps/categories/general_synthesis_packages

DSSI and LV2 do have well defined API's and once you got a bit of coding
experience, you will gladly embrace those APIs to get things done more
quickly, and it makes it also easier for others to use your code.

There are also a lot of high-level langs to implement synths or
algorithms. (supercollider, Csound, pure-data, ...)
Post by Damon Chaplin
I've attached my first attempt at a very basic synth using ALSA MIDI for
input and JACK for output. (Note that I'm not an audio expert so there
may be a few errors in it. If anyone spots an error please let me know.)
only glimpsed quickly over it, looks good.
minor detail - in the jack_process callback:

add jack_port_get_total_latency(..) to Note[i].oscillator_offset;

#robin
Damon Chaplin
2007-04-13 11:18:14 UTC
Permalink
Post by Robin Gareus
when learning to code, it's easier and more fun to start from scratch
rather than jumping on some existing project! - But I agree with Loki
that linuxaudio is lacking resources and the wheel has been re-invented
too often already..
http://apps.linuxaudio.org/apps/categories/software_sound_synthesis_and_music_composition_packages
http://apps.linuxaudio.org/apps/categories/softsynths_and_samplers
http://apps.linuxaudio.org/apps/categories/general_synthesis_packages
But there are so many it's a bit overwhelming. It would probably take a
week or two to try them all out. Maybe we need a rating system so people
can spot the good ones more easily.

It would also be good to know which GUI toolkit they use - I could only
really help out with GTK+ code.


(Though I have no real intention to write a synth anyway - I'm just
messing about to learn ALSA and JACK.)
Post by Robin Gareus
add jack_port_get_total_latency(..) to Note[i].oscillator_offset;
Can you explain that a bit more - why is it needed?

Thanks,

Damon
Robin Gareus
2007-04-13 11:57:34 UTC
Permalink
Post by Damon Chaplin
Post by Robin Gareus
add jack_port_get_total_latency(..) to Note[i].oscillator_offset;
Can you explain that a bit more - why is it needed?
imagine you "pipe" the output of your synth thru an effect that
introduces a latency (delay).

It might seem insignificant - but: if you use two of those synths with
different Effects afterwards, you get phasing effects!

similar if you have multiple output ports:
http://jackaudio.org/files/docs/html/jack_8h.html#a38


[JACK]MIDI allows to timestamp midi-events. - So the synth-osc's
themselves could be in sync. - try to start two of them, invert the
polarity of one and check if the resulting signal is zero. (bitscope)

If it is, add a LADSPA DJ-EQ (1901) to one of the channels, IIRC that
introduces a latency of 3 samples on that channel and you should hear
some phased signal.


#robin

Frank Barknecht
2007-04-12 13:28:33 UTC
Permalink
Hallo,
Post by Thomas Janu
More specifically I'm looking for commented code examples/tutorials
on how to emulate sound synthesis, so writing oscillators, filters
and so on as well as nice examples of the ``big picture'' so that i
can see how it's all put together to form a synth. That'd be really
nice.
Pure Data's source code isn't heavily commented, but written in a
clear and structured way. If you browse the CVS at pure-data.sf.net
you will also see the code for hundreds of "externals", that is, Pd
plugins doing synthesis and other stuff. This should be enough source
code to get you started. To understand how externals are structured,
you may want to read the Externals HOWTO first:
http://iem.at/pd/externals-HOWTO/ You could also just write or modify
some Pd externals first and let Pd do the housekeeping of talking to a
soundcard etc. for now.

Of course the other synthesis environments like SuperCollider, CSound
etc. are open source as well, I just don't know their source that
good, so I cannot recommend on how useful they are.

For a written introduction to writing synthesis code in (K&R) C I
would very much recommend F. Richard Moore's classic book "Elements of
Computer Music".

Ciao
--
Frank Barknecht _ ______footils.org_ __goto10.org__
Loading...