MIDI command set by VST program

Hello arduino forum

I am completely new to Arduino and Teensyduino.
But I have a question about midi command sending.
I am currently in preparation of making a midi controller, mainly for use in Deckadance. In Deckadance there is a midi setup tab. In that tab there is a huge list of all midi options that are executed BY THAT PROGRAM. While programming arduino you can only say to execute a command, like playing a midi note, but I would like to execute a function that was set by Deckadance. There is something with MIDI LEARN and MIDI FORGET, but as far as I have thought, you have to press a button on your MIDI controller and it recognizes that it is a MIDI controller. That's my problem; how does it do that? I use keymatrix so there have to be 2 signals active for a command. Isn't there a function that is something like

midi_execute_command(cnum)
and that the program only needs a number?

ps: it is not just buttons, it is also encoders, potentiometers and switches

I hope someone can help me

thanks in advance,

masteRens :slight_smile:

OK first off welcome.

next don't assume that everybody knows about the equipment you are using. please provide links so we can check out what they are.
Links to:-
Teensyduino
Deckadance
keymatrix
would have helped me try and understand what you were talking about.

Basically the arduino can do anything with MIDI providing you program it to do so.

It sounds like you want it to record a sequence of MIDI events and then replay them but I am not sure.

I'm struggling to understand what is you're trying to do.

Midi learn works by remembering the MIDI command sequence that is received after the "learn" button is pressed. I'm not sure you need to be worrying about this.

You want to break your functions up into those that go from controller -> host (Deckadance) and those that go host -> controller.

Midi messages are just signals (not functions)... like words in a way. If I tell you to "jump" then me saying it doesn't make you do it. You need to process the message and relate that to the function which your legs do to lift you off the ground.

thank you both for your replies

I will try to explain:

Teensy is a circuit board that has direct connection by usb (not serial)
Teensyduino is Arduino with pre-set constants for Teensy use. It can be found on:
pjrc.com or google: teensy

Deckadance is just a program that needs to recieve the commands. It has MIDI LEARN function which I want to use.
Deckadance is an Image-Line product, like FL-Studio

Key Matrix is not software and there is no link to it. It is a technique that is based on signal combination.

I will ascipaint it:

[A]
```c
**    |   |   |
   x---x---x---[1]
   |   |   |
   x---x---x---[2]
   |   |   |
   x---x---x---[3]

[/font]
I only used 6 pins for 9 buttons. This technique of combinations is called Key Matrix. When using more wires many more buttons are possible.

What I am trying to accomplish is not to execute a midi command that I decide, but what is decided with MIDI LEARN. As far as I have seen you have to say that you want to make a note or effect, but I want the user to be able to set it with MIDI LEARN.

Does someone know some not-too-complicated functions or commands for that?

Thanks in advance,
masteRens :)**
```

You're still not doing a great job of explaining this so will have to correct me if this is wrong.

  • You have a controller which will send MIDI messages (e.g. note on) to Deckadance?
  • You want Deckadance to be able to teach the controller which messages to send (i.e. setup pad 1 to send C4. Then everytime pad 1 is hit, the controller sends the note C4)?

So you're asking how you can make your Arduino program "learn" a midi sequence (or nine of them)?

This technique of combinations is called Key Matrix.

No it's not it is called "a scanning key matrix". Each key needs a series diode if it is to cope with more than one key at once.

Deckadance is software it would have helped if you would have posted something like this:-

So you are saying that this software has a MIDI learn function you want to use. It would appear that it (Deckadance) is the thing that does the learning. So it would just be a matter of putting it into learn mode and firing MIDI commands at it.
This is a totally opposite interpretation of what you want to do than Eight reached.
So which is correct? Then when we know what you want to do maybe we can come up with some suggestions as to how you can do it.

“If I had an hour to save the world I would spend 55 minutes defining the problem and 5 minutes finding solutions”
-Einstein

Edit: Sorry, I think he said 55 minutes not 59 minutes so I changed that. :smiley:

thank you both for your replies

I am building a MIDI Controller which I will program myself (Using a Teensy Circuit Board and Arduino programming language)
But as far as I have seen this is possible:

from another post on this forum:
...
}else if ( (action==0)&&(note==0) ){ // if we received a "note off", we wait for which note (databyte)
note=incomingByte;
playNote(note, 0);
note=0;
velocity=0;
action=2;
...

Do you see? It says: Play a note
not:

Do what MIDI LEARN tells you to do

I am trying to make the button/slider/encoder/pot do nothing unless MIDI LEARN gives it a function

Thanks in advance,

masteRens :slight_smile:

I think you've completely misunderstood what MIDI Learn is all about.

Edit: To be slightly more helpful - it is called "MIDI Learn" not "MIDI Teach". Using the Learn feature of Deckadance will teach Deckadence how to respond to inputs, NOT the Arduino.

yes, but if I do not do anything the pc doesnt know it is has to recognize the signal. for example keyboard keys cannot be assigned in MIDI LEARN
So how do I let it be recognized as available options for MIDI LEARN is my question

I hope it is understandable now,

thanks in advance,
masteRens :slight_smile:

No, it isn't. You seem to have switched to a completely different problem altogether. :slight_smile:

Keyboard (as in piano keys) absolutely CAN be assigned to control functions in most host sequencers. If this is the core issue you're having, then you need to read the Deckadance manual. I don't know that software itself -- but have been a sequencer user for many years. Primarily Sonar these days.

For instance, aside from keyboards, my Akai MPD trigger pad unit is actually sending notes. No different from the ones sent by my digital piano.

thank you for your reply

this one I can hint short:

I ment PC Keyboard

I think HID cannot be assigned in MIDI LEARN, but I am not sure the PC even notices its there if it isnt

There are a few packages which can "learn"/trigger from things like PC keyboards; and a few other bits of software which can emulate a MIDI port and allow you to this (and more besides). Might be worth playing with at some point.

But for your project, what you probably want to do is create an Arduino-based device which sends MIDI Note On/Off messages initially. The easiest way will be use a MIDI din plug for your output and connect that to a MIDI in device on your computer.

Your controller just needs to send a unique note for each pad. Then in your music software you will be able to use the MIDI Learn to control functions depending on the note that was sent.

The important thing to realise is that the MIDI Learn function doesn't tell the controller to do anything different; it tells the software how to respond to the note that it receives. Although some device drivers let you re-program the notes, this isn't something you need to worry about yet.

When you have that working - you can expand it a bit to deal with (for example) different MIDI channels and pass-through etc.

Would love to see some pics of your controller as you progress.

thank you for your reply.

Sending notes is completely the opposite of what I want my MIDI controller to do: modify chanels + some extra things
But as far as I understand you:

A note is hearable, but if you send a note that you dont want to hear and program MIDI LEARN over that note you cant hear it, but it has the function you learned it

Is that right?

How does that work with encoders and pots then?

PS: Does anyone know how to use MIDI learn for virtual deck vynil? It is not in the list in Deckadance... not the main point at the time, but I will need it in the end

A MIDI note is only audible if the thing on the receiving end chooses to make it so.

In the case of sequencers/MIDI hosts - they can opt to say "any C#4 from the device plugged into port x, toggle switch z". That's part of what the MIDI Learn function does.

My first Arduino project was a MIDI-powered footswitch. It sent a Eb note on/off message which was mapped to the state of an effect in Guitar Rig.

Pots/Faders etc. can work the same way (using, for example, the 'volume' of the note to determine value - and depending on the capabilities of the software on the receiving end) but many would probably use a MIDI Control Change message instead. General MIDI - Wikipedia
Or even a SysEx message.

Personally, I'd suggest you try with basic buttons (e.g. to trigger samples in something like Battery/Kontakt etc.) and MIDI notes. Then change your code to use Control Changes once you're happy you've got the hang of everything.

BTW Something like this could be interesting/useful

(If your software doesn't let you monitor incoming MIDI messages directly).

Then, if you have any controllers already, you could spy in and see what kind of messages etc. they send when you twiddle knobs etc.

thank you for your response
On your site I found that MIDI commands besides note on and note off (which I believe was included in the lib) there are also Control Change, Program Change, Pitch Bend, Aftertouch and all that stuff. Has Control Change anything to do with MIDI LEARN? Because with MIDI LEARN examples I always see CC #number and CC=Control Change I believe
If this is what I need, how do I pass it through my usb cable? I believe I can only use Note on and off in the lib, but if it is possible to do it a different way I would really like to know

Thanks in advance,
masteRens :slight_smile:

MIDI Learn can usually learn from any message type.

I've never used or looked at the library so I can't say about using them from that. But it's certainly easy enough to send CCs etc. etc. from an Arduino if you were doing it all yourself.

(The link I posted wasn't my site btw. Just something I bookmarked a while ago).

thank you for your reply
Now that I understand MIDI LEARN and I just need to find out how to send different MIDI signals, I was asking myself (and my pc) how I could make vinyl at my MIDI Controller. It seems not to work with MIDI LEARN, because it is not responding to MIDI signal. It has something to do with Timecode i know, but I would like to know the signal it is sent in, so I can send it too. I want to send the computer my current speed. PS: It might have something to do with Input Thru or something similar

PS2: Just found out: What I want is a USB CDJ