How to: write a soft synthesizer
category: code [glöplog]
yumeji: the filter code looks like its from "Musical Applications of Microprocessors", published in 1985.
@BarZoule, thank you, I’ll watch it for sure when I have spare time!
Btw, I’ve heard of “time shift” by some musicians I’m friend with, and I don’t understand what it is in the end. A special effect on all instruments? Or a simple rewind of the time, accelerated?
Btw, I’ve heard of “time shift” by some musicians I’m friend with, and I don’t understand what it is in the end. A special effect on all instruments? Or a simple rewind of the time, accelerated?
That term could mean anything, although I think what they meant was "timestretch".
time.. stretch?
gargaj was there first.
jmagic: I have the second edition of the Han Chamberlin's "Musical application of microprocessor", and most of the example code is written in assembler for 6502, 68000 or for the Notran music system, so I don't think the code posted by yumeji comes from this book.
It's not the literal code but the algorithm is similar, i.e. using integrators.
considering the sound playback/buffer:
what kb said
using the waveOut API does the trick without having to spend much space and thoughts on buffering, threads etc.
just make sure that the large buffer "allocation" is NOT done on the heap with a malloc or new statement.
better use a static allocation so the buffer resides in the .bss section of the binary.
it seems certain Vista/7 sound drivers (or maybe the driver model itself) dislike providing heap-allocated buffers to the waveOut functions which gets written to after the waveOut call.
at least we had undefined behaviour and even crashes with uncovering static until we changed it back to a static allocation like 4klang uses it.
what kb said
using the waveOut API does the trick without having to spend much space and thoughts on buffering, threads etc.
just make sure that the large buffer "allocation" is NOT done on the heap with a malloc or new statement.
better use a static allocation so the buffer resides in the .bss section of the binary.
it seems certain Vista/7 sound drivers (or maybe the driver model itself) dislike providing heap-allocated buffers to the waveOut functions which gets written to after the waveOut call.
at least we had undefined behaviour and even crashes with uncovering static until we changed it back to a static allocation like 4klang uses it.
Speaking of that, how does the synth progress? Do you plan to release a public VSTi for it? It's been quite a while since Uncovering Static, and I'm really interested in seeing what you managed to come up with ;-)
A nice / tiny / multiplatform lib to get going quickly with real-time audio I/O is RtAudio: www.music.mcgill.ca/~gary/rtaudio/
Libaries that weren't written with size in mind are pretty much always too big for 4k/64k I'd say, no matter how tiny they are. ;)
Yep, relatively "tiny" :D
People asking for a scenesynth version of Raymarching beginner's thread, could very well use this thread I started in hope of exactly that ;)