What are the most important parts of C++ for coding plug-ins?

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

Post

CalabiYauGuy wrote:I picked it up with just college math (from Romania)
Salut! I lived in Oradea when I was a child... There must have been something in the water that gave us a knack for DSP. :) Edit: I haven't yet established that I have a knack for this, just to be clear.

And, on a serious note, I think the most important ingredient for learning anything is a desire. You have to want it.

I'm on hour 100 of 10,000.

Post

Borogove wrote:
WilliamK wrote:Also, when using strings, remember to leave some extra chars at the end as a string END will use extra char information. EG: char Msg[10] you can't do strcpy(Msg,"1234567890"); Is best to use strncpy(Msg,"1234567890",10); This avoid problems. Most times use the strncpy to avoid buffer-overrun.
If you do strncpy that way, you will avoid the immediate buffer overrun, but you now have a non-terminated string which won't print correctly (at best). I recommend that you never call strncpy directly, but instead make a function like:

Code: Select all

char* strncpy_safe( char* dest, char* src, char* length )
{
   char* result = strncpy( dest, src, length );
   dest[length-1] = 0;
   // good catch, stefan
   return result;
}
In its current form, strncpy() is one of the most dangerous functions in the C library simply because it lulls intermediate programmers into a false sense of security.
haha yes, that null terminator is dangerous!

Post

Sad to say it, but it seems the most important part now, if you're not inside a corporation or indedendently wealthy, is to include a library for Internet authentication, with Internet=based deactivation too. It won't discourage the most determined, but it's enough to ensure people know it is intended to pay someone's bills.

Post

[quote="dskdskdsk"]

I'm on hour 100 of 10,000.[/quote]

I'm not sure I could be sure to understand everything in this thread, but I certainly understance that. Enjoy :)

Post

A bunch of really good advices in this topic.

Got an Ipad? Then there is a few C / C++ books in the iBook library, and this one is specially worth taking a look at:

I bought a book called Beginner C++ programming which was really cheap. It costed me 25 SEK ($3.78 USD). It's an illustrated book, and it's really simple to read and get a hang of things in it. Ofc I haven't had the chance yet to read it yet, since the download acted up a bit. It's IIRC based on Mac, but I think that the most examples can be converted to Windows / Linux.
Best regards from Johan Brodd.
JoBroMedia since 1996.

Post

What do yo guys think of Java for audio programming? I ask in reference to Android programming...

Post

I know this thread is old, but I stumbled upon it when I started my VST journey. It took me 2 semesters of C++ classes and about 8 months of tinkering with the DSP and the VST container, but I have my first original VST plugin.

It is a very rewarding experience and I hope that all beginners reading this will put forth the time and effort to make something really cool.

If you're interested in checking out my handy work, I am a designer at Gourmet Grooves. You can download demo versions of my plugin for MAC and PC here:

PC - http://cloud.gourmet-grooves.com/public ... ERSION.zip
MAC - http://cloud.gourmet-grooves.com/public ... ERSION.zip

If you want to check out other cool stuff Gourmet Grooves is doing, see our website: http://www.gourmet-grooves.com

btw, the entire site is a DIY operation. Great things can be done with a few weeks and a computer.

Best of luck to all on their VST journey. Let's make something cool. [/url]

Post

Nice to see the Apollo on your front page.. :)

Post

What I didn't realize before was that the VST SDK 2.4 contained example projects for Microsoft Visual Studio that show you in plain easy to understand black and white, which are the most important parts of code for coding VST plugins.

Further, there are visual studio projects out there on the net that you can compile yourself.

the Juce framework is a toolkit that you can include.

hardly anybody codes every last line themselves anymore, it's a team effort.

Post

Math. functions that can shape a ramp signal, i.e. sample number 123456... into sines, triangles, sawtooths, pulses, etc.

lerp functions that can antialias oscillators so they dont jump -1 1 amplitude on your speaker in 1 44000ds of a second

Arrays that can read wavetables, i.e. pre recorded osc waves, and can read conversion tables like p2f.

if, else if, else if, else, conditions that can do multiplex/selector routing, so you use one button to select any number of configurations in the synth.

some randomisation functions

code some filters from musicdsp website, i managed the one from the cookbook reference, thanks to some help. filters are useful on sea anenomes and on synths.

Post

I'm on Mac 10.5.8 and I have to say, I haven't even been able to figure out how to get a f***ing sin wav output to my audio system using C++ after downloading like 5 different libraries and wasting a TON TON TON TON TON of time messing with Terminal and compilation issues.

It has been *extremely* disheartening, to say the least. I even got the BasicSynth book and can't get a f***ing thing to work on my computer with that, or with anything else. At this point I am packing it in and moving back to just messing with MIDI.

I honestly think if I could have just gotten a simple sin wav output up and running that would have been nice. It shouldn't be this hard - but I guess it is. I've got some updates in the mail and maybe, just maybe, they'll help.

But I have to say, I really am extremely frustrated.

That said I've only been programming for a few months, and only been using C++ for two weeks at this point.

Still... I can't help but feel sad. I have literally spent about a week straight trying and failing to get any libraries to work on my computer. I had a relatively complex program with a GUI and excellent features built in Python after picking up computer programming for the first time in my life - within a couple weeks!

You'd think there would just be a straightfoward guide to using built in stuff to make such a SIMPLE sin wav program without a f***ing library... but no.

