Plug-ins, Hosts, Apps,
Hardware, Soundware
Developers
(Brands)
Videos Groups
Whats's in?
Banks & Patches
Download & Upload
Music Search
KVR
   
KVR Forum » DSP and Plug-in Development
Thread Read
Beginner creating VST for project
pieroni
KVRer
- profile
- pm
PostPosted: Wed Dec 05, 2012 5:04 am reply with quote
Hi,

For a project with University I am trying to create a VST. The starting point is to extend the VstXSynth to have more wave forms (which I have done, whether its correct is a completely different thing haha) as well as an ADSR envelope and simple Delay effect.

In terms of the delay, I have been told I can implement the delay sample code into the vstxsynth, however for whatever reason and whatever I try I can't for the life of me get it to work.

As for the envelope I don't even know where to start. So my question is simple, does anyone have any decent points of reference for a complete beginner to do these kinds of things, or any useful samples explaining the basics?

Much appreciated,
Tom
^ Joined: 01 Dec 2012  Member: #293369  
David Carpenter Wind Core
KVRist
- profile
- pm
- e-mail
PostPosted: Wed Dec 05, 2012 6:49 am reply with quote
Make it in synthedit export the modules and look at the code. This should give you an idea of how the code works in c+.
----
The sleeper must awaken.
^ Joined: 16 Dec 2008  Member: #196097  Location: Boulder CO
pieroni
KVRer
- profile
- pm
PostPosted: Wed Dec 05, 2012 6:54 am reply with quote
I've seen synthedit before, never used it though. Is it easy to use?

and thankyou.
^ Joined: 01 Dec 2012  Member: #293369  
arakula
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Wed Dec 05, 2012 10:18 am reply with quote
diggler wrote:
Make it in synthedit export the modules and look at the code. This should give you an idea of how the code works in c+.

From earlier experience, my impression was that SynthEdit doesn't emit C++ source code. Am I mistaken? Since when?
----
"Until you spread your wings, you'll have no idea how far you can walk."
^ Joined: 16 Aug 2004  Member: #37236  Location: Vienna, Austria
daz.diamond
KVRian
- profile
- pm
- www
PostPosted: Wed Dec 05, 2012 2:14 pm reply with quote
you're not mistaken.
^ Joined: 29 Jan 2008  Member: #172132  Location: Arboretum Avenue
MadBrain
KVRian
- profile
- pm
PostPosted: Wed Dec 05, 2012 11:50 pm reply with quote
Yeah I think synthedit tapes a bunch of DLLs together so all the code is already compiled.

Some tips:

Delay: Use a "circular buffer" (essentially an array with the read/write pointers skipping back to the start once the pass the end). Make sure you zero your memory in the constructor.

Envelope: Just code a class that outputs a value that increases/decreases over time (depending on which shape you want).

If you're having a hard time still, you might want to improve your knowledge of C++ too.
^ Joined: 01 Dec 2004  Member: #49995  
nix808
KVRAF
- profile
- pm
PostPosted: Thu Dec 06, 2012 12:21 am reply with quote
with the envelope,
you just want to multiply the oscillators stream with how loud u want it to be.
Release is problematic,
I dunno how it's done really.
But essentially just make an amplitude curve that is MIDI dependant and multiply with stream.
With delay, write to memory and subtract your number of samples which is length
when u read it.
There was some other thing that might be neccessary to avoid clicks. It involved the counting at the end of the buffer.
If your delay is clicking, let me know and I will look what I did to mine.
All success!

edit-also with the delay you need to feedback, for echo
----
Smoke the pipe of peas, human beans!
http://soundcloud.com/nix808
http://rekkerd.org/nix-plugs/
Phonics Audio
^ Joined: 21 Jul 2006  Member: #113899  Location: Melbourne, Australia
pieroni
KVRer
- profile
- pm
PostPosted: Fri Dec 07, 2012 5:10 am reply with quote
Brilliant, thanks for all the feedback. Appreciate it.

So far, I've implemented a lot of the code for Delay, taking into account the frequency amount (as mentioned above). I'm struggling a bit in terms of what needs to go in the process function. The ADelay sample appears to implement the process within the While Loop, am I correct in thinking this?
^ Joined: 01 Dec 2012  Member: #293369  
David Carpenter Wind Core
KVRist
- profile
- pm
- e-mail
PostPosted: Sun Dec 16, 2012 1:20 pm reply with quote
You can export C++ code from synthedit modules. Also you can write new modules in C++.

To export a module into c++ source code right click and select build code skeleton.

This of course is written for synthedit but you could see how to write it for a different app by looking at the source to get an idea.
----
The sleeper must awaken.
^ Joined: 16 Dec 2008  Member: #196097  Location: Boulder CO
random_id
KVRist
- profile
- pm
- e-mail
- www
PostPosted: Sun Dec 16, 2012 4:42 pm reply with quote
pieroni wrote:
The ADelay sample appears to implement the process within the While Loop, am I correct in thinking this?


Yes, the audio host passes a chunk of samples to the plugin to process. The While Loop in the example is where the sound is actually processed. The rest of the code is basically used to setup the controls (e.g., what happens when you click on a slider to increase/decrease the value). For the most part, you want to keep things as efficient as possible within the loop.
^ Joined: 30 Apr 2006  Member: #106122  Location: Lancaster, PA
daz.diamond
KVRian
- profile
- pm
- www
PostPosted: Mon Dec 17, 2012 1:27 am reply with quote
diggler wrote:
To export a module into c++ source code right click and select build code skeleton.


all this does is give the code for a blank module with the pins as per the module you selected - no code is generated for the actual functionality. it is meant as a tool to help 'port' sems from sdk2 to sdk3 ...
^ Joined: 29 Jan 2008  Member: #172132  Location: Arboretum Avenue
All times are GMT - 8 Hours

Printable version
Page 1 of 1
Display posts from previous:   
ReplyNew TopicPrevious TopicNext Topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Username: Password:  
KVR Developer Challenge 2012