Giter VIP home page Giter VIP logo

Comments (9)

tttapa avatar tttapa commented on May 24, 2024

Changing noteNames doesn't change the addresses of the buttons.

I think what you need is the ManyAddresses::NoteButton.
That's the best way to do it if you need arbitrary addresses.

If you just want to transpose everything by the same amount of semitones, it's best to use the Bankable::NoteButton class combined with a Transposer.

from control-surface.

AngleCreDible avatar AngleCreDible commented on May 24, 2024

Can you show me some examples of ManyAddresses::NoteButton?

from control-surface.

AngleCreDible avatar AngleCreDible commented on May 24, 2024

In addition, Is it possible to make when you press button 1, you increase one octave, when you press button 2, you go one octave down, when you press button 3, you can change the major order (F-C-G-D-A-E-B to Gb-Db-Ab-Eb-Bb-Fb-C), when the button 4 is pressed, return the majors in order?
(sorry this is translated comment, so it can be strange.)

from control-surface.

tttapa avatar tttapa commented on May 24, 2024

Sure, basically, you create a custom class that has a lock, unlock and getActiveAddress method.

Lock and unlock ensure that the note number doesn't change while the button is pressed (otherwise the note off event will be sent to a different address, leaving the original note playing forever).

GetActiveAddress returns the right address, in your case, the address of the right note (F or Gb) plus or minus one octave.

ManyAddresses is a class that handles a list of alternative addresses, and BankableMIDIOutput is a class that adds an offset to a given address, so both are combined:

https://github.com/tttapa/Control-Surface/blob/8ebcc4dcfecbc6c002e3e57be6c85a85973fe2d3/examples/Other/GitHub-issues/Note-ManyAddresses-Transposer/ManyAddressBankNoteButton.hpp

Then you just pass it as the first template argument to the Bankable::MIDIButton class.

It looks scary, but it's all just glue between existing classes. You probably don't have to change that file.

What you do have to change is the note numbers etc. in the main sketch:
https://github.com/tttapa/Control-Surface/blob/8ebcc4dcfecbc6c002e3e57be6c85a85973fe2d3/examples/Other/GitHub-issues/Note-ManyAddresses-Transposer/Note-ManyAddresses-Transposer.ino

from control-surface.

AngleCreDible avatar AngleCreDible commented on May 24, 2024

That looks really nice, I'll try it.
I really love you and this library!

from control-surface.

tttapa avatar tttapa commented on May 24, 2024

Oh, by the way, if you're not seeing any MIDI output, that could be because the sketch uses a USBDebugMIDI_Interface, it prints the MIDI message in a readable format to the serial monitor. You can change it to a USBMIDI_Interface if you want.

from control-surface.

AngleCreDible avatar AngleCreDible commented on May 24, 2024

Can I ask one more question?
When there is a Bank , is it possible to press the button to go to the last bank and press the button again to return to the previous bank?

from control-surface.

tttapa avatar tttapa commented on May 24, 2024

Not sure what you mean.

The Bank class has a select method that you can call directly: https://tttapa.github.io/Control-Surface/Doc/Doxygen/db/dbd/classBank.html#ab4b91b7f4363e5e497b34e17a303bdbb

There are some included Selectors that can manage a Bank, based on the input from push buttons or rotary encoders etc. https://tttapa.github.io/Control-Surface/Doc/Doxygen/d0/d0c/group__Selectors.html

from control-surface.

AngleCreDible avatar AngleCreDible commented on May 24, 2024

It works very nice, thanks!

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.