void osc::operator()(CreateSample &cs) { int z = (cs.desc.nSamplesPerSec / hz); double PI_2 = M_PI * 2; for (int i=0; i<cs.dwLength; ++i) { cs[i] = NoteType(( sin(PI_2 * (i%z) / z) + 1 ) * cs.maxval); } }
bool SnapDisplay::PrevSnapMode() { if( m_NoteType == 0 ) return false; m_NoteType = NoteType(m_NoteType-1); SnapModeChanged(); return true; }
bool SnapDisplay::NextSnapMode() { if( m_NoteType == NOTE_TYPE_192ND ) // this is the smallest snap we should allow return false; m_NoteType = NoteType(m_NoteType+1); SnapModeChanged(); return true; }
Sprite* NoteColorSprite::Get( NoteType nt ) { if( m_bIsNoteColor ) nt = min( nt, (NoteType) (NOTE_COLOR_IMAGES-1) ); else nt = NoteType(0); return m_p[ m_bIsNoteColor ? nt : 0 ]; }