Skip to content

Instantly share code, notes, and snippets.

View chbtoys's full-sized avatar

Carl H. Blomqvist chbtoys

View GitHub Profile
@chbtoys
chbtoys / quiz2.cpp
Created July 17, 2022 09:57
audio programming - beginner level
// compile: clang++ -std=c++20 quiz2.cpp -o quiz2
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <random>
namespace quiz
{
class Quiz
@chbtoys
chbtoys / quiz.cpp
Created July 17, 2022 09:56
audio programming - beginner level
// compile: clang++ -std=c++20 quiz.cpp -o quiz
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <random>
namespace quiz
{
class Quiz
@chbtoys
chbtoys / MoogFilter.hpp
Created July 17, 2022 09:55
audio programming - beginner level
#ifndef MOOG_H
#define MOOG_H
#define MOOG_PI 3.14159265358979323846264338327950288
#include <vector>
namespace Moog
{
class MoogFilter
{
@chbtoys
chbtoys / Envelope.hpp
Created July 17, 2022 09:54
audio programming - beginner level
#ifndef ADSR_H
#define ADSR_H
#include <vector>
#include <cmath>
namespace ADSR
{
class Envelope
{
@chbtoys
chbtoys / 12-physicalmodelling_karplus_strong.cpp
Created July 17, 2022 09:52
audio programming - beginner level
// compile: clang++ -std=c++20 -lpng 12-physicalmodelling_karplus_strong.cpp -o 12-physicalmodelling_karplus_strong
#define _USE_MATH_DEFINES
#include <cmath>
#include <vector>
#include <random>
#include <filesystem>
#include "indicators.hpp"
#include <png++/png.hpp>
#include "AudioFile/AudioFile.h"
#include "Envelope.hpp"
@chbtoys
chbtoys / 11-wavetable.cpp
Created July 17, 2022 09:51
audio programming - beginner level
// compile: clang++ -std=c++20 -lpng 11-wavetable.cpp -o 11-wavetable
#define _USE_MATH_DEFINES
#include <cmath>
#include <vector>
#include <random>
#include <filesystem>
#include "indicators.hpp"
#include <png++/png.hpp>
#include "AudioFile/AudioFile.h"
#include "Envelope.hpp"
@chbtoys
chbtoys / 10-virtualanalog.cpp
Created July 17, 2022 09:50
audio programming - beginner level
// compile: clang++ -std=c++20 10-virtualanalog.cpp -o 10-virtualanalog
#include <iostream>
int main()
{
std::cout << "An analog modeling synthesizer is a synthesizer that generates the sounds of traditional analog synthesizers using DSP components and software algorithms. Analog modeling synthesizers simulate the behavior of the original electric and electronic circuitry in order to digitally replicate their tone.\n\n";
std::cout << "This method of synthesis is also referred to as Virtual Analog or VA. Analog modeling synthesizers can be more reliable than their true analog counterparts since the oscillator pitch is ultimately maintained by a digital clock, and the digital hardware is typically less susceptible to temperature changes.\n\n";
std::cout << "While analog synthesizers need an oscillator circuit for each voice of polyphony, analog modeling synthesizers don't face this problem. This means that many of them, especially the more modern models, can produce as many polyphonic voices as the CPU on w
@chbtoys
chbtoys / 09-vectorsynth.cpp
Created July 17, 2022 09:47
audio programming - beginner level
// compile: clang++ -std=c++20 -lpng 09-vectorsynth.cpp -o 09-vectorsynth
#define _USE_MATH_DEFINES
#include <cmath>
#include <vector>
#include <random>
#include <filesystem>
#include "indicators.hpp"
#include <png++/png.hpp>
#include "AudioFile/AudioFile.h"
#include "Envelope.hpp"
@chbtoys
chbtoys / 08-scanned.cpp
Created July 17, 2022 09:46
audio programming - beginner level
// compile: clang++ -std=c++20 -lpng 08-scanned.cpp -o 08-scanned
#define _USE_MATH_DEFINES
#include <cmath>
#include <vector>
#include <random>
#include <filesystem>
#include "indicators.hpp"
#include <png++/png.hpp>
#include "AudioFile/AudioFile.h"
@chbtoys
chbtoys / 07-pd.cpp
Created July 17, 2022 09:45
audio programming - beginner level
// compile: clang++ -std=c++20 -lpng 07-pd.cpp -o 07-pd
#define _USE_MATH_DEFINES
#include <cmath>
#include <vector>
#include <random>
#include <filesystem>
#include "indicators.hpp"
#include <png++/png.hpp>
#include "AudioFile/AudioFile.h"