-
Notifications
You must be signed in to change notification settings - Fork 145
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
PB and CC encoder #76
Comments
Do you mean encoders or potentiometers? If the latter, would something like this work? |
I mean rotary encoders. There is an example for pots in your library already.
Would be ok having a pushbutton to switch for each encoder as long as it works. Or is there a mix chip and library example for rotary encoders
On Dec 17, 2019 22:35, tttapa <notifications@github.com> wrote:
Do you mean encoders or potentiometers? If the latter, would something like this<https://tttapa.github.io/Control-Surface-doc/Doxygen/d4/d79/One-Pot-Both-PB-and-CC_8ino-example.html> work?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#76?email_source=notifications&email_token=AJSCCYDBF5WBKJSHTPF7ULLQZEZYPA5CNFSM4J4AAKA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHD3ZFY#issuecomment-566738071>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AJSCCYFX3KY2EYKP3W3UKNTQZEZYPANCNFSM4J4AAKAQ>.
|
In that case, I don't think I understand your question, as I'm not aware of any standard way to use pitch bend message for incremental information like rotary encoders. Do you want to use the encoder in absolute mode? |
It would be similar to your pb and cc potentiometer example.
In the first bank I want 8 rotary encoders that send pitch bend.
In the second bank I want 8 rotary encoders that send control change.
1 or 2 buttons to select between the two banks.
So when choosing bank 1 the encoders Will send pitch bend messages.
(VOLUME_ 1 to 8) on the first 8 channels.
Choosing the second bank the encoders Will send cc messages (V_POT_ 1 to 8)
for the first 8 channels.
Is it possible? Is there an io expander that could handle rotary encoders.
If yes. Which one and how would I implement it?
Other option is connect 16 encoders to 32 pins on the teensy 4.
8 for volume
8 for v_pot
leaving 2 accessable pins for connecting 4 mcp23017 on the i2c bus to give
up to 64 buttons and or leds. (Example would be appreciated)
Then No oleds (I wanted to add 4 using your oled example 2) unless you
could modify the code to use i2c oleds. I know it's about ten times slower
than spi but I'd only require the displays to show static information like;
track name, mute, solo, touch, write, read, zoom, cycle, play, record, pan
and select.
The axbm files I would create and implement myself.
And would it be possible to use 2 buttons to control master volume as there
would be no analog Pin available?
I know it's asking alot but I'm patient and wait till end of Feb ...like
you said.
…On Wed, Dec 18, 2019, 15:44 tttapa ***@***.***> wrote:
In that case, I don't think I understand your question, as I'm not aware
of any standard way to use pitch bend message for incremental information
like rotary encoders.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#76?email_source=notifications&email_token=AJSCCYFQGMAFGK4LXF4XMHTQZISJ3A5CNFSM4J4AAKA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHGEW6Y#issuecomment-567036795>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJSCCYB4EGV2Y5EGZVBDOXDQZISJ3ANCNFSM4J4AAKAQ>
.
|
I see. There's a difference between how rotary encoder information and volume information is transmitted. Rotary encoders use an incremental mode, if you turn the encoder 4 ticks to the left, a message "-4" is sent to the computer, not the absolute position of the knob. I just added a new class that does exactly that. Example The big problem here is that each encoder keeps track of its own position. So, if you switch from "volume" mode to "pan" mode, turn the encoder to change the pan, and then change back to "volume" mode, the volume will have changed as well.
You need interrupts for the encoders to work reliably. There are IO expanders with interrupt capability, but it's not trivial to implement. Using I²C in an ISR context is tricky, for example.
You can use the OLED examples with I²C without any problems, they use the Adafruit_SSD1306 library. Have a look at their examples on how to use I²C.
Sure, you can use the IncrementDecrementButtons class. |
Awesome.... But the reason I wanted to use rotary encoders for cc and pitch bend in the first place with studio one was that when changing banks or channels they didn't "remember" the previous position. Will give it a try in about 12 hours time when I finish work.
Also with regard to the first question of having 2 banks... one with 8 cc encoders and one with 8 pb encoders. How do I go about setting it up.
|
Just a thought. If I edit the mackie control xml file to indicate 4 instead of 8 channels as default.
Then could I use the first pb example you gave me for volume of the first 4 channels and the normal cc encoder for the v_pot of the first 4 channels. Including mute solo select buttons for the 4 channels.
Then 2 oleds on spi using your example. Showing track names VU and pan for the 4 channels.
3rd oled I can setup to show time ,play record and other easy to implement note in stuff.
Then use midix16 to create virtual mackie extenders(with 4 channels per extender) so that I would be able to see the track names. When changing banks.
Reason being I sometimes mixdown songs with up to 30 tracks. And would be advantages to see what track I'm on as apposed to the channel number or bank number.
I'll attemp to setup or implement 2 expander on i2c.
Also try messing around with the extender example in the library for a few days. Then get back to you when I'm really stuck.
|
Hi found a work around
Going to use the :
CCIncrementDecrementButtons
example and map the vpots to buttons.
Will try combining the oled 2 example and the io extender examples and bother you if I get stuck.
Thanks for all you help this far
|
To switch between PB encoder and CC encoder, you could probably use something like this: #include <Encoder.h>
#include <Control_Surface.h>
USBMIDI_Interface midi;
Button button = 4;
Encoder enc = {2, 3};
BorrowedMIDIRotaryEncoder<ContinuousCCSender> ccenc = {
enc,
MCU::V_POT_1,
1, // multiplier
4, // pulses per step
{}, // MIDI sender
};
BorrowedMIDIAbsoluteEncoder<PitchBendSender<14>> pbenc = {
enc,
CHANNEL_1,
127, // multiplier
4, // pulses per step
{}, // MIDI sender
};
void setup() {
button.begin();
Control_Surface.begin();
pbenc.disable();
}
void loop() {
Control_Surface.loop();
auto buttonState = button.update();
if (buttonState == Button::Falling) {
ccenc.disable();
pbenc.resetPositionOffset();
pbenc.enable();
} else if (buttonState == Button::Rising) {
pbenc.disable();
ccenc.resetPositionOffset();
ccenc.enable();
}
} You have to use the share-encoder branch of the Control Surface library, and my fork of the Encoder library. I'm pretty sure I made a mistake somewhere in the position logic and the |
After messing around with it for a few days . I've given up on the switch and decided to make it a 4 channel mixer. edited the mackie control script and files in the Daw from 8 to 4 channels and it seems to be working ok. So I have 4 channels with encoders for pan and volume. an encoder for scrub and a pot for master volume. 4 screens, one per channel using an adapted version of your 2 oled example. The mux for buttons i'm still trying to figure out using the control surface library, but it works fine with the teensy library. but that i'll leave for another day when i have the other 4 mux chips. The main issue now is getting the channel info from Studio one 4 . tried using your 2 screen oled example as is but everything except "MCU::LCD" works, what daw are you using or tested it on? |
You can check if the LCD receives anything using the I should be able to get the the 8 track encoders working, but it won't be before early February. |
These are the messages that Studio one sends when I change the name of the tracks: SysEx: f0 00 00 66 14 12 00 54 72 61 63 6b 31 20 f7 on cable 0 On channel 2: SysEx: f0 00 00 66 14 12 07 54 72 61 63 6b 32 20 f7 on cable 0 included the config files in Studio One for Mackie control, hope |
At first glance, the sysex data looks alright. What does LCD::getText return? You can print it to the serial monitor. |
Sorry for my ignorance but I don't know how to do it.
I installed traction and it works.
Included the OLD part of my sketch so you can tell me where to insert "LCD::getText" please.
…________________________________
From: tttapa <notifications@github.com>
Sent: Tuesday, 24 December 2019 21:34
To: tttapa/Control-Surface <Control-Surface@noreply.github.com>
Cc: rogerarends <rogerarends@hotmail.com>; State change <state_change@noreply.github.com>
Subject: Re: [tttapa/Control-Surface] PB and CC encoder (#76)
You can check if the LCD receives anything using the LCD::getText<https://github.com/tttapa/Control-Surface/blob/afec0f0a95f3239400c12b9722dca1106ff7c951/src/MIDI_Inputs/MCU/LCD.hpp#L40> method.
I tested it using the Traction 6 DAW.
I should be able to get the the 8 track encoders working, but it won't be before early February.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub<#76?email_source=notifications&email_token=AJSCCYCVFOZUCRYZQY2NZCDQ2JP2RA5CNFSM4J4AAKA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHTR52A#issuecomment-568794856>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AJSCCYE37O7SZVJNTSR5BVLQ2JP2RANCNFSM4J4AAKAQ>.
|
I'll post some code when I get home. |
The following should print the display data to the Serial Monitor (you can open it from the Arduino IDE after uploading): #include <Control_Surface.h> // Include the Control Surface library
USBMIDI_Interface midi;
MCU::LCD<> lcd = {};
void setup() {
Control_Surface.begin(); // Initialize Control Surface
Serial.begin(115200);
}
void loop() {
Control_Surface.loop(); // Refresh all elements
Serial.println(lcd.getText());
} |
Opened the first song and it displayed this: Then opened a second one with this result: Then closed everything and opened the DAW with a different song: It matches the names and volume of the 3 songs like they are in the DAW. FYI: I edited the mackie files to only show the first 4 tracks to match my controller |
Ah, the reason is that your DAW doesn't separate the track names with spaces. Control-Surface/src/Display/MCU/LCDDisplay.hpp Lines 78 to 102 in 6fae919
If you just bypass the check and change the length from 6 to 7, it should work, but it's not too hard to just extract the interesting text fields from the getText method. |
Out of curiosity I opened Traction then I loaded a song and it showed the first 8 track names: Closed Traction, put back the original files for Studio one and loaded a song and it showed all 8 tracks and volume. Loaded my sketch, opened traction and the track names show on screen. Then closed it and opened Studio one... no names show. |
You can leave out this check (just delete those lines): Control-Surface/src/Display/MCU/LCDDisplay.hpp Lines 59 to 60 in 6fae919
And then change 7 to 8 and 6 to 7 in these lines: Control-Surface/src/Display/MCU/LCDDisplay.hpp Lines 68 to 70 in 6fae919
Edit: that shouldn't be a problem, from the Mackie Logic Control manual:
|
and getting the volume to display? Promise I won't bother you until Feb. LOL |
For the normal 8-track version, you would set Control-Surface/src/Display/MCU/LCDDisplay.hpp Lines 51 to 53 in 6fae919
In your case, however, I think it'll be on tracks 5 - 8 (on line 0). Excuse the inconsistencies in the numbering of the tracks and lines (tracks start at 1, lines start at 0), I didn't find the time yet to cleanup this part of the code, I'll probably change it in a later release. |
Thanks for all your time and help. I really appreciate it. |
Glad I could help :) |
STUCK! |
I should have been more clear: you don't have to edit anything related to lines in the LCDDisplay.hpp file. You just have to add the extra argument to the constructors in your sketch. Like this: // Track names and volumes
MCU::LCDDisplay lcddisps[] = {
// track (1), line(0), position (0, 40), font size (1)
{display_L, lcd, bank, 1, 0, {0, 40}, 1, WHITE},
{display_L, lcd, bank, 2, 0, {64, 40}, 1, WHITE},
{display_R, lcd, bank, 3, 0, {0, 40}, 1, WHITE},
{display_R, lcd, bank, 4, 0, {64, 40}, 1, WHITE},
// track (1), line(1), position (0, 50), font size (1)
{display_L, lcd, bank, 1, 1, {0, 50}, 1, WHITE},
{display_L, lcd, bank, 2, 1, {64, 50}, 1, WHITE},
{display_R, lcd, bank, 3, 1, {0, 50}, 1, WHITE},
{display_R, lcd, bank, 4, 1, {64, 50}, 1, WHITE},
}; Top 4 use line 0 (i.e. names), bottom 4 use line 1 (i.e. volumes). |
Thank you. works perfectly |
how do I do this if there's nothing in the folder. I'm getting an error when trying to compile. #ifndef DOXYGEN |
I reworked the structure of the documentation recently, I haven't updated the documentation for it yet. However, this has nothing to do with the compilation error you're getting. Did you change any of the code? Please post the full and exact error message. |
Followed instructions in README.md on how to add custom xbm files. used the script file and it created the axbm files and placed it with the others in the BITMAPS folder and created png files in the script folder. copied the png files into the DOXYGEN/images folder. Then opened my sketch, tried to compile it, haven't added any inputs or changed images. The errors listed below:
|
Most likely a Windows line ending issue (I use Linux for development). Try adding
axbm.write('#ifndef DOXYGEN\n'+contents+'\n'+'#endif\n') |
Here's the whole error message after editing the py file |
Could you zip and post the entire |
The issue is that your image editor saves the bitmaps as This should fix it: # Replace the existing identifier for the data array,
# change the type from (unsigned) char to uint8_t,
# and store it in PROGMEM
contents = re.sub(r'static (?:unsigned )?char [a-zA-Z_][a-zA-Z0-9_]*(_bits\[\] *= *{ *(?:0x[0-9a-fA-F]{2}, *)*}?;?) *',
r'static const PROGMEM uint8_t {}\1'.format(identifier), contents) |
Thanks, will try it when I get home. |
Hi ... HAPPY NEW YEAR! (Depending on when you read this message) Also, how do I add a Bitmap as a boot image (like the splash in the adafruit1306 example) with your implementation of the Adafruit library. |
This is what the DAW sens out on a channel change 90 00 00 (REC_RDY_1) |
That's certainly possible, and not too hard to implement, but I simply don't have the time right now to set up a test rig or debug a lot of code. Basically, you have to add a new class for receiving Pitch Bend messages. This will be almost the same as the Channel Pressure class.
Thanks, that'll come in handy for testing later. A Happy New Year! |
Hi |
To get the display splash screen working, add a Using multiplexers for the CS lines is not possible, because these lines are managed by the Adafruit_SSD1306 library, not Control Surface. You could of course edit the library's source. Analog multiplexers are not the right way to drive outputs though, it would be better to use shift registers. They can share an SPI bus with the displays. |
This will not compile here, is something outdated? |
I'm using your pichbend encoder example for 8 volume encoders, on teensy 4. Is it possible to have a "switch" or "bank" to change the function from pitchbend to control change so that I can control either volume and pan per channel... when you have a moment.
The text was updated successfully, but these errors were encountered: