Silences added

This commit is contained in:
2022-07-11 19:27:41 +02:00
parent 4d447f4d36
commit 3b79bf2575
3 changed files with 20 additions and 1 deletions

View File

@@ -64,6 +64,14 @@ void Note::SetFirstNote(const uint8_t note, const uint8_t octave, const uint8_t
this->note = note;
}
void Note::SetSilence() {
this->note = 63;
this->octave = 0;
this->instrument = 0;
this->volume = 0;
this->effect = 0;
}
void Note::SetOctave(const uint8_t octave) {
this->octave = octave;
}
@@ -89,6 +97,8 @@ const uint16_t Note::Get() {
const uint8_t Note::GetAbsoluteNote() {
if ((this->note == 0) && (this->octave == 0)) {
return 0;
} else if (this->note == 63) {
return 63;
} else {
uint8_t result = ((this->octave-2)*12)+this->note+1;
return result;