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

Any plug-ins that fall under "Awesome modern C++"?

https://github.com/rigtorp/awesome-modern-cpp

Post

"My tip is very simple: Learn it by doing."

This is the way

Post

I got ChatGPT to code a 2 oscillator 1 filter, 1 LFO, & Chorus VST synth in C++. It didn't put any values in for the internals, but it was a great bare bones structure to learn from.

Post

osiris wrote: Sun Feb 05, 2023 4:48 pm I got ChatGPT to code a 2 oscillator 1 filter, 1 LFO, & Chorus VST synth in C++. It didn't put any values in for the internals, but it was a great bare bones structure to learn from.
I'd be interested to know what you told chatgpt to get this

also what do you mean it didnt put any values in for the internals? like an lfo with no frequency value?

Post

Be aware of ‘realtime safe’ code in realtime threads. Look up lock-free programming.

Avoid locks, malloc, logging, anything of that sort in a realtime thread. Use atomics wherever appropriate. The principles are the same across the programming languages, the execution and syntax is different.

Cpp specific: lookup RAII, be aware of rule of zero, rule of seven. Get comfortable with templates and debugging using gdb, run tools like asan, tsan. Stick with modern cpp (avoid c++11). Go for c++17 at the oldest.

Post

keyman_sam wrote: Thu Sep 21, 2023 3:37 am Avoid locks, malloc, logging, anything of that sort in a realtime thread. Use atomics wherever appropriate. The principles are the same across the programming languages, the execution and syntax is different.
Locks are fine as long as you never wait on a lock that might be held by a lower priority thread. Two audio threads using locks to synchronize each other is fine if there's no sensible wait-free alternative. An audio thread waiting for a lock that could be held by a GUI thread on the other hand is a priority inversion and not realtime safe (though sometimes you can get away with this using trywait() primitives in audio thread, if you don't care if it always succeeds and just move along with your audio processing if it doesn't).

Post

j wazza wrote: Wed Sep 20, 2023 10:22 pm
osiris wrote: Sun Feb 05, 2023 4:48 pm I got ChatGPT to code a 2 oscillator 1 filter, 1 LFO, & Chorus VST synth in C++. It didn't put any values in for the internals, but it was a great bare bones structure to learn from.
I'd be interested to know what you told chatgpt to get this

also what do you mean it didnt put any values in for the internals? like an lfo with no frequency value?
I think what it thinks it's trying to do is teach me to code. It says it wants Steinberg SDK, which I don't have so I don't know if it would make any difference. I just asked it to code a basic one oscillator multi wave synth. Midi in, pitch and Unison. The envelopes for amp, filter and a LFO. It did the basic frame. The envelopes were all done but no values for Attack Decay, etc.

Post Reply

Return to “DSP and Plugin Development”