Author Topic: 4k Software Synthesizer Questions  (Read 7049 times)

0 Members and 1 Guest are viewing this topic.

Offline msm

  • ZX 81
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
4k Software Synthesizer Questions
« on: September 10, 2008 »
 :bfuck2:

hi folks!

i'm currently working on my first software synthesizer... i run into more and more problems right now, said, tackling them for days...

what i have: i coded a modular synthesizer that can make some oscillators (sine, square, noise), i have ADSR envelopes, mixers, etc. i can do filters like echo and stuff. pretty much fun :)

now for what i don't understand: how to design frequency based filters like high and low pass? from theory, it looks like doing a FFT, masking out the filtered frequencies and finally doing some kind of inverse FFT. am i right?

but somehow i have troubles with doing this (beside understanding how FFT works). some more questions:

how does a standard 4k high/low pass filter work? how is it implemented?

are there any good resources for getting the 100% basics for coding this effective? I had no success in finding anything good over the net (even musicdsp has their forum down, so no chance)?

i found some stuff like FIR filtering, but even this didn't give me any clue... there's one nice tutorial at in4k.untergrund.net but i don't get it...

so, you see, i am in trouble, or maybe even stuck somewhere :( i hope you guys can point me into the right direction.

okay, so for the last question: what i understood is that in a sequencer, the musician is playing notes. those notes are basically my samples, so i need to modify my oscillators in order to get the correct sound, right? pitching may destroy the whole sound...

or am i overengineering my whole stuff?

best wishes

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: 4k Software Synthesizer Questions
« Reply #1 on: September 10, 2008 »
Welcome to the forum!
Although it's possible, one wouldn't realize a lowpass filter with fourier transforms because it's computationally expensive.
First of all understand what a lowpass filter is.
Learn the difference between fir and iir filters and how to design them.
Check some implementations and experiment with them.
« Last Edit: September 11, 2008 by hellfire »
Challenge Trophies Won:

Offline msm

  • ZX 81
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
Re: 4k Software Synthesizer Questions
« Reply #2 on: September 11, 2008 »
hi!

thanks a lot for your pointers... i have read them all already, and i'm still stuck somewhere. so maybe i need to precise my questions (sorry for the late weak post yesterday)

i found some example stuff and i'm sure that i understand what they are doing, but i'm not sure how to 'use' them correctly.

like:
short filter_fir(short s, float a0, float a1, a2)
{
     return signal(s) * a0 + signal(s - 1) * a1 + signal(s - 2) * a2;
}

okay, nice. That's some kind of filter. Good, but how to set the coefficients on a (unknown) stream that was generated in advance by lets say a mix(sinus(440), square(200)) or whatever signal (anything is possible). now i need to do / am requested to do:  implement a high pass and low pass filter. so i need so set those coefficients, right?

thanks for your help! :)

cheers

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: 4k Software Synthesizer Questions
« Reply #3 on: September 11, 2008 »
Filters are traditionally designed in analouge style, so called s-domain.
These can be converted to digital filters (so called z-domain) resulting in the coefficients you're looking for.
I suggest reading this, especially the explanation at the end of the file.
Be aware that sooner or later you'll run into trouble with "short" samples, especially when going for iir filters.
Challenge Trophies Won:

Offline msm

  • ZX 81
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
Re: 4k Software Synthesizer Questions
« Reply #4 on: September 11, 2008 »
you're right, though rewriting this for double shouldn't be that complicated :)

okay, so i guess this is more complicated than expected...

i think i will redo from start with some tutorials like this one here: http://www.dsptutor.freeuk.com/ and see if this will help me to understand the basics. it's very hard to take the first steps in signal processing. but i'm quite happy what i already can produce with my currently limited set of functions.

this leads me to another question: is it common when designing a 4k soft synth to have all of this stuff including filters and a complete sequencer, patterns and such? i could imagine that some people rather build up a small set of oscillators modifiers and filters and simply hardcode their sound? i believe its painful to implement a complete toolset (editors are needed for the synth modules, pattern and sequencer, etc)

thanks

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: 4k Software Synthesizer Questions
« Reply #5 on: September 11, 2008 »
Quote
this leads me to another question: is it common when designing a 4k soft synth to have all of this stuff including filters and a complete sequencer, patterns and such?
Yes, if you really want a good song you will need to spend a lot of time on your synth tracker, musicians usually don't like to use bad tools.

Quote
i could imagine that some people rather build up a small set of oscillators modifiers and filters and simply hardcode their sound?
This is possible for simple songs sequences and unless you are doing it yourself, you wont find any musician that like to create music like this.

Quote
i believe its painful to implement a complete toolset (editors are needed for the synth modules, pattern and sequencer, etc)
Yes, it's hard, but it pays off all your hard work when you see your first song coming out of your code, it's amazing! 
One can spend more a than a year (me) learning and developing such tools.


Btw, what you already did on demoscene (intro / demo) ? I've never see your handle/nickname before.



Challenge Trophies Won:

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: 4k Software Synthesizer Questions
« Reply #6 on: September 12, 2008 »
Quote
is it common to have a complete sequencer, patterns and such?
Making music is a creative process.
It is essential to have comfortable environment to work with and to try out variations.
It's up to you if you want to do your own sequencer or integrate your "generator" into existing sytems as a plugin.
Personally I think it's more important to offer usability than synth-features.
You wouldn't expect a graphician to draw a kickass picture using a hexeditor either.
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17422
  • Karma: 499
  • evil/good
    • View Profile
    • My Homepage
Re: 4k Software Synthesizer Questions
« Reply #7 on: September 12, 2008 »
But why re-invent the wheel?

Once you have decided on what features your synth will have, you could allow the musician to use a mainstream tracker program and just import the pattern data into the demo later on.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: 4k Software Synthesizer Questions
« Reply #8 on: September 13, 2008 »
But why re-invent the wheel?

Once you have decided on what features your synth will have, you could allow the musician to use a mainstream tracker program and just import the pattern data into the demo later on.
I tried this before with fasttracker format, the problem is that musician will always try to use something that you cannot use in your small player or something that you never thought before. And ofcourse, sometimes is hard to find information about some particular sound format.
Another big problem is, if you let your musician to develop on a mainstream tracker, as you said, you will need to have exactly the same filters, oscillators etc... to match the same sound (same quality) produced by this tracker on your small player.
Of course, as hellfire said, you can develop plugins to use in systems like for example "buzzmachine" which I'm using right now, this saved me some time to develop a tracker, but it was hard to find info about how to create those plugins for it. But even developing plugins is not the best idea, as I said, musicians will always tend to use something that you never thought before that could be possible.
If I ever find enough motivation again, I'll try to make my own 4k tracker sometime.

If you really want a good system, is better to have a good musician on your side, for developing a 4k synth you can't do everything but you need a minimum setup and your musician will help you on that.
 
Challenge Trophies Won:

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: 4k Software Synthesizer Questions
« Reply #9 on: September 14, 2008 »
Quote
use a mainstream tracker program and just import the pattern data
In my opinion that's the wrong way to go because you are limiting your synthesizer to a simple static sample-generator.
It's probably a good way to get some results on a first try without investing much work, though.
The main aspect of synthesizers is that you can continously modify any apsect of your sound in realtime.
The difficult thing is to handoff this possibility to the musician in a useable interface - most "trackers" are not an adequate environment to achieve this.
Just have a look how professional systems (eg. Rhino) try to achieve this.
Challenge Trophies Won: