I would be willing to pay someone to either help me with the control surface library or to just create an example that does what I need it to do.
Control-Surface
Without saying what you need it to do it is impossible to tell. What you need it to do, might not be possible in the first place.
Didn't you look into your glass ball?
It is possible.. the control surface library has all of the functions I need, but they are in different classes. I am having trouble using specific functions from classes that do not have examples.. @Grumpy_Mike I will PM you with the details of what I am trying to do in order to keep this thread category correct.
...or you could just post them here...
I have an akai 25key midi keybed/keyboard. I am using the "NoteButtonMatrix" class and it is working...sending midi note ons and offs. But the keybad has 2 switches per key.
So I need to...
- Keep an array of timestamps for each note key press. (time1)
- Create a second "buttonmatrix" (not NoteButtonMatrix") and store those timestamps. (time2)
- Subtract time1 from time2.
- Use that calculation to determine the velocity of each keypress 0-127.
https://forum.arduino.cc/t/adding-velocity-to-25key-midi-keyboard/1138753@PieterP has responded this post where I asked how to do this very thing but he referenced a .ipp src file for that class. I do not yet know how to look at a library source file and know what the functions and arguments that can be used so im lost on that also.
The just do that. Or is there some problem hidden you did not mention?
Using the finder locate your Arduino folder. Go the the folder called libraries and open that.
Then search for the folder that holds the control surface library and open that. Once you do you will see folder called 'scr', open that and then open the AH folder. Finally open the Hardware folder and you will see the ButtonMatrix.ipp file.
Now drag this file into a text edit application to view and read it.
When I said "I did not know how to look at a library source file" what I meant was that I do not know how to use code inside the .ipp file in my sketch. For example how would the following block of code be used? Do I use it verbatim / copy pasted in to my sketch?
What is the argument "class Derived" ?
Do I need to type out "uint8_t" for the numRows & numCols?
template <class Derived, uint8_t NumRows, uint8_t NumCols>
ButtonMatrix<Derived, NumRows, NumCols>::ButtonMatrix(
const PinList<NumRows> &rowPins, const PinList<NumCols> &colPins)
: rowPins(rowPins), colPins(colPins) {
memset(prevStates, 0xFF, sizeof(prevStates));
}
So a bad question in the first place.
I do not use, nor recommend the use of this library. Like many libraries for the Arduino, they are written by well meaning folk, to make things easy for beginners. But what actually happens is beginners just take the examples and if they don't know what they are doing they are stuck.
Using this sort of library in my opinion is denying beginners the opportunity to learn something that is not to hard, and becomes a barrier to future development.
Sorry I can't answer your question.
I agree, I just got my first book in the mail a few days ago its called "Arduino Cookbook" by OReilly written by Michael Margolis, Brian Jepson & Nicholas Robert Weldin. Im hoping this will be a useful tool for me, thanks anyway.
Maybe @PieterP can help?
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.