/** Gets and Osc, sets up a new NoteKey structure, assigns stuff and adds to the note list */ NoteKey * newPlayNote(uint8_t noteIndex, uint8_t source) { NoteKey * pNewNote; Oscillator * pNewOsc; pNewOsc = popOsc(); if(pNewOsc) { pNewNote = createNote(pNewOsc, noteTable[noteIndex], NOTE_ATTACK); pNewOsc->amplitude = 0; pNewOsc->enabled = TRUE; pNewOsc->phaseCounter = 0; pNewOsc->phaseIncrement = noteTable[noteIndex]; pNewOsc->frequency = noteTable[noteIndex]; pNewOsc->noteNumber = noteIndex; if((source & NOTE_SRC_MASK) == NOTE_SRC_LAYER) pNewOsc->waveForm = synthLayers[source & NOTE_LAYER_MASK].waveType; else pNewOsc->waveForm = currentSelectedWaveForm; pNewOsc->noteId = NOTE_ID(source, noteIndex); pNewNote->noteId = NOTE_ID(source, noteIndex); addNoteItem(pNewNote); pitchBend(currentPitchBend); return pNewNote; } return NULL; }
void handlePitchBend(uint32_t tics, int channel, int value) { logger(LOG_INFO, "Pitch Bend at: %d for Channel: %d, Value: %d\n", tics, channel, value); pitchBend(channel, value); }