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);
}
}

Friday, April 22, 2005

corrected ring deletion: cascade delete

In previous versions, deleting a ring also deleted all subsequent rings in the list. This was only perceptible when the erroneously deleted rings happened to be visible. This situation occurs in certain demo patches which use a large star factor.

demo patches affected:

drastic change:
cross Y totally different; occasional nice moire but mostly too cluttered
lotus light Y rings persist too long and spoil the drama
mercedes Y rings persist too long and spoil the drama

slight change:
pinwheel fab color Y "tunnel" state clears differently, but it's fine
pinwheel Y occasional very slight difference at edges
shimmer Y occasional slight difference at edges
tentacles Y slight difference: occasional stray threads hang around

no change:
good2 N no difference
kaleid N no difference
real pinwheel N no difference

"all at once" cascade:
m_Ring.RemoveAt(CurPos);
while (NextPos != NULL) { // delete remaining rings
CurPos = NextPos;
m_Ring.GetNext(NextPos);
m_Ring.RemoveAt(CurPos);
}

gradual cascade, similar to original behavior, but smoother:
POSITION DelPos = NULL
// main loop
m_Ring.RemoveAt(CurPos);
DelPos = NextPos; // start cascade delete
// end of main loop
if (DelPos != NULL) {
RING& rp = m_Ring.GetNext(DelPos);
rp.Steps = 1e9; // mark ring for deletion
}