What is KVR Audio? | Submit News | Advertise | Developer Account

Options (Affects News & Product results only):

OS:
Format:
Include:
Quick Search KVR

"Quick Search" KVR Audio's Product Database, News Items, Developer Listings, Forum Topics and videos here. For advanced Product Database searching please use the full product search. For the forum you can use the phpBB forum search.

To utilize the power of Google you can use the integrated Google Site Search.

Products 0

Developers 0

News 0

Forum 0

Videos 0

Search  

Struggling with VSTs

DSP, Plug-in and Host development discussion.

Moderator: Moderators (Main)

pieroni
KVRer
 
8 posts since 1 Dec, 2012

Postby pieroni; Thu Jan 10, 2013 3:05 am Struggling with VSTs

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
bitwise
KVRist
 
90 posts since 18 Mar, 2012

Postby bitwise; Sun Jan 13, 2013 7:29 am

Try it in "Release|Win32" configuration.
pieroni
KVRer
 
8 posts since 1 Dec, 2012

Postby pieroni; Mon Jan 21, 2013 2:30 am

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?
bitwise
KVRist
 
90 posts since 18 Mar, 2012

Postby bitwise; Mon Jan 21, 2013 2:41 am

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.
pieroni
KVRer
 
8 posts since 1 Dec, 2012

Postby pieroni; Mon Jan 21, 2013 2:52 am

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.
bitwise
KVRist
 
90 posts since 18 Mar, 2012

Postby bitwise; Mon Jan 21, 2013 4:53 am

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.
kuniklo
KVRAF
 
2919 posts since 28 Jan, 2004, from Nha Trang, Vietnam

Postby kuniklo; Tue Jan 22, 2013 1:36 am

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.
bitwise
KVRist
 
90 posts since 18 Mar, 2012

Postby bitwise; Tue Jan 22, 2013 4:46 am

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.
pieroni
KVRer
 
8 posts since 1 Dec, 2012

Postby pieroni; Tue Jan 22, 2013 10:30 am

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?
Mayae
KVRist
 
124 posts since 1 Jan, 2013

Postby Mayae; Tue Jan 22, 2013 1:36 pm

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.
bitwise
KVRist
 
90 posts since 18 Mar, 2012

Postby bitwise; Tue Jan 22, 2013 2:48 pm

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.
pieroni
KVRer
 
8 posts since 1 Dec, 2012

Postby pieroni; Sat Jan 26, 2013 2:11 am

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.
User avatar
whyterabbyt
Beware the Quoth
 
21382 posts since 3 Sep, 2001, from R'lyeh Oceanic Amusement Park and Funfair

Postby whyterabbyt; Sat Jan 26, 2013 2:19 am

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...
To laymen, software development is something akin to wizardry. Neither time, nor effort are involved. If software is missing features they want, or has bugs, it is solely because someone has been too lazy to wave their magic wand.

Moderator: Moderators (Main)

Return to DSP and Plug-in Development