Skip to content

Instantly share code, notes, and snippets.

View SignalWhisperer's full-sized avatar

Jean-Sébastien Dominique SignalWhisperer

View GitHub Profile
### Keybase proof
I hereby claim:
* I am tehwan on github.
* I am jdradio (https://keybase.io/jdradio) on keybase.
* I have a public key ASC-4z2vMNBbZMsg7CLgD8KKJ5B0Hm8hsqHNRddpgH5D1Qo
To claim this, I am signing this object:
@SignalWhisperer
SignalWhisperer / main.cpp
Last active June 12, 2020 21:56
Audio LFO example using C++17
#include <cmath>
#include <cstdint>
#include <fstream>
#include <vector>
#include <filesystem>
void work(const std::int16_t* signal, std::int16_t* new_signal, std::size_t num_samples)
{
// Parameters
const double LFO_FREQUENCY = 5; // LFO frequency [Hz]
@SignalWhisperer
SignalWhisperer / main.cpp
Last active June 12, 2020 21:29
Audio LFO example using C++11
#include <cmath>
#include <cstdint>
#include <fstream>
#include <vector>
#include <string>
#include <limits>
void work(const std::int16_t* signal, std::int16_t* new_signal, std::size_t num_samples)
{
// Parameters
@SignalWhisperer
SignalWhisperer / main.cpp
Created June 12, 2020 21:47
Audio LFO example in C++11 using a sine table
#include <cmath>
#include <cstdint>
#include <fstream>
#include <vector>
#include <array>
#include <string>
#include <limits>
const unsigned int SINE_TABLE_NUM_ENTRIES = 1024;

About

This living document will list my own personal frustrations when it comes to C++ software development. This is purely my own opinion, and if I am wrong or simply don't understand, feel free to provide guidance and I will update this document as I see fit. Most of my frustrations so far have been due to my lack of understanding, usually caused by improper documentation of the library I was using.

YAML

There is no good C++ YAML parser library that works out of the box and has appropriate documentation and example. I have used YAML in many programming languages, but could never get it to work reliably in C++. All I want is to read configuration files.

I have tried yaml-cpp but it breaks critical programming contracts regarding constness.

I have tried rapidyml but it has no release cycle, the tutorial does not compile, and documentation is very lacking.