added individual volume control

+ n.onoff == 2, special msg.
+ n.velocity == 0 => leave vol as is.
This commit is contained in:
Dooho Yi 2022-05-21 05:19:13 +09:00
parent 08c2188fce
commit 04524cabb3
2 changed files with 17 additions and 15 deletions

View file

@ -16,7 +16,7 @@
//============<identities>============
//
#define MY_GROUP_ID (10000)
#define MY_ID (MY_GROUP_ID + 5)
#define MY_ID (MY_GROUP_ID + 15)
#define MY_SIGN ("AUDIOOOO")
#define ADDRESSBOOK_TITLE ("broadcast only")
//
@ -346,7 +346,9 @@ void onNoteHandler(Note & n) {
screen_cmd = n.to_string();
screen_cmd_notify_task.restart();
//
audio.setVolume(n.velocity * 21 / 127 * GAIN_MAX); // 0...127 ==> 0...21
if (n.velocity != 0 || n.onoff == 2) {
audio.setVolume(n.velocity * 21 / 127 * GAIN_MAX); // 0...127 ==> 0...21
}
//
if (n.onoff == 1) {
// filter out re-triggering same note while it is playing.

View file

@ -130,19 +130,19 @@ Audio audio;
std::vector<Note> qlist;
void init_qlist() {
// tech. rehearsal @ May 21
qlist.push_back(Note(10000, 1, 127, 1, 0, 0, 0, 0, 0));
qlist.push_back(Note(10000, 101, 127, 1, 0, 0, 0, 0, 0));
qlist.push_back(Note(10000, 102, 127, 1, 0, 0, 0, 0, 0));
qlist.push_back(Note(10000, 103, 127, 1, 0, 0, 0, 0, 0));
qlist.push_back(Note(10000, 104, 127, 1, 0, 0, 0, 0, 0));
qlist.push_back(Note(10000, 105, 127, 1, 0, 0, 0, 0, 0));
qlist.push_back(Note(10000, 106, 127, 1, 0, 0, 0, 0, 0));
qlist.push_back(Note(10000, 107, 127, 1, 0, 0, 0, 0, 0));
qlist.push_back(Note(10000, 108, 127, 1, 0, 0, 0, 0, 0));
qlist.push_back(Note(10000, 109, 127, 1, 0, 0, 0, 0, 0));
qlist.push_back(Note(10000, 110, 127, 1, 0, 0, 0, 0, 0));
qlist.push_back(Note(10000, 111, 127, 1, 0, 0, 0, 0, 0));
qlist.push_back(Note(10000, 112, 127, 1, 0, 0, 0, 0, 0));
qlist.push_back(Note(10000, 1, 0, 1, 0, 0, 0, 0, 0)); //velocity == 0 ~~> don't change volume.
qlist.push_back(Note(10000, 101, 0, 1, 0, 0, 0, 0, 0));
qlist.push_back(Note(10000, 102, 0, 1, 0, 0, 0, 0, 0));
qlist.push_back(Note(10000, 103, 0, 1, 0, 0, 0, 0, 0));
qlist.push_back(Note(10000, 104, 0, 1, 0, 0, 0, 0, 0));
qlist.push_back(Note(10000, 105, 0, 1, 0, 0, 0, 0, 0));
qlist.push_back(Note(10000, 106, 0, 1, 0, 0, 0, 0, 0));
qlist.push_back(Note(10000, 107, 0, 1, 0, 0, 0, 0, 0));
qlist.push_back(Note(10000, 108, 0, 1, 0, 0, 0, 0, 0));
qlist.push_back(Note(10000, 109, 0, 1, 0, 0, 0, 0, 0));
qlist.push_back(Note(10000, 110, 0, 1, 0, 0, 0, 0, 0));
qlist.push_back(Note(10000, 111, 0, 1, 0, 0, 0, 0, 0));
qlist.push_back(Note(10000, 112, 0, 1, 0, 0, 0, 0, 0));
}