diff --git a/res/Examples/MIDI_SimpleSynth/noteList.h b/res/Examples/MIDI_SimpleSynth/noteList.h index c5b5190..5037a05 100644 --- a/res/Examples/MIDI_SimpleSynth/noteList.h +++ b/res/Examples/MIDI_SimpleSynth/noteList.h @@ -1,7 +1,8 @@ /*! - * \file synth-core_NoteList.h + * \file noteList.h * \author Francois Best * \date 24/05/2013 + * \brief Linked list of notes, for Low, Last & High playing modes. * \license GPL v3.0 - Copyright Forty Seven Effects 2013 * * This program is free software: you can redistribute it and/or modify @@ -156,6 +157,10 @@ inline MidiNoteList::~MidiNoteList() // ----------------------------------------------------------------------------- +/*! \brief Add a note, sorting it by time. + Call this when receiving a NoteOn event. This will add the new note as the tail + of the list. + */ template inline void MidiNoteList::add(const MidiNote& inNote) { @@ -186,6 +191,9 @@ inline void MidiNoteList::add(const MidiNote& inNote) print(); } +/*! \brief Remove a note + Call this when receiving a NoteOff event. + */ template inline void MidiNoteList::remove(byte inPitch) { @@ -235,6 +243,9 @@ inline void MidiNoteList::remove(byte inPitch) // ----------------------------------------------------------------------------- +/*! \brief Get a note at an arbitrary position + This can be interesting for duo/multi/polyphony operations. + */ template inline bool MidiNoteList::get(byte inIndex, byte& outPitch) const { @@ -258,6 +269,9 @@ inline bool MidiNoteList::get(byte inIndex, byte& outPitch) const return false; } +/*! \brief Get the last active note played + This implements the Mono Last playing mode. + */ template inline bool MidiNoteList::getLast(byte& outPitch) const { @@ -270,6 +284,9 @@ inline bool MidiNoteList::getLast(byte& outPitch) const return true; } +/*! \brief Get the highest pitched active note + This implements the Mono High playing mode. + */ template inline bool MidiNoteList::getHigh(byte& outPitch) const { @@ -295,6 +312,9 @@ inline bool MidiNoteList::getHigh(byte& outPitch) const return true; } +/*! \brief Get the lowest pitched active note + This implements the Mono Low playing mode. + */ template inline bool MidiNoteList::getLow(byte& outPitch) const { @@ -328,6 +348,8 @@ inline bool MidiNoteList::empty() const return mSize == 0; } +/*! \brief Get the number of active notes. + */ template inline byte MidiNoteList::size() const { @@ -335,6 +357,7 @@ inline byte MidiNoteList::size() const } // ----------------------------------------------------------------------------- +// Private implementations, for internal use only. template inline typename MidiNoteList::Cell* MidiNoteList::getFirstEmptyCell()