Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
/*****************************************************************************
VoicesBody.cpp
Copyright (c) 2020 Raphael DINGE
*Tab=3***********************************************************************/
/*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
#include "VoicesBody.h"
#include <cmath>
/*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
/*
==============================================================================
Name : trigger
==============================================================================
*/
void VoicesBody::trigger ()
{
_cur_voice = (_cur_voice + 1) % _voices.size ();
for (size_t i = 0 ; i < _voices.size () ; ++i)
{
auto & voice = _voices [i];
if (i == _cur_voice)
{
voice.trigger ();
}
else
{
voice.stop ();
}
}
}
/*
==============================================================================
Name : set_speed
==============================================================================
*/
void VoicesBody::set_speed (float step_spl)
{
for (auto && voice : _voices)
{
voice.set_speed (step_spl);
}
}
20e06d02cThis file is pinned to the selected release. Download the original to open it in your design tool.