Silences added
This commit is contained in:
10
main.cpp
10
main.cpp
@@ -239,7 +239,10 @@ int main(int argc, char* argv[]) {
|
|||||||
case SDL_SCANCODE_H: note.SetFirstNote(8, base_octave, current_instrument, current_volume, current_effect); break;
|
case SDL_SCANCODE_H: note.SetFirstNote(8, base_octave, current_instrument, current_volume, current_effect); break;
|
||||||
case SDL_SCANCODE_N: note.SetFirstNote(9, base_octave, current_instrument, current_volume, current_effect); break;
|
case SDL_SCANCODE_N: note.SetFirstNote(9, base_octave, current_instrument, current_volume, current_effect); break;
|
||||||
case SDL_SCANCODE_J: note.SetFirstNote(10, base_octave, current_instrument, current_volume, current_effect); break;
|
case SDL_SCANCODE_J: note.SetFirstNote(10, base_octave, current_instrument, current_volume, current_effect); break;
|
||||||
case SDL_SCANCODE_M: note.SetFirstNote(11, base_octave, current_instrument, current_volume, current_effect); break;
|
case SDL_SCANCODE_M:
|
||||||
|
note.SetFirstNote(11, base_octave, current_instrument, current_volume, current_effect); break;
|
||||||
|
case SDL_SCANCODE_A:
|
||||||
|
note.SetSilence(); break;
|
||||||
default: m = false; break;
|
default: m = false; break;
|
||||||
};
|
};
|
||||||
if (m) {
|
if (m) {
|
||||||
@@ -351,6 +354,11 @@ int main(int argc, char* argv[]) {
|
|||||||
if (x == selected_channel && (y+scroll) == selected_row) color = color_dark_purple;
|
if (x == selected_channel && (y+scroll) == selected_row) color = color_dark_purple;
|
||||||
draw_string("...", xp, yp, color);
|
draw_string("...", xp, yp, color);
|
||||||
draw_string("...", 16+xp, yp, color);
|
draw_string("...", 16+xp, yp, color);
|
||||||
|
} else if (note.GetAbsoluteNote() == 63) {
|
||||||
|
uint8_t color = color_light_grey;
|
||||||
|
//if (x == selected_channel && (y+scroll) == selected_row) color = color_dark_purple;
|
||||||
|
draw_string("===", xp, yp, color);
|
||||||
|
draw_string("===", 16+xp, yp, color);
|
||||||
} else {
|
} else {
|
||||||
//uint8_t note_num = get_note(current_note);
|
//uint8_t note_num = get_note(current_note);
|
||||||
|
|
||||||
|
|||||||
10
note.cpp
10
note.cpp
@@ -64,6 +64,14 @@ void Note::SetFirstNote(const uint8_t note, const uint8_t octave, const uint8_t
|
|||||||
this->note = note;
|
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) {
|
void Note::SetOctave(const uint8_t octave) {
|
||||||
this->octave = octave;
|
this->octave = octave;
|
||||||
}
|
}
|
||||||
@@ -89,6 +97,8 @@ const uint16_t Note::Get() {
|
|||||||
const uint8_t Note::GetAbsoluteNote() {
|
const uint8_t Note::GetAbsoluteNote() {
|
||||||
if ((this->note == 0) && (this->octave == 0)) {
|
if ((this->note == 0) && (this->octave == 0)) {
|
||||||
return 0;
|
return 0;
|
||||||
|
} else if (this->note == 63) {
|
||||||
|
return 63;
|
||||||
} else {
|
} else {
|
||||||
uint8_t result = ((this->octave-2)*12)+this->note+1;
|
uint8_t result = ((this->octave-2)*12)+this->note+1;
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
1
note.h
1
note.h
@@ -17,6 +17,7 @@ class Note {
|
|||||||
void SetInstrument(const uint8_t instrument);
|
void SetInstrument(const uint8_t instrument);
|
||||||
void SetVolume(const uint8_t volume);
|
void SetVolume(const uint8_t volume);
|
||||||
void SetEffect(const uint8_t effect);
|
void SetEffect(const uint8_t effect);
|
||||||
|
void SetSilence();
|
||||||
|
|
||||||
const uint16_t Get();
|
const uint16_t Get();
|
||||||
const uint8_t GetAbsoluteNote();
|
const uint8_t GetAbsoluteNote();
|
||||||
|
|||||||
Reference in New Issue
Block a user