I just want a god damn sin wav in real time, with some basic parameters, that doesn't use external libraries. I know that may sound stupid but I can't figure a f***ing thing out when every header file in any library (CoreAudio as well) has 1,000 things in it that have nothing to do with my problem.

I just don't get how it has to be this complicated to just build a sin wav with real time audio output in a single file without a header or ANYTHING overly complicated. I mean - that's literally the most basic level of audio output that there is. So yeah.

I had to rage somewhere.

Post

I feel your pain! I have been programming c++ for 30+ years now and all I can say is it does get easier :) but you are in for a tough time to start with. Unlike other languages C++ relies very heavily on libraries so you need to understand how to work with them first.

For a simple sin wave plugin you couldtake the again example from the SDK and modify that as a starting point

Post

doglios wrote:I'm on Mac 10.5.8 and I have to say, I haven't even been able to figure out how to get a f***ing sin wav output to my audio system using C++ after downloading like 5 different libraries and wasting a TON TON TON TON TON of time messing with Terminal and compilation issues.

It has been *extremely* disheartening, to say the least. I even got the BasicSynth book and can't get a f***ing thing to work on my computer with that, or with anything else. At this point I am packing it in and moving back to just messing with MIDI.

I honestly think if I could have just gotten a simple sin wav output up and running that would have been nice. It shouldn't be this hard - but I guess it is. I've got some updates in the mail and maybe, just maybe, they'll help.

But I have to say, I really am extremely frustrated.

That said I've only been programming for a few months, and only been using C++ for two weeks at this point.

Still... I can't help but feel sad. I have literally spent about a week straight trying and failing to get any libraries to work on my computer. I had a relatively complex program with a GUI and excellent features built in Python after picking up computer programming for the first time in my life - within a couple weeks!

You'd think there would just be a straightfoward guide to using built in stuff to make such a SIMPLE sin wav program without a f***ing library... but no.

I just want a god damn sin wav in real time, with some basic parameters, that doesn't use external libraries. I know that may sound stupid but I can't figure a f***ing thing out when every header file in any library (CoreAudio as well) has 1,000 things in it that have nothing to do with my problem.

I just don't get how it has to be this complicated to just build a sin wav with real time audio output in a single file without a header or ANYTHING overly complicated. I mean - that's literally the most basic level of audio output that there is. So yeah.

I had to rage somewhere.

My advices if you want to code audio application would be:
1°) Be sure to be okay with the basics of audio signal processing (no need to be a math expert be knowing what is the math behind a sinus wave is good)
2°) Study the basics of the programmation
3°) Read book. I would recommend you this one "Learning Core Audio: A Hands-On Guide to Audio Programming for Mac and iOS" by Chris Adamson, Kevin Avila
4°) Enjoy
DSP & Software engineer for an audio software company by day.
Music producer by night.

Post

In short, performance. DSP is one of those fields where real-time processing is a serious constraint which is why low-level languages such as C/C++/Assembly are used. Tackling the problem of performance can be done on several levels of abstraction from high-level algorithms (learn mathematics, complexity analysis, data structures, Fourier anything) to the low-level nitty gritty (bottlenecked code is often some inner loop that needs to be optimized via assembly/SIMD operations). Between these poles are all the computer-science related background from knowing how the OS works, memory management, caching, instruction parallelism/branching, etc etc.

Post

ChrisNilson wrote:
doglios wrote:I'm on Mac 10.5.8 and I have to say, I haven't even been able to figure out how to get a f***ing sin wav output to my audio system using C++ after downloading like 5 different libraries and wasting a TON TON TON TON TON of time messing with Terminal and compilation issues.

It has been *extremely* disheartening, to say the least. I even got the BasicSynth book and can't get a f***ing thing to work on my computer with that, or with anything else. At this point I am packing it in and moving back to just messing with MIDI.

I honestly think if I could have just gotten a simple sin wav output up and running that would have been nice. It shouldn't be this hard - but I guess it is. I've got some updates in the mail and maybe, just maybe, they'll help.

But I have to say, I really am extremely frustrated.

That said I've only been programming for a few months, and only been using C++ for two weeks at this point.

Still... I can't help but feel sad. I have literally spent about a week straight trying and failing to get any libraries to work on my computer. I had a relatively complex program with a GUI and excellent features built in Python after picking up computer programming for the first time in my life - within a couple weeks!

You'd think there would just be a straightfoward guide to using built in stuff to make such a SIMPLE sin wav program without a f***ing library... but no.

I just want a god damn sin wav in real time, with some basic parameters, that doesn't use external libraries. I know that may sound stupid but I can't figure a f***ing thing out when every header file in any library (CoreAudio as well) has 1,000 things in it that have nothing to do with my problem.

I just don't get how it has to be this complicated to just build a sin wav with real time audio output in a single file without a header or ANYTHING overly complicated. I mean - that's literally the most basic level of audio output that there is. So yeah.

I had to rage somewhere.

My advices if you want to code audio application would be:
1°) Be sure to be okay with the basics of audio signal processing (no need to be a math expert be knowing what is the math behind a sinus wave is good)
2°) Study the basics of the programmation
3°) Read book. I would recommend you this one "Learning Core Audio: A Hands-On Guide to Audio Programming for Mac and iOS" by Chris Adamson, Kevin Avila
4°) Enjoy
#3 times 1000! very good book and demystified quite a bit for me.

Post Reply

Return to “DSP and Plugin Development”