Struggling with VSTs

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

Hi,

I'm attempting to learn how to code VSTs... I've done all the examples that come in the Steinberg SDK, modified them to do slightly different things, but now I'm trying to teach myself how to do more. I've found some useful sources on the internet... more specifically from here:

https://ccrma.stanford.edu/~medearis/220c/

I've been trying to compile this without the gui, just plain and simple, but for some reason when I try to use it there is no sound output. If anyone has seen this or knows what the issue might be, it would be greatly appreciated.

I've pulled all the code together into this vis studio project...

http://dl.dropbox.com/u/21696319/VstXSynth.rar

Any help would be greatly appreciated

Post

Try it in "Release|Win32" configuration.

Post

for whatever reason, when i compile a release version there is no dll file to use. Clearly I'm doing something wrong, do you have any ideas of what this could be?

Post

Does it show some error?

I can't tell you more, i don't have VS2012.

Perhaps, when switching to the new configuration, you have to update some project's setting.

Post

Sorry, it was my bad. It was just in another directory that I didn't bother checking haha.

After checking to see whether that works though, it appears I do get some sort of output, but its incredibly distorted and quiet and doesnt do anything near to what I want it to.

Post

It could be the std::vector class inside the audio loop, which is not fast enough. The fact that it starts working in Release mode seems to show that, in fact, some checks are removed in the Release code.

Post

bitwise wrote:It could be the std::vector class inside the audio loop, which is not fast enough. The fact that it starts working in Release mode seems to show that, in fact, some checks are removed in the Release code.
I'd expect this to increase the CPU load but not to prevent the VST from working entirely.

Post

I experienced this, once. It was a stand alone application and i was using either a std::list or a std::vector. No sound. Then i measured the time it took to fill a buffer or something (if i remember). The precision was in milliseconds. I got numbers with 2 digits, sometimes 3. Perhaps i didn't try the Release version, but i replaced the list with a list wrapped around an array. I got numbers with "zero" digits (less than 1 msec). Perhaps the use of the vector was a bit more intensive than the vstxsynth one.

Post

so do you think it would be this area causing me the grief? is this where i should be spending most of my time and efforts?

Post

I didn't check the code, but almost certainly wont be a using a vector. Those are optimized to hell, unless you use them wrongly (ie. pushing something back in thousands of times instead of reallocating). You will experience buffer underruns and in extreme cases no sound if you cannot generate samples quicker than 1 sec / sample_rate. You can check how much cpu it uses.

Post

pieroni wrote:so do you think it would be this area causing me the grief? is this where i should be spending most of my time and efforts?
I had to compile your code. I couldn't hear any sound, not even in the Release version. So it doesn't depend on some lag.

I noticed that the output was always zero.

You were not incrementing "fPhase1". And why you were not?

Because of this commented line:

Code: Select all

//fPhase1 += baseFreq + (parent->fModIndex * MAX_MOD_INDEX * modulation * parent->fScaler);
Once uncommented, i got a couple of errors:

"fModIndex" and "MAX_MOD_INDEX" not defined.

They are not defined in your example, but they are in the original code that i can find online.

Anyway, i replaced "parent->fModIndex * MAX_MOD_INDEX" with "1" and i could hear sounds in the Debug version.

Post

thankyou so much for checking it over for me, like I said, I'm new to this I'm just trying to learn so all I'm doing at the moment is changing things and seeing what does what.

Post

pieroni wrote:thankyou so much for checking it over for me, like I said, I'm new to this I'm just trying to learn so all I'm doing at the moment is changing things and seeing what does what.
my opinion so just a suggestion but if you're changing things to see what it does, and then you get no sound, then revert the change rather than ask for someone to tell you why its making no sound. given that you know you changed stuff, and they dont, its just a touch rude to expect someone to spend time 'fixing' something you randomly broke. especially if you dont tell people until after they did all the work.

as for trying to work out what stuff does, you'd be far better off tracing what's going on than just changing stuff to see what happens. break it down into smaller steps, and keep track of what things are doing (which you cant do by just removing them).
what'll almost invariably happen is that you break something that had a purpose, and if you dont know what it was originally doing, you're not going to discover what if its not there. thats a bit like bashing some component in a car our of shape to see how the car runs with it in a new shape...
my other modular synth is a bugbrand

Post Reply

Return to “DSP and Plugin Development”