Saturday, April 30, 2005

demo crossfade

randomize phase of parms whose frequency goes from zero to nonzero first, in A and B if freq AND amp are zero, set freq to 1e-6 so phase change will stick

for (int i = 0; i < ROWS; i++) {
if (!m_CrossDlg.GetInfo(reverse ? CCrossDlg::SEL_B : CCrossDlg::SEL_A).m_Row[i].ModFreq
&& m_CrossDlg.GetInfo(reverse ? CCrossDlg::SEL_A : CCrossDlg::SEL_B).m_Row[i].ModFreq) {
m_Osc[i].SetPhase(double(rand()) / RAND_MAX);
printf("randomized %s\n", ParmInfo::GetRowData(i).Name);
}
}

No comments: