※Using google translate※

Simple music effector for C++

Created using only standard libraries

There are about 20 types of effects

You can add effects to your music with just a few line codes

Supported files

16bit 2ch wavfile


Download

Music.h



Sound source used

I used North Korean music because it seems that copyright is invalid.

The full sound source has been cut out in "2.Cut"


1.Output as is


#include "Music.h"
WaveData wd = WaveData("Example.wav");
wd.Export(2); //Number of channels(1 for mono)
//wd.Export(2,"Example2.wav"); //Name can be specified
wd.Dispose(); //Dispose
				

2.Cut

※The full sound source is used here


#include "Music.h"
WaveData wd = WaveData("Example.wav");
wd.Cut(40.7, 43.8); //Select start and end points in seconds
wd.Export(2); //Channels
wd.Dispose(); //Dispose
				

3.Change speed and pitch


#include "Music.h"
WaveData wd = WaveData("Example.wav");
wd.Speed(1.5,-6); //Playback speed, Pitch(X semitones)
wd.Export(2); //Channels
wd.Dispose(); //Dispose
				

4.Reverb (Low load)


#include "Music.h"
WaveData wd = WaveData("Example.wav");
wd.AlgorithmicReverb(300, 0.6, 0.6); //Delay(milliseconds), magnification, Percentage of original song
wd.Export(2); //Channels
wd.Dispose(); //Dispose
				

5.Reverb (heavy load) (ConvolutionReverb)

ConvolutionReverb

※Search for and download Impuls Response data from the Internet.

It takes 20-30 seconds for a 4-5 minute song.


#include "Music.h"
WaveData wd = WaveData("Example.wav");
wd.LRdel(1000); //Slight delay on one side->The sound seems to expand?
wd.ConvolutionReverb("IR.wav", 0.4,150);//IR file(16bit 2ch wav) Percentage of original song, Disable frequencies below X
wd.Export(2); //Channels
wd.Dispose(); //Dispose
				

6.Change key

The key of this song is Am(#,♭×0), here is an example of changing to A(#×3).


#include "Music.h"
WaveData wd = WaveData("Example.wav");
wd.Custom_Scale(MAJOR_SCALE,0); //Pitch change arrangement(int[12]),key signature(#×1,♭×-1)
wd.Export(2); //Channels
wd.Dispose(); //Dispose
				

7.Flanger


#include "Music.h"
WaveData wd = WaveData("Example.wav");
wd.Flanger(1,0.5);//Speed Percentage of original song,
wd.Export(2); //Channels
wd.Dispose(); //Dispose
				

8.Compressor

Be careful of sound distortion


#include "Music.h"
WaveData wd = WaveData("Example.wav");
wd.Compressor(0.25);//What power should the waveform amplitude be raised to
wd.Export(2); //Channels
wd.Dispose(); //Dispose
				

9.Voice Canceller

If there is a vocal in the center, it can be removed.

Becomes a mono source


#include "Music.h"
WaveData wd = WaveData("Example.wav");
wd.Voicecanseller();
wd.LRdel(1000); //If you want to reduce monophonic sound, put this after
wd.Export(2); //Channels
wd.Dispose(); //Dispose
				

10.Extract Voice

It's easier to succeed if there's only vocals in the center


#include "Music.h"
WaveData wd = WaveData("Example.wav");
wd.CenterMultiplier(5); //The larger the argument, the less likely the sound will remain(recommend 1~10)?
wd.Export(2); //Channels
wd.Dispose(); //Dispose
				

11.Sampling frequency change


#include "Music.h"
WaveData wd = WaveData("Example.wav");
wd.Quality(8000); //Specify the sampling frequency
wd.Export(2); //Channels
wd.Dispose(); //Dispose
				

12.Alien Style


#include "Music.h"
WaveData wd = WaveData("Example.wav");
wd.Alien(1024, 0.1, 0.5, 1.5,1); //Length of one frame, Frame-to-frame acceleration, Minimum speed, Maximum speed, start speed
wd.Export(2); //Channels
wd.Dispose(); //Dispose
				

13.Multiple acceleration


#include "Music.h"
WaveData wd = WaveData("Example.wav");
wd.Multiple(3, 10); //Overlap location (seconds),Speed difference (%)
wd.Export(2); //Channels
wd.Dispose(); //Dispose
				

Others

(Omitted)