Giter VIP home page Giter VIP logo

Comments (21)

tttapa avatar tttapa commented on May 24, 2024

Hi,
The RotaryEncoder class has been renamed to CCRotaryEncoder.
The interface has been changed as well, you can find the documentation for it here:
https://tttapa.github.io/Control-Surface/Doc/Doxygen/d3/d62/classCCRotaryEncoder.html

My apologies for the lack of proper examples or better documentation, the library has gotten really huge, and I have to find ways to combine working on it with my studies.

from control-surface.

masydoblig avatar masydoblig commented on May 24, 2024

from control-surface.

tttapa avatar tttapa commented on May 24, 2024

I'm in Belgium, it's 11:11 am here, no worries :)

from control-surface.

masydoblig avatar masydoblig commented on May 24, 2024

i have tried everything to get the rotary encoder working with no luck

either i have the incorrect encoder.H library or i am writing the code incorrect to create a new instance of CCRotaryEncoder

any help with an example would be greatly appreciated

also in the MCU protocol what midi message is it sending out for the VU meters

image

im hoping i can just send the midi data from cubase (which i can set the type of midi message on) to the controller and get the vu on a shift register working

from control-surface.

tttapa avatar tttapa commented on May 24, 2024

I added a rotary encoder example: https://tttapa.github.io/Control-Surface/Doc/Doxygen/d3/d15/CCRotaryEncoder_8ino-example.html

also in the MCU protocol what midi message is it sending out for the VU meters

It uses MIDI Channel Pressure events: the high nibble of the data byte is the track (0-7) and the low nibble is the value (0x0-0xC) or clear overload (0xF) or set overload (0xE). 0xD has no meaning.

from control-surface.

masydoblig avatar masydoblig commented on May 24, 2024

ok looking at the code you have put up it i would have to use the mcu mapping
is there any way for me to set specific channels and addresses like we could before?
so i can use the generic mapping in cubase

RotaryEncoder encoder(2, 3, 0x14, 1, speedMultiply, NORMAL_ENCODER, TWOS_COMPLEMENT);// comes through as a controller on channel 1,address 20

or has this all changed?

i.e.

CCRotaryEncoder enc ={
{2, 3},
MIDI_CC::Pan, CHANNEL_1,
1,
4,
};

The Reason for me to do this is i can do alot more through the generic program function in cubase
even create banks and flip modes

from control-surface.

masydoblig avatar masydoblig commented on May 24, 2024

this code below works

CCRotaryEncoder enc ={
{2, 3},
MIDI_CC::Pan,
1,
4,
};

it functions well and comes though to cubase on Channel 1 address 10

but i cant change channel number

from control-surface.

tttapa avatar tttapa commented on May 24, 2024

You have to add curly braces, the address is a single parameter:

CCRotaryEncoder enc ={
  {2, 3},
  {MIDI_CC::Pan, CHANNEL_1},
  1,
  4,
};

https://tttapa.github.io/Control-Surface/Doc/Doxygen/d3/d10/classMIDICNChannelAddress.html#a20a349458b4401d584e9ee713be0a8dc

from control-surface.

masydoblig avatar masydoblig commented on May 24, 2024

Using the generic controller function is also why i was asking about the vu meters

when i set it to a Mackie controller in cubase my Vu meter works
but i cant set a specific channel and address in the code to use with the generic controller

from control-surface.

masydoblig avatar masydoblig commented on May 24, 2024

image

from control-surface.

masydoblig avatar masydoblig commented on May 24, 2024

Ok that makes sense
it compiles now

you are an awesome dude

How did you go with finding some Arduino Nano Boards to test out your faders????

from control-surface.

tttapa avatar tttapa commented on May 24, 2024

when i set it to a Mackie controller in cubase my Vu meter works
but i cant set a specific channel and address in the code to use with the generic controller

Could you check what kinds of messages Cubase sends? The easiest way is to use a MIDI monitor on you computer, alternatively, enable debugging information in Settings.hpp: uncomment lines 17 and 19.

How did you go with finding some Arduino Nano Boards to test out your faders????

I started working on it, but I don't have the right hardware here right now.

from control-surface.

masydoblig avatar masydoblig commented on May 24, 2024

Can you suggest a MIDI monitor to try

i have midi ox installed but it wont get anything from cubase

Feel free to Face time me on [email protected] so you can see it all

from control-surface.

tttapa avatar tttapa commented on May 24, 2024

I use MIDI Snoop on Linux, but any monitor that runs on your platform should work.

Edit: it seems that the MIDISnoop domain has expired, and is now just spam. It's still in the repositories though: https://packages.ubuntu.com/bionic/sound/midisnoop

from control-surface.

masydoblig avatar masydoblig commented on May 24, 2024

hmmmmm i tried the debug but it wouldnt compile and just had errors

and for some reason the midi monitor wont connect when cubase is running

from control-surface.

tttapa avatar tttapa commented on May 24, 2024

Did you pull the latest version of the library?

from control-surface.

masydoblig avatar masydoblig commented on May 24, 2024

yep yesterday

from control-surface.

tttapa avatar tttapa commented on May 24, 2024

I pushed another change this morning, that should have fixed the debug issues.

Did you install the library using git? https://tttapa.github.io/Control-Surface/Doc/Doxygen/d4/d6d/md_Installation.html
In that case, you can just do git pull to update to the latest version.

from control-surface.

masydoblig avatar masydoblig commented on May 24, 2024

i have just downloaded the new version
it compiles
and i have put the USBDebugMIDI_Interface into the code but it doesnt seem to do anything
still works as a controller though

i might have to give up for the night,
have good day pete

Here is what i have so far

#include <Encoder.h>
#include <Control_Surface.h>

// Instantiate a MIDI over USB interface.
USBMIDI_Interface midi;

USBDebugMIDI_Interface midiInterface(115200);

const pin_t dataPin = 12; // Pin connected to DS of 74HC595
const pin_t clockPin = 13; // Pin connected to SH_CP of 74HC595
const pin_t latchPin = 10; // Pin connected to ST_CP of 74HC595

// Create a new shift register output connected to pins 12, 13 and 10,
// shift the data out with the most significant bit first.
// There are 8 outputs in total.
ShiftRegisterOut<12> sr(dataPin, clockPin, latchPin, MSBFIRST);

Channel channel = CHANNEL_1;
// Note: a VU meter of 12 LEDs will give the best effect, because
// in the MCU protocol, there are 12 values
MCU::VULEDs<12> vu = {
{0x01, channel},
{{
sr.pin(0),
sr.pin(1),
sr.pin(2),
sr.pin(3),
sr.pin(4),
sr.pin(5),
sr.pin(6),
sr.pin(7),
sr.pin(8),
sr.pin(9),
sr.pin(10),
sr.pin(11),
}},
150, // decay time in milliseconds or MCU::VU::NO_DECAY
};

// Create a new instance of the class CCPotentiometer, called potentiometer,
// on pin A0, that sends MIDI messages with controller 7 (channel volume)
// on channel 1.
CCPotentiometer potentiometer(A0, {MIDI_CC::Channel_Volume, CHANNEL_1});

CCRotaryEncoder enc = {
{2, 3},
{MIDI_CC::Pan, CHANNEL_1},
1,
4,
};

using namespace MIDI_Notes;

// Instantiate the momentary push buttons that send out MIDI Note events.
NoteButton buttons[] = {
{22, {note(C, -1), CHANNEL_1}},
{23, {note(Db, -1), CHANNEL_1}},
{24, {note(D, -1), CHANNEL_1}},
{25, {note(Eb, -1), CHANNEL_1}},
{26, {note(E, -1), CHANNEL_1}},
{27, {note(F, -1), CHANNEL_1}},
{28, {note(Gb, -1), CHANNEL_1}},
{29, {note(G, -1), CHANNEL_1}},
{30, {note(Ab, -1), CHANNEL_1}},
{31, {note(A, -1), CHANNEL_1}},
{32, {note(Bb, -1), CHANNEL_1}},
{33, {note(B, -1), CHANNEL_1}},
{34, {note(C, 0), CHANNEL_1}},
{35, {note(Db, 0), CHANNEL_1}},
{36, {note(D, 0), CHANNEL_1}},
// If you want to set the channel specifically, you can use:
// {2, {note(C, 4), CHANNEL_1}},
};

MIDINoteLED leds[] = {
{40, {note(E, 2), CHANNEL_1}},
{41, {note(F, 2), CHANNEL_1}},
{42, {note(Gb, 2), CHANNEL_1}},
{43, {note(G, 2), CHANNEL_1}},
{44, {note(Ab, 2), CHANNEL_1}},
{45, {note(A, 2), CHANNEL_1}},
{46, {note(Bb, 2), CHANNEL_1}},
{47, {note(B, 2), CHANNEL_1}},
{48, {note(C, 3), CHANNEL_1}},
{49, {note(Db, 3), CHANNEL_1}},
{50, {note(D, 3), CHANNEL_1}},
{51, {note(Eb, 3), CHANNEL_1}},
{52, {note(E, 3), CHANNEL_1}},
{53, {note(F, 3), CHANNEL_1}},
};

void setup() {
// Initialize everything
Control_Surface.begin();
}

void loop() {
// Update the Control Surface (check whether the potentiometer's
// input has changed since last time, if so, send the new value over MIDI).
Control_Surface.loop();
}

from control-surface.

tttapa avatar tttapa commented on May 24, 2024

Keep the USBMIDI_Interface, don't use the debug interface, just enable debugging in Settings.hpp, see the link in a previous reply: #13 (comment)

Then open the Serial monitor and check the incoming messages (prefixed with >>>).

from control-surface.

masydoblig avatar masydoblig commented on May 24, 2024

all good close this issue if you want as the encoder is working well
i will start a new one for debugging

from control-surface.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.