| 100 | } |
| 101 | |
| 102 | int CChannelHandler::GetPitch() const |
| 103 | { |
| 104 | if (m_iPitch != 0 && m_iNote != -1 && !m_iNoteLookupTable.empty()) { |
| 105 | // Interpolate pitch |
| 106 | int LowNote = std::clamp(m_iNote - PITCH_WHEEL_RANGE, 0, NOTE_COUNT - 1); // // // |
| 107 | int HighNote = std::clamp(m_iNote + PITCH_WHEEL_RANGE, 0, NOTE_COUNT - 1); |
| 108 | int Freq = m_iNoteLookupTable[m_iNote]; |
| 109 | int Lower = m_iNoteLookupTable[LowNote]; |
| 110 | int Higher = m_iNoteLookupTable[HighNote]; |
| 111 | int Pitch = (m_iPitch < 0) ? (Freq - Lower) : (Higher - Freq); |
| 112 | return (Pitch * m_iPitch) / 511; |
| 113 | } |
| 114 | |
| 115 | return 0; |
| 116 | } |
| 117 | |
| 118 | void CChannelHandler::Arpeggiate(unsigned int Note) |
| 119 | { |
no test coverage detected