Jump to content
Why become a member? ×
  • advertisement_alt
  • advertisement_alt
  • advertisement_alt

Build your own MIDI controller. (I did!)


stoo

Recommended Posts

58 minutes ago, DaveHx said:

Okok, thank you stoo, i checked every switch, every pin and every single wire, everything is fine, and now something changed, when I press the switch for change the page it work! But not the single switch 😮💨 but at the least something on the switchpin work! 

I noticed even something strange when I open Serial Monitor, "recvRetCommandFinished ok

 recvRetCommandFinished ok

 recvRetCommandFinished err" 

And  i don't understand what it means 😅

 

 

 

the "recvRetCommandFinished" messages look to be something that the Nextion library generates...  (see line 187 here - https://github.com/itead/ITEADLIB_Arduino_Nextion/blob/master/NexHardware.cpp) - looks like it's probably a message from the Nextion back to the Arduino to say that it's recieved a command and confirm it's completed it OK.

 

I'm not sure why the 3rd one reports an error - it doesn't give much information to go on - but the first two report as "ok"... so I would think the basic communication between your Arduino and Nextion is probably OK.

 

If your footswitches can change the page on the Nextion - then you've definitely got communication between the footswitches and the Arduino, as well as between the Arduino and Nextion..... so you're most of the way there now!

 

Next thing to investigate is the MIDI connection to the HX...

 

  • Thanks 1
Link to comment
Share on other sites

so, maybe, but maybe and i don't know yet,  i found the problem! i saw when i charge the sketch on Arduino this kind of message for every single midi message CC PC and other, but always on midi, soooo i think this errors can compromise the normal functioning of the midi side... so did you have any idea of how i can fix it? by the way i'm sure the midi connection are absoltely ok (wiring i mean), thank you man i am so really grateful for your help

error.png

ERRORS.png

Edited by DaveHx
Link to comment
Share on other sites

3 hours ago, DaveHx said:

so, maybe, but maybe and i don't know yet,  i found the problem! i saw when i charge the sketch on Arduino this kind of message for every single midi message CC PC and other, but always on midi, soooo i think this errors can compromise the normal functioning of the midi side... so did you have any idea of how i can fix it? by the way i'm sure the midi connection are absoltely ok (wiring i mean), thank you man i am so really grateful for your help

 

 

 

I don't think that'll be it.... 

 

It's a warning that I've sent a "string" type value as an argument to a function that has a "char*" type value as its parameter. This is something that used to be allowed - it didn't throw up any errors for me when I built my one 3 years ago. They've since changed the rules.... but I think this is still just a warning that can be ignored. Not totally certain - but I can't easily test with mine at the moment to confirm....

 

What you could do to test your MIDI output is to use some simpler code that tests only the MIDI output part... I think something like this should work... If it does, it will just change back and forth between 2 presets every second

 

#include <MIDI.h>

MIDI_CREATE_INSTANCE(HardwareSerial, Serial2, MIDI);

void setup() {
	MIDI.begin(MIDI_CHANNEL_OMNI); // Launch MIDI and listen to all incoming messages
	}

void loop() {
	if (MIDI.read()) // If we have received a message
	{
		MIDI.sendProgramChange(1, 1); // Send a PC1 on channel 1
		delay(1000); // Wait for a second
		MIDI.sendProgramChange(2, 1); // Send a PC2 on channel 1
		delay(1000); // Wait for a second
		}
	}

 

Link to comment
Share on other sites

On 04/03/2019 at 07:18, stoo said:

I should give credit to this page which got me started - https://www.instructables.com/id/Send-and-Receive-MIDI-with-Arduino/?fbclid=IwAR12ACoLLPoNWdAcU10XtLe20754FsPWR3Ffv_nYVFiUoo-TNrgJib0AnT4 

 

If you want to understand more about how it all works, it's a good place to begin.

I also got a fair bit from various pages on the arduino forum ( http://forum.arduino.cc/index.php ) which I didn't think to save as I went..

Is there a way in your code to set a couple of buttons to toggle?

Link to comment
Share on other sites

On 07/02/2023 at 23:30, stoo said:

 

I don't think that'll be it.... 

 

It's a warning that I've sent a "string" type value as an argument to a function that has a "char*" type value as its parameter. This is something that used to be allowed - it didn't throw up any errors for me when I built my one 3 years ago. They've since changed the rules.... but I think this is still just a warning that can be ignored. Not totally certain - but I can't easily test with mine at the moment to confirm....

 

What you could do to test your MIDI output is to use some simpler code that tests only the MIDI output part... I think something like this should work... If it does, it will just change back and forth between 2 presets every second

 

#include <MIDI.h>

MIDI_CREATE_INSTANCE(HardwareSerial, Serial2, MIDI);

void setup() {
	MIDI.begin(MIDI_CHANNEL_OMNI); // Launch MIDI and listen to all incoming messages
	}

void loop() {
	if (MIDI.read()) // If we have received a message
	{
		MIDI.sendProgramChange(1, 1); // Send a PC1 on channel 1
		delay(1000); // Wait for a second
		MIDI.sendProgramChange(2, 1); // Send a PC2 on channel 1
		delay(1000); // Wait for a second
		}
	}

 

it doesn't work yet even with this, noting changed, so i checked on nextion editor, maybe there's something wrong there, and i thinked my version of N.E. was the last so i checked again everything and the editor basically re arranged the code for the new versione, so a part the id he changed the program page as you can see on the screenshot, and so i wanted to ask you if was there another code or it's the same for you, maybe this is the error i have when i start the serial monitor! thank you stoo!

programs.png

Link to comment
Share on other sites

Those trinkets are great!

 

I do love an Arduino project. My latest is a foot controller for online presentations, controlling multiple cameras angles, camera sliders, teleprompt control, lighting controls, mute (of course!) bringing in graphics on screen (via key/fill) and stepping through presentations/infographics etc. Total tap dancing work out but it's pretty ace. One man band television studio! (But great for my online conference stuff - keeps my hands free (I do a lot of talking with my hands!)) 

  • Like 2
Link to comment
Share on other sites

1 hour ago, DaveHx said:

it doesn't work yet even with this, noting changed, so i checked on nextion editor, maybe there's something wrong there, and i thinked my version of N.E. was the last so i checked again everything and the editor basically re arranged the code for the new versione, so a part the id he changed the program page as you can see on the screenshot, and so i wanted to ask you if was there another code or it's the same for you, maybe this is the error i have when i start the serial monitor! thank you stoo!

programs.png

Ignore the nextion for now. You've already shown that you have that part working and communicating with the Arduino.

 

If you don't have the midi output part working correctly, any further testing with the nextion is impossible as you have no way of knowing if its doing anything. 

 

On my switcher, I can press the FS1,FS2,FS3 etc buttons on either the screen or the actual footswitches..... And if the midi cable is not correctly connected, nothing will happen. There is no visual indication on the screen to confirm the button press.

Link to comment
Share on other sites

Aaaah - just found a link to someone who has had some success decoding the usb communications between stomp and hx-edit. I think I saw them mention it before on Facebook but never saw any further details. There's a link to some stuff on GitHub and their demo with an FBV3 - https://line6.com/support/topic/60839-another-lockdown-project-talk-to-your-hx-stomp-over-usb/

 

Guess I might have to start work on a v3 controller with scribble strips and RGB footswitch LEDs....

  • Like 1
  • Haha 1
Link to comment
Share on other sites

yup but the electronic connection are ok even because i used the tra cable for the midi connection i checked the pin on the Midi connector and everything is ok, i put the 220 ohm resistor on 5 volt and 220 on tx cable so for this reason i was thinking there was a problem with the screen cause is the only different thing from your project 🥴 and i mean i made a switcher before with the ssd1306 and it worked a lot! 🙄 but just for ask, on serial monitor here on arduino IDE i don't have the possiility to check if it work?

 

7 hours ago, stoo said:

Ignore the nextion for now. You've already shown that you have that part working and communicating with the Arduino.

 

If you don't have the midi output part working correctly, any further testing with the nextion is impossible as you have no way of knowing if its doing anything. 

 

On my switcher, I can press the FS1,FS2,FS3 etc buttons on either the screen or the actual footswitches..... And if the midi cable is not correctly connected, nothing will happen. There is no visual indication on the screen to confirm the button press.

Link to comment
Share on other sites

12 hours ago, DaveHx said:

yup but the electronic connection are ok even because i used the tra cable for the midi connection i checked the pin on the Midi connector and everything is ok, i put the 220 ohm resistor on 5 volt and 220 on tx cable so for this reason i was thinking there was a problem with the screen cause is the only different thing from your project 🥴 and i mean i made a switcher before with the ssd1306 and it worked a lot! 🙄 but just for ask, on serial monitor here on arduino IDE i don't have the possiility to check if it work?

 

I don't understand why you are so confident that you've got everything correct with the midi output.... If that was the case, then the simple midi output test sketch I posted should change presets on your HX.....

 

Been a while since I used serial monitor, and i only used it on the default serial port.... Arduino Mega has several, so you may need to change the monitor to the one used for the midi output... Not sure if that's possible - not in front of a computer to check

Link to comment
Share on other sites

14 hours ago, stoo said:

I don't understand why you are so confident that you've got everything correct with the midi output.... If that was the case, then the simple midi output test sketch I posted should change presets on your HX.....

 

Been a while since I used serial monitor, and i only used it on the default serial port.... Arduino Mega has several, so you may need to change the monitor to the one used for the midi output... Not sure if that's possible - not in front of a computer to check

Sooo, i checked again everything on the circuit, even i re make all the connection on the board, TX2  with 220 ohm resistor goes on pin n5 ground on pin n 2 and 5v with 220 ohm resistor goes on pin n4 but nothing happen yet... i'm totally confused, maybe because i use the usb to turn on the switcher? (Not conmected on the pc but only to a normal usb smartphone charger i mean!) 

Screenshot_20230212_012125_Google.jpg

Link to comment
Share on other sites

On 10/02/2023 at 11:38, DaveHx said:

it doesn't work yet even with this, noting changed, so i checked on nextion editor, maybe there's something wrong there, and i thinked my version of N.E. was the last so i checked again everything and the editor basically re arranged the code for the new versione, so a part the id he changed the program page as you can see on the screenshot, and so i wanted to ask you if was there another code or it's the same for you, maybe this is the error i have when i start the serial monitor! thank you stoo!

programs.png

 

If the baud rate is controlling the MIDI port baud rate, it's wrong. Needs to be 31250.

Link to comment
Share on other sites

Nope, the baud rate on this screen shot refer on the nexSerial to comunicate with arduino, but there's another baud rate on set up serial.begin(250000) 

15 hours ago, tauzero said:

 

If the baud rate is controlling the MIDI port baud rate, it's wrong. Needs to be 31250.

 

Link to comment
Share on other sites

Oh god yessss it work 🥳🥳🥳🥳🥳 i don't know even what I do 😆 just makes all the ground again 🫣 thanks for everybody gives me help 🥳🥳🥳🥳 i just only have one question, how i can use the other two pages? Just because I want to use a relay for switch the od on or bypass, but really thank youuuu🤩🤩🤩🤩

  • Like 1
Link to comment
Share on other sites

48 minutes ago, DaveHx said:

Oh god yessss it work 🥳🥳🥳🥳🥳 i don't know even what I do 😆 just makes all the ground again 🫣 thanks for everybody gives me help 🥳🥳🥳🥳 i just only have one question, how i can use the other two pages? Just because I want to use a relay for switch the od on or bypass, but really thank youuuu🤩🤩🤩🤩

 

Nice one! Frustrating that you don't know exactly what the issue was - hopefully just a loose connection that needed to be reseated.

 

What's the issue with the other pages? Sorry - I don't understand your question.....

  • Thanks 1
Link to comment
Share on other sites

5 hours ago, stoo said:

 

Nice one! Frustrating that you don't know exactly what the issue was - hopefully just a loose connection that needed to be reseated.

 

What's the issue with the other pages? Sorry - I don't understand your question.....

sorry, maybe was the euphoria of the moment 😆 i just want to go on the other two NexPage(program_page and Other_Page) , but i see here i can change only the menu on the main page with the switch, i need to push the combo for the Macro, right? again thank you stoo for you patience 😁

Link to comment
Share on other sites

On 13/02/2023 at 01:28, DaveHx said:

sorry, maybe was the euphoria of the moment 😆 i just want to go on the other two NexPage(program_page and Other_Page) , but i see here i can change only the menu on the main page with the switch, i need to push the combo for the Macro, right? again thank you stoo for you patience 😁

Ah ok I see... The extra pages in the Nextion file were just a placeholder for future functionality that I intended to implement. I had initially planned to make everything re-programmable from the touchscreen without needing the computer......

But once I got the first prototype built and working, I found I didn't need to reconfigure the pages and so didn't do any more work on that functionality.

Link to comment
Share on other sites

13 hours ago, stringvelocity said:

How would I go about making a button or buttons programmable?

That would require some extra code to be written to support it.... As mentioned above, I had originally intended to, but found I didn't need it.... And so that part never got finished.

Feel free to have a go though!

Link to comment
Share on other sites

  • 3 weeks later...
On 14/02/2023 at 08:24, stoo said:

That would require some extra code to be written to support it.... As mentioned above, I had originally intended to, but found I didn't need it.... And so that part never got finished.

Feel free to have a go though!

How would you code 2 led lights instead of a screen to indicate page one or two?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...