USB MIDI

  • still: maybe on the other board the contrast voltage is provided in another way?

    I'd double-check the contrast voltage, and rhe way it is provided.

    if i connect the screen to pins 2 and 3, the screen works normally (just testing with a "hello world" for now, i can edit the text and it shows properly) it's just i already have those pins used by the controller's switches and i don't know if i can edit the code so the screen uses pins 0 and 13 for example (those are the ones i have free at the moment).

    EDIT: i ended up changing the controller pins to 0 and 13 and editing the code, not sure if the 2 and 3 pins as SCL and SDA are hardcoded, time to start trying to understand how nrpn works ;( :D

    Edited once, last by Erikcb (May 11, 2024 at 9:18 PM).

  • 3 hours in, i'm not understanding a single thing and it's driving me crazy hahahahaha

    i don't even know how to add nrpn to my code (not even gonna talk about sending them via usb :D)

    i don't even know what the format of the nrpn commands is, or how to add it to my arduino c++ code

    this might be harder than i thought hahahah

  • Just got the board and a cheap 16x2 screen, i'm doing some testing.

    So far i can't even make the screen work within the controller (not even using a simple "hello world" print code) it lights but there are no letters, just black squares.

    The weird thing is that when i tried it without the rest of the cables it worked, and if i try it with the old arduino uno board it also works, i'm trying to figure out what could be the problem, but i have no idea so far...

    I didn't even start with nprn or anything yet.

    make sure you are addressing the screen correctly and your code is configured for that type (ie 16x2) You may find that your code needs a tweak depending what outputs you are using, whether you are using an IC2 between the arduino and screen and a few other factors. Go search several LCD-to-arduino codes examples and see how they vary.

    its very satisfying to have built your own midi controller and certainily allows you to do exactly what you want. But it can come at the cost of mental-stress and, obviously the time-cost. After all the controller i have made and used (and gigged with) i have chosen to use an off-the-shelf device for my Kemper player at present.

  • make sure you are addressing the screen correctly and your code is configured for that type (ie 16x2) You may find that your code needs a tweak depending what outputs you are using, whether you are using an IC2 between the arduino and screen and a few other factors. Go search several LCD-to-arduino codes examples and see how they vary.

    its very satisfying to have built your own midi controller and certainily allows you to do exactly what you want. But it can come at the cost of mental-stress and, obviously the time-cost. After all the controller i have made and used (and gigged with) i have chosen to use an off-the-shelf device for my Kemper player at present.

    Yea, i managed to make it work, it's just i had to use pins 2 and 3 and they were already used by the controller, but the sxreen is working now (at least showing basic text).

    Now i gotta figure out how to send/receive nrpn, i worked on it 3/4 hours yesterday and i still don't even know how to add them to my code (if i have to use "MIDI.sendControlChange" (i've read that nrpn is basically 4 CCs) and send the 4 CCs at the same time, or i gotta use MidiUSB.sendMIDI or send(SystemExclusive or what))

    I know the theory, you gotta check what you want to send, and calculate MBR and LSB, it's just i have no clue how to implement it on my code, i can't find any code example or anything anywhere, no idea what functions i gotta add or anything, kinda weird i couldn't find any example of a proper code here in the forum.

    I find explanations on what NRPNs are, but nothing on how to implement it or anything.

  • Yea, i managed to make it work, it's just i had to use pins 2 and 3 and they were already used by the controller, but the sxreen is working now (at least showing basic text).

    Now i gotta figure out how to send/receive nrpn, i worked on it 3/4 hours yesterday and i still don't even know how to add them to my code (if i have to use "MIDI.sendControlChange" (i've read that nrpn is basically 4 CCs) and send the 4 CCs at the same time, or i gotta use MidiUSB.sendMIDI or send(SystemExclusive or what))

    I know the theory, you gotta check what you want to send, and calculate MBR and LSB, it's just i have no clue how to implement it on my code, i can't find any code example or anything anywhere, no idea what functions i gotta add or anything, kinda weird i couldn't find any example of a proper code here in the forum.

    I find explanations on what NRPNs are, but nothing on how to implement it or anything.

    for the Kemper, just send four CC messages in your arduino (often easier than attempting to implement NRPN which i dont see much of in the arduino midi-libraries. You can find the values in the Kemper midi-spec without having to calculate the actual NRPN, (which if i recall from memory is MSB*128 + LSB.

    I have an "older" list that covers most NRPN values, page 3, here https://greendog.co.uk/kemper/kemper-midi-data.pdf You can get the MSB and the LSB. Just need to work out the parameter value (which i cant comment on) other than the range is a 14-bit value (so 127 midi is 16383, and half-way midi 64 is

    8192)

    Apologies if i'm telling you stuff you already know! :P


    little example of NRPN conttrol

    Set rig-volume to +3dB

    CC 99 = 4, CC 98 = 1, CC 6 = 80, CC 38 = 0

    This equates as-

    NRPN Parameter address: MSB = 4, LSB = 1 (the Rig volume parameter)

    NRPN Parameter value: MSB = 80, LSB = 0 (a value of +3dB) this could also be a different value between -6dB to +6dB (or whatever the full-range of this parameter is

    additionally, you may want this midi data too:

    Reset rig-volume to +0dB

    CC 99 = 4, CC 98 = 1, CC 6 = 64, CC 38 = 0

  • I think i'm starting to get closer (even tho i don't fully understand the way to get the values, like how do you know that MSB=80 is going to be +3dB? )

    I managed to send nrpn to the pc and apparently it's recognising them properly (this one turns on/off the amp).

    Is there a way to switch between rigs in performance mode via nrpn? i can't find it in the nprn values...

    But as soon as i connect it to the front USB of the kemper it does nothing but making the kemper freeze, so i have to turn it off and on again no idea why.

    This is the code i'm using for testing (as i said i barely have programming knowledge, so i'm figuring out stuff by myself).

    I also tried 115200 as baud rate.

    Also, i tried that nrpn via midi cable (using my old code) and it turns the amp on and off without problem, i tried the volume one and it also works via midi and via usb the pc is recognising it.

    It just when i connect it to the frontal USB of the kemper it does nothing but freezing the kemper...

    EDIT: I just noticed the kemper freezes as soon as i plug the arduino in the front USB ||

  • This is the code i'm using for testing (as i said i barely have programming knowledge, so i'm figuring out stuff by myself).

    I also tried 115200 as baud rate.

    The standard for midi (not USB midi) is a baud rate of 31250 so that must be adhered to

    how do you know that MSB=80 is going to be +3dB? )

    this is the bit that i initially figured out with trial-and-error rather than an educated approach.

    The "proper way" would be to find the range of that parameter, in this case -6db to +6db where 0dB is mid-way, therefore a full-scale range of 12

    divide the NRPN range 16383 into 12 = 1365 per dB step (could be taken as smaller steps if you want 0.1dB resolution) then to get the values

    1365 x 6 = 8192 (0dB setting) then divide by 128 for the MSB value which = 64 ( i've lost the LSB value somewhere there...)

  • The standard for midi (not USB midi) is a baud rate of 31250 so that must be adhered to

    I already tried with 31250 but the kemper still freezed, i have no idea why

    Quote from slateboy

    this is the bit that i initially figured out with trial-and-error rather than an educated approach.

    The "proper way" would be to find the range of that parameter, in this case -6db to +6db where 0dB is mid-way, therefore a full-scale range of 12

    divide the NRPN range 16383 into 12 = 1365 per dB step (could be taken as smaller steps if you want 0.1dB resolution) then to get the values

    1365 x 6 = 8192 (0dB setting) then divide by 128 for the MSB value which = 64 ( i've lost the LSB value somewhere there...)

    That's actually easier than i thought, thanks.

  • here's a nice bit of bedtime reading on the subject:

    jimosity
    December 14, 2023 at 4:55 AM
  • I already tried with 31250 but the kemper still freezed, i have no idea why

    Have you got some kind of midi monitor device? Worth checking if there is any unwanted midi data or other noise getting sent that is not required. or perhaps it is sending/getting incomplete midi messages?

    Or maybe (as i have had in the past) the ardiuno is stalling and not sending out a steady/even flow of midi data. I found that constantly updating the screen on the arduino LCD takes a lot of processing-power that affects midi transmission and better to update the display only when needed, ie a change of data. Therefore the priority is prioritising midi data flow rather than a visual.

  • Have you got some kind of midi monitor device? Worth checking if there is any unwanted midi data or other noise getting sent that is not required. or perhaps it is sending/getting incomplete midi messages?

    Or maybe (as i have had in the past) the ardiuno is stalling and not sending out a steady/even flow of midi data. I found that constantly updating the screen on the arduino LCD takes a lot of processing-power that affects midi transmission and better to update the display only when needed, ie a change of data. Therefore the priority is prioritising midi data flow rather than a visual.

    This are two different midi monitors (software) showing what the arduino is sending (two messages each, turn on/off, two different presses) there's no more messages unless i press the button again and there's no signs of it disconnecting or anything...

    I don't think there's anything wrong, i set the baud rate to 31250 and it still freezes my kemper as soon as i connect it, i didn't change anything in the code besides the baud rate (maybe there is something wrong with the code? no idea...)

    EDIT: I just tried to connect it with an empty code, and the kemper is not crashing...

  • So apparently it was an issue cause by the kemper sending info and the arduino not reading it, causing the kemper to freeze, i added this

    to my code and apparently it's not freezing now, also, i noticed that normal CCs are working properly (same as they did in my old code).

    So i have a few questions.

    1) If i use the controller to switch between rigs in performance mode, go performance up/down, enable the tuner and turn effects on/off, what's the advantage of using nrpn agains normal CCs as i was using?
    2) My code was not acting properly since the beggining, it wasn't "remembering" the effect status, so some times to turn effects on/off i have to press the button twice (let's say delay is off, i press once, the arduino sends off CC, so it does nothing, and then i have to press it again to turn it on) is there a workaround for that? It's not a big issue for me since i don't play live or anything, but it would be cool to get it fixed.

    3) Any idea how could i make the screen to show kemper info? Mostly performance in one row and rig name on the second one, i dont need too much stuff.

    Thanks!

  • 1) If i use the controller to switch between rigs in performance mode, go performance up/down, enable the tuner and turn effects on/off, what's the advantage of using nrpn agains normal CCs as i was using?

    no advantage, i dont think, just use whatever is easier and does the job

    2) My code was not acting properly since the beggining, it wasn't "remembering" the effect status, so some times to turn effects on/off i have to press the button twice (let's say delay is off, i press once, the arduino sends off CC, so it does nothing, and then i have to press it again to turn it on) is there a workaround for that? It's not a big issue for me since i don't play live or anything, but it would be cool to get it fixed.

    unless you have two-way communication to read the state of the Kemper (which makes it much more complex) you need to assume the state of effects when selecting a new rig (program/slot change) and start with your arduino in that assumed/reset state

    3) Any idea how could i make the screen to show kemper info? Mostly performance in one row and rig name on the second one, i dont need too much stuff.

    Thanks!

    you need to send a system exclusive message to retrieve the information which will be returned as another sysex message which you need to de-code and convert it into text. This is next-level midi stuff so make sure youre happy with the first two items first. Alternatively (and much easier) you could "assume" the names-per-bank/slot in the arduino and present these on the screen.

  • This is starting to seem pretty hard, i'm ok with "only" using CCs instead od nrpn and the issue with having to press twice for effects is not really too nanoying, i barely enable/disable stuff, but i'd like to use the screen to retrieve info from the kemper, i've been researching for a while, no luck so far

  • This is starting to seem pretty hard, i'm ok with "only" using CCs instead od nrpn and the issue with having to press twice for effects is not really too nanoying, i barely enable/disable stuff, but i'd like to use the screen to retrieve info from the kemper, i've been researching for a while, no luck so far

    Yes, it can be heavy-going! Take a look at this thread:

    slateboy
    February 22, 2024 at 4:08 PM
  • Yes, it can be heavy-going! Take a look at this thread:

    slateboy
    February 22, 2024 at 4:08 PM

    I'll take a look on it, althought i have no idea how to make it work hahah

    Thanks!!

  • Are we sure sending sysex via USB is doable at this point? I've been trying stuff all day and nothing worked, i can't even make the arduino to send sysex, of course not talking about reading them...
    I managed to make it send sysex via midi, but no luck with USB so far...

    EDIT: i just managed to send sysex via usb on it, so it's doable, the kemper is freezing again tho)



    This should be the sysex to get the rig name right? Does it also work in performance mode? Or do i have to find some sysex to retrieve slot name??
    All i need is the screen to show performance name and the slot/rig name for the moment.

    Edited once, last by Erikcb (May 13, 2024 at 7:13 PM).

  • Are we sure sending sysex via USB is doable at this point? I've been trying stuff all day and nothing worked, i can't even make the arduino to send sysex, of course not talking about reading them...

    I have not done any midi to/from the kemper over USB. I have not reached the stage where i have made (reflashed the arduino to create) a class-compliant (recognisable) USB-midi device. I am only as far as midi over the standard 5-pin, so unable to comment. Sorry.

  • I have not done any midi to/from the kemper over USB. I have not reached the stage where i have made (reflashed the arduino to create) a class-compliant (recognisable) USB-midi device. I am only as far as midi over the standard 5-pin, so unable to comment. Sorry.

    no worries, i'm starting to make it work, it's taking time, but it's ok, i managed to send sysex and receive them and print on the screen, but i think i have to get it translated or something, cause i'm getting the sysex message as it is, i'll figure it out eventually hahaha

    thanks!