Author Topic: Soft synth idea - am I crazy?  (Read 44691 times)

0 Members and 1 Guest are viewing this topic.

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Soft synth idea - am I crazy?
« Reply #20 on: January 19, 2012 »
...
If you're heading for 64k it's just annoying to have a minute of sound-precalc just to save a few hundred bytes of code.

trve!
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: Soft synth idea - am I crazy?
« Reply #21 on: February 05, 2012 »
I've started working on something along these lines now. Rather than trying to make a soft-synth from the ground up, I'm putting together a tool that will let you load an XM file and replace the samples with synth sounds. The replayer will generate the sounds in realtime and feed them into the replayer. Hopefully, this will provide the flexibility of XM with some nice sounding synth voices. It's early days, so this may well come crashing down around my ears soon ;)

I'm putting together the GUI in managed C++ / C++ .Net; so I can then call the standard C/C++ replayer and synth code easily. Getting managed and unmanaged code to play nicely together has given me quite a headache but I've finally got the two playing reasonably nicely together! I have a Winforms app that lets you load an XM with a file-browser and play it, so I'm getting somewhere...

Not sure how useful the finished product will be but I'm sure to learn a lot during its development. My primary goal at the moment is being able to easily jazz up old XM tunes for use in intros and make them smaller at the same time (due to having no stored samples anymore).  Hopefully I'll be able to come up with a friendly GUI that makes it easy to replace the samples with synth sounds (side by side comparison etc). I'm using MiniFmod as a base and will modify that as I go along to fit in the synth stuff.

Ideally I'd like to be able to detect (roughly) the type of sample (drum, hi-hat, lead etc) and auto-generate something similar automatically. This may be a pipe dream though. Hopefully I can at least detect the pitch of the source sample in most cases and match that with the generated synth voice.

I came across Protrekkr earlier which seems to do exactly what my eventual grand plan was (fasttracker style app with in-built synth), which looks very nice if a little confusing.

Anyway, enough rambling for now :)

raizor
raizor

Challenge Trophies Won:

Offline Kirl

  • Senior Member
  • Pentium
  • ********
  • Posts: 1217
  • Karma: 230
    • View Profile
    • Homepage
Re: Soft synth idea - am I crazy?
« Reply #22 on: February 06, 2012 »
Sounds awesome, looking forward to it!
You're a brave man. :)
www.kirl.nl
Challenge Trophies Won:

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: Soft synth idea - am I crazy?
« Reply #23 on: February 06, 2012 »
I'm putting together a tool that will let you load an XM file and replace the samples with synth sounds.
I seriously doubt that's a good workflow.
If you want to keep it simple, just export the generated sounds to wav.
So your muisican can import them into his favourite tracker and work with them.
Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: Soft synth idea - am I crazy?
« Reply #24 on: February 06, 2012 »
I'm putting together a tool that will let you load an XM file and replace the samples with synth sounds.
I seriously doubt that's a good workflow.
If you want to keep it simple, just export the generated sounds to wav.
So your muisican can import them into his favourite tracker and work with them.

It would be a pretty horrible workflow for a musician to compose with for sure. This is just for me to play with using existing XM files, rather than for composing new ones.
raizor

Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: Soft synth idea - am I crazy?
« Reply #25 on: February 20, 2012 »
OK, I concede that the XM idea is a bit crazy, especially as a first project in this area.

I've started putting together my first synth, which is going ok so far. I've got oscillators in place, generating all the basic waveforms (and noise).

I plan to have a voice pool (initially 32 voices) and a 16 channels. Oscillators and effects willbe available in a fixed stack (3 oscillators with optional ring mod and master/slave setup). I think making a flexible stack system is probably asking for trouble at the moment, but that can always be added later. I'm writing the synth in c# initially and will write a replayer in c++ eventually. This makes knocking up the GUI fairly straightforward and it should be possible to wrap it up in a VSTI eventually...

I'm not overly concerned with size as I doubt this will compact enough for 4k use.

I have a few questions that hopefully someone with some experience or musical knowledge might know the answer to:

For handling polyphony, is this normally done per channel? I.e. instrument X can only play 2 instances per channel, or is it a free for all until the voice pool is full?

For detuning, how granular should the detune amount be? Is a semitone enough? I've seen some synth patches mentioning detuning by cents (1/100 of an octave). Kb's synth allows detuning from -64 to 63, which to me seems a little weird as I have no idea of the size of these steps (maybe a semitone??)

Are channel effects the norm? I'd like to have effects per channel as well as per patch or globally. This would allow some nice mod/xm style effects (hopefully). For triggering these effects I'm hoping to use unused midi channel commands (or existing ones if they fit). I've not had a chance to read up on midi commands yet, so I don't know if this is a bad idea yet.

Any comments or tips would be great :)
« Last Edit: February 20, 2012 by Raizor »
raizor

Challenge Trophies Won:

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: Soft synth idea - am I crazy?
« Reply #26 on: February 20, 2012 »
For handling polyphony, is this normally done per channel? I.e. instrument X can only play 2 instances per channel, or is it a free for all until the voice pool is full?
What you call "channels" are probably multi-timbral instances of the same synth?
In that case you'd limit polyphony per instance, it's sometimes desirable to run one voice monophonic and another one polyphonic.

Quote
For detuning, how granular should the detune amount be? Is a semitone enough?
You'd usual split this into fine-tune (eg +/- 1 semitone) and pitch (eg to run one osci an octave lower than the other).

Quote
Kb's synth allows detuning from -64 to 63, which to me seems a little weird
That's because midi allows values between 0 and 127.

Quote
I'd like to have effects per channel as well as per patch or globally.
There're usually effects per voice and global (for mastering track volume).
Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: Soft synth idea - am I crazy?
« Reply #27 on: February 20, 2012 »
Thanks Hellfire. I'm thinking of channels in the tracker sense. Maybe that mindset isn't the right one here. In a VSTI, each channel being an instance of the synth makes perfect sense. My desire for channels is really just to group effects such as pitch bend or distortion. Having the lead playing in channel #1 with a phase effect for example. Maybe I'm missing something or overcooking this?
raizor

Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: Soft synth idea - am I crazy?
« Reply #28 on: February 27, 2012 »
I've been making some reasonable progress on this but I'm a bit confused about AUX buffers. A lot of synths seem to use them but I can't find any real details on their purpose or how they work. Does anyone have any info please?
raizor

Challenge Trophies Won:

Offline ferris

  • Pentium
  • *****
  • Posts: 841
  • Karma: 84
    • View Profile
    • Youth Uprising Home
Re: Soft synth idea - am I crazy?
« Reply #29 on: February 27, 2012 »
http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: Soft synth idea - am I crazy?
« Reply #30 on: February 27, 2012 »
Great Ferris, thanks :)
K++
raizor

Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: Soft synth idea - am I crazy?
« Reply #31 on: February 28, 2012 »
Before I head too far down the wrong path. I just wanted to get some ideas/thoughts on layout and structure for the components within a patch/instrument.

Currently, I have a single stack system, that allows you do drop components (oscillator, envelope etc) on top of each other. The signal passes down the stack, through the components and is then mixed with the global output at the end like so:

[OSC 1]
     |
[OSC 2]
     |
[ENV 1]
     |
[ OUT ]

I'm wondering if this is going to be flexible enough. I plan to allow LFO's and other modulators to be dropped in set to control parameters for other components that will be linked to the LFO (i.e. link LFO to Oscillator 1 volume or panning). Do you think I should allow different processing streams within a patch and allow the outputs to be mixed? for example:

[OSC 1]     [OSC 2]
     |                |
[DELAY]    [DISTORTION]
      \              /
        \          /
          \___/
              |
         [ENV 1]
              |
          [ OUT ] 

I think this will make the synth much more flexible, I'm just wondering if the pain is worth the gain. Coming up with a nice GUI for example 2 is going to more work :)

I'm also wondering if patches should take the output of another patch as input. So I could have a patch called "Synth 1" that is a nice clean synth voice and then have a patch called "Synth 2" which takes the output from "Synth 1" and adds delay or some other effects to it. Is this worth investigating/implementing?

Thanks
raizor

Challenge Trophies Won:

Offline ferris

  • Pentium
  • *****
  • Posts: 841
  • Karma: 84
    • View Profile
    • Youth Uprising Home
Re: Soft synth idea - am I crazy?
« Reply #32 on: February 28, 2012 »
In my later 4k synth I had a basic stack scheme you showed in your first diagram, but one crucial addition was a mixer device that would mix the output of two stacks together. This made it MUCH more flexible, but again, this was in a 4k synth and there are much smarter ways to do this for a full-sized thing :) . One idea that's used in Reason is the Spider Audio Merger/Splitter; it's literally exactly what it sounds like (the highlighted device in this pic):



There's also a variant in Reason for CV signals. In more standard DAW's, however, you often have the concept of sends/busses. A bus is basically a signal path and a send is a routing assignment to direct signal to that path. I would make a better screenshot for you in Reaper if I had it installed on this machine, but since I don't, here's an old screenshot:



here each mixer channel you see represents either an original audio signal or a bus (in Reaper both are just tracks). There's a small I/O box on each as you can see; the ones with "snd" highlighted means they have output going to a bus other than the "master" which is their usual output (which either goes to the actual master or their parent track; another feature in Reaper), and the ones with "rcv" means that they're receiving one or more input signals from another track.

Implementation-wise, this would be pretty straightforward; each signal or bus could just be a Channel (or Track in Reaper terms) object with a Parent field. If the Parent is null, the output goes to the main mixing bus; else the main output goes to the channel's parent (this sort of routing is something I often use for drums so you would have volume/fx control per percussion sound and another volume/fx control for the ensemble). There would also be a global list of Send objects, where a Send object could simply contain two Channel references (representing the source and destination respectively) and the volume for this send. So, each sample/synth buffer iteration all of the Channels would take input from all of the other Channels that are sending them input, mix them together, and produce their own output. To reduce inter-Channel latency, a simple pass could be performed whenever routing is changed to figure out the order in which devices should be calculated. This could be a recursive algorithm where you simply visit each bus sending output to the main bus, and for each of these you then visit the Channels they're receiving input from. The visitation order is then the reverse of the order the machines should be calculated in (note that if a device has already been visited, it is ignored upon revisitation). If you have loops in the send/receive routing, this would still incur some latency, but that's a rare special case that should be avoided by the user anyways.

As far as the patches goes; I would recommend each Channel to simply have a linear list of devices to work from, just as you showed in your first diagram. Then, you could serialize the devices and their parameters as patches per channel; this is also how it's done in Reaper and how it could work in your system. Not exactly the same functionality as you mentioned, but it could be a nice alternative :)

This post kinda turned into a rant about how my next synth will work, haha :P Man, I love this stuff... anyways, hope my blabbering helps; please let me know if some of this doesn't make sense :)
http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: Soft synth idea - am I crazy?
« Reply #33 on: February 28, 2012 »
Thanks for the in-depth response Ferris. I should probably study Reason and Reaper a bit to get some more ideas.

"There's also a variant in Reason for CV signals"

What's a CV signal btw?

I'll need to read that a couple more times to get my head around it properly. I'm still a bit confused by the last part.
raizor

Challenge Trophies Won:

Offline ferris

  • Pentium
  • *****
  • Posts: 841
  • Karma: 84
    • View Profile
    • Youth Uprising Home
Re: Soft synth idea - am I crazy?
« Reply #34 on: February 28, 2012 »
CV stands for Control Voltage; a pretty "vintage" term for parameter signals that's still in use :) Things like parameter automation and LFO's would be CV signals.
http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won:

Offline energy

  • Amiga 1200
  • ****
  • Posts: 280
  • Karma: 25
    • View Profile
Re: Soft synth idea - am I crazy?
« Reply #35 on: February 28, 2012 »
coding: jwasm,masm
hobby: www.scd2003.de

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: Soft synth idea - am I crazy?
« Reply #36 on: February 28, 2012 »
Thanks Energy. Will have a read through the source and see if I can make any sense of it.
raizor

Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: Soft synth idea - am I crazy?
« Reply #37 on: March 05, 2012 »
I'm still making steady progress (which is kinda nice). I've just finished implementing resonant filters (high pass, low pass, band pass and notch) which seems to work quite well (after a good few hours chasing my tail due to silly coding mistake).

 I'm still using a linear stack for patch components and still mulling over the best way to handle mixing within a patch. My current thinking is to have an AuxA and AuX buffer per voice (as well as a standard output buffer for voice that gets mixed into the main mix with all the other voices as the final buffer is prepared).

My idea is to allow a mixer component in the stack to take inputs from the main voice buffer and also the Aux A and Aux B buffers for the voice. This way, if your doing some chorus effect (or whatever) you can chuck a mixer into the stack before the chorus and then have the mixer spit out the signal to the main voice buffer and an Aux buffer to. The chorus component can then dirty up the main voice buffer. I'd then have another mixer in the stack below the chorus that takes the dirty chorus signal (from the main buffer) and the cleaner (pre-chorus) signal from Aux and then mix them and output them back to the main voice buffer. This would allow me to do a nice dry/wet mix of the chorus output and the clean signal before it hit the chorus. I'm not sure if that makes sense, but it seems logical to me. My only concern would be processing overhead with the additional steps for the mixing...

The spider route might be better, but the above approach keeps all signals linear (no backwards processing up the stack, which it seems a spider approach would do).

Any comments or suggestions gratefully received :)
raizor

Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Soft synth idea - am I crazy?
« Reply #38 on: March 05, 2012 »
@Raizor: here some synths that might interest you:
Quiver (VSTi):
http://straightarrow.dk/quiver/

Sunvox (Full tracker):
http://www.warmplace.ru/

It's useful to see which features they use, might help you designing your own.


For me, I'm going to re-code my little synth attempt, while trying to fix some (lots of) design mistakes and keeping some few good ones. :)

Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: Soft synth idea - am I crazy?
« Reply #39 on: March 05, 2012 »
@rbz

Thanks for the links! K++

SunVox looks pretty damn swish! Lovely looking interface. I'd need to delve into WPF to get something looking anywhere near as nice as that.

I'd be interested in seeing your old synth, if you don't mind or maybe just a screenshot for curiousity's sake :)

Quiver led me to a link that's very interesting. The PadSynth oscillator. Looks like a great wavetable generator and sounds really lovely. Something to investigate for sure.

Also, I grabbed a copy of this book from Amazon today. Hopefully it will arrive tomorrow. It looks very useful.
« Last Edit: March 05, 2012 by Raizor »
raizor

Challenge Trophies Won: