Update audio example
This commit is contained in:
parent
6f6add1cab
commit
6a38c127c6
1 changed files with 2 additions and 0 deletions
|
|
@ -12,6 +12,7 @@
|
|||
#include <psemek/audio/effect/pause.hpp>
|
||||
#include <psemek/audio/effect/loop.hpp>
|
||||
#include <psemek/audio/effect/pitch.hpp>
|
||||
#include <psemek/audio/effect/distortion.hpp>
|
||||
#include <psemek/audio/duplicate.hpp>
|
||||
#include <psemek/audio/stereo.hpp>
|
||||
#include <psemek/audio/mixer.hpp>
|
||||
|
|
@ -89,6 +90,7 @@ struct audio_app
|
|||
{
|
||||
int midi = key_to_midi.at(key);
|
||||
auto tone = audio::karplus_strong(440.f * std::pow(2.f, (midi - 69) / 12.f));
|
||||
tone = audio::distortion(std::move(tone));
|
||||
channels_[key] = mixer_->add(audio::fade_in(tone, 0.002f));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue