-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Bankable::CCAbsoluteEncoder ability Fixed #227
base: master
Are you sure you want to change the base?
Conversation
Hi, thanks for your pull request. I'm not entirely convinced that this is the best approach, though: I believe each bank should have its own position. That's how I've implemented it on the Pieter |
Hi Peter, My code is simply copy/paste (and adapte) and must be rethink. My goal is creating a controller like that : MIDI Fighter Twister. For example : 2 Banks, Bank<2> bank = {1};
SwitchSelector selectors[] = {
{
bank, // bank to manage
11 // Digital Button pin
},
{
bank, // bank to manage
8 // Digital Button pin
},
{
bank, // bank to manage
5 // Digital Button pin
},
{
bank, // bank to manage
2 // Digital Button pin
},
};
Bankable::CCAbsoluteEncoder enc[] = {
{
{bank, BankType::CHANGE_ADDRESS}, // Bank configuration
{12, 13}, // Digital pin for encoder
{0x10, CHANNEL_1}, // Base CC address
},
{
{bank, BankType::CHANGE_ADDRESS}, // Bank configuration
{9, 10}, // Digital pin for encoder
{0x12, CHANNEL_1}, // Base CC address
},
{
{bank, BankType::CHANGE_ADDRESS}, // Bank configuration
{6, 7}, // Digital pin for encoder
{0x14, CHANNEL_1}, // Base CC address
},
{
{bank, BankType::CHANGE_ADDRESS}, // Bank configuration
{3, 4}, // Digital pin for encoder
{0x16, CHANNEL_1}, // Base CC address
},
}; Thanks for your great work ! PS:Sorry for my ugly English, I'm just a French ;-) |
I'm a bit confused by your code: All four selectors change the same bank, and all encoders use the same bank, so if you press any of the buttons, all of the encoders will change to their second address. If I understand correctly, this would solve that: Bank<2> banks[4] = {1, 1, 1, 1};
SwitchSelector selectors[] = {
{
banks[0], // bank to manage
11 // Digital Button pin
},
{
banks[1], // bank to manage
8 // Digital Button pin
},
{
banks[2], // bank to manage
5 // Digital Button pin
},
{
banks[3], // bank to manage
2 // Digital Button pin
},
};
Bankable::CCAbsoluteEncoder enc[] = {
{
{banks[0], BankType::CHANGE_ADDRESS}, // Bank configuration
{12, 13}, // Digital pin for encoder
{0x10, CHANNEL_1}, // Base CC address
},
{
{banks[1], BankType::CHANGE_ADDRESS}, // Bank configuration
{9, 10}, // Digital pin for encoder
{0x12, CHANNEL_1}, // Base CC address
},
{
{banks[2], BankType::CHANGE_ADDRESS}, // Bank configuration
{6, 7}, // Digital pin for encoder
{0x14, CHANNEL_1}, // Base CC address
},
{
{banks[3], BankType::CHANGE_ADDRESS}, // Bank configuration
{3, 4}, // Digital pin for encoder
{0x16, CHANNEL_1}, // Base CC address
},
}; By the way, to format blocks of code, you need triple back ticks, single back ticks are for inline code:
The |
I'm realy sorry, I see that later and I dont fix it in the message.
Thanks for your efficiency and your time.
I fix in my code and add example
Le lun. 29 juin 2020 à 14:53, tttapa <notifications@github.com> a écrit :
… I'm a bit confused by your code: All four selectors change the same bank,
and all encoders use the same bank, so if you press any of the buttons, all
of the encoders will change to their second address.
If I understand correctly, this would solve that:
Bank<2> banks[4] = {1, 1, 1, 1};
SwitchSelector selectors[] = {
{
banks[0], // bank to manage
11 // Digital Button pin
},
{
banks[1], // bank to manage
8 // Digital Button pin
},
{
banks[2], // bank to manage
5 // Digital Button pin
},
{
banks[3], // bank to manage
2 // Digital Button pin
},
};
Bankable::CCAbsoluteEncoder enc[] = {
{
{banks[0], BankType::CHANGE_ADDRESS}, // Bank configuration
{12, 13}, // Digital pin for encoder
{0x10, CHANNEL_1}, // Base CC address
},
{
{banks[1], BankType::CHANGE_ADDRESS}, // Bank configuration
{9, 10}, // Digital pin for encoder
{0x12, CHANNEL_1}, // Base CC address
},
{
{banks[2], BankType::CHANGE_ADDRESS}, // Bank configuration
{6, 7}, // Digital pin for encoder
{0x14, CHANNEL_1}, // Base CC address
},
{
{banks[3], BankType::CHANGE_ADDRESS}, // Bank configuration
{3, 4}, // Digital pin for encoder
{0x16, CHANNEL_1}, // Base CC address
},
};
By the way, to format blocks of code, you need triple back ticks, single
back ticks are for inline code:
```cpp
// Code block
```
The cpp after the opening three back ticks specifies the programming
language (C++), so you get the correct syntax highlighter.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#227 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFDHF7AXQIY42WPE4OYNZ3RZCFGJANCNFSM4OKW3AGA>
.
--
Julien CHENAVAS
Mail : jchenavas@gmail.com
Tel : 06.75.22.11.59
|
Is it possible to use CD74HC4067 with encoder? I test it with simple button and it work but not with encoder... Thanks in advance |
No, that's not possible, see #191. |
Add Bankable::CCAbsoluteEncoder ability Fixed