Initial ProjectModel implementation

This commit is contained in:
Jack Andersen
2018-07-16 18:48:38 -10:00
parent 7a38fd0676
commit 3f265cdb46
29 changed files with 1337 additions and 224 deletions

View File

@@ -236,8 +236,8 @@ void Voice::_procSamplePre(int16_t& samp)
float start = m_envelopeStart;
float end = m_envelopeEnd;
float t = clamp(0.f, float(m_envelopeTime / m_envelopeDur), 1.f);
if (m_envelopeCurve)
t = m_envelopeCurve->data.at(t * 127.f) / 127.f;
if (m_envelopeCurve && m_envelopeCurve->data.size() >= 128)
t = m_envelopeCurve->data[t * 127.f] / 127.f;
m_curVol = clamp(0.f, (start * (1.0f - t)) + (end * t), 1.f);
// printf("%d %f\n", m_vid, m_curVol);