# HG changeset patch # User Chris Cannam # Date 1435591352 -3600 # Node ID 8a2166088b9484f10668d8c1b93ede746091872e # Parent d25e4aee73d796a8c167a7c24ea9e2a1d5e02861 Initialise pitch and shift vectors to 1.0 instead of randomly -- seems to produce at least no worse results, and has the advantage of producing deterministic output diff -r d25e4aee73d7 -r 8a2166088b94 src/EM.cpp --- a/src/EM.cpp Fri Jun 26 10:23:54 2015 +0100 +++ b/src/EM.cpp Mon Jun 29 16:22:32 2015 +0100 @@ -44,17 +44,13 @@ { m_pitches = allocate(m_noteCount); m_updatePitches = allocate(m_noteCount); - for (int n = 0; n < m_noteCount; ++n) { - m_pitches[n] = float(rand()) / RAND_MAX; - } + v_set(m_pitches, 1.f, m_noteCount); if (useShifts) { m_shifts = allocate_channels(m_shiftCount, m_noteCount); m_updateShifts = allocate_channels(m_shiftCount, m_noteCount); for (int f = 0; f < m_shiftCount; ++f) { - for (int n = 0; n < m_noteCount; ++n) { - m_shifts[f][n] = float(rand()) / RAND_MAX; - } + v_set(m_shifts[f], 1.f, m_noteCount); } } else { m_shifts = 0; @@ -65,7 +61,7 @@ m_updateSources = allocate_channels(m_sourceCount, m_noteCount); for (int i = 0; i < m_sourceCount; ++i) { for (int n = 0; n < m_noteCount; ++n) { - m_sources[i][n] = (inRange(i, n) ? 1.0 : 0.0); + m_sources[i][n] = (inRange(i, n) ? 1.f : 0.f); } }