tuntorius / mightier_amp

An alternative app for controlling NUX Mighty amps.
MIT License
187 stars 18 forks source link

Mighty lite bt mk2 compatibility? #76

Closed painkiller8484 closed 10 months ago

painkiller8484 commented 11 months ago

Hello friend.. Are you planning to make the app compatible with nux mighty lite mk2? Thanks in advance..

tuntorius commented 11 months ago

Hello, yes, I'd like to add support for the Lite mk2. I don't have it, but the good thing is that it's similar to MP-3. Would you mind trying a test version of the app when I have something working? It will probably take several attempts to make it fully work.

painkiller8484 commented 11 months ago

Of course, unless there is no danger for my Lite mk2 I could try it and give you feedback.

tuntorius commented 11 months ago

There is no danger. The device is simply a MIDI controller over Bluetooth and uses standard MIDI messages. I believe the Lite mk2 has a desktop editor just like the Mighty Space. If you open the settings menu when it's connected, you can see a List button which will open a popup with all the MIDI messages. Can you screenshot and post them here?

PhilipTS commented 11 months ago

Hello,

Just received my Mighty Lite BT MKII, I downloaded MIGHTY EDITOR Software (Windows) and this is what I see (attached picture)

MIGHTY EDITOR

I can't see a List button with MIDI messages ... anything else I could do to help?

tuntorius commented 11 months ago

That's strange. The button is there on my amps: image

I see your editor version is newer. But I also installed the last one and the button is still there. It looks like they removed it for the Lite. By using https://www.midimonitor.com/ you can view the MIDI messages of your amp. Exit Mighty Editor first before opening it. You may also need to reconnect the USB. If it's like MP-3 or Mighty Space, you can connect the mobile app and when you change something there, it will be echoed over the USB-MIDI connection.

PhilipTS commented 11 months ago

When Midi Monitor is running ... the Mighty Editor does not find the Amp ... it is connected ...

Screenshot 2023-11-01 190911

I also installed Wireshark with USBPcap and I captured the attached traffic ... i don't know if it helps ...

NUX.zip

(I uninstalled wireshark and rebooted to make sure that it not interfere with Midi Monitor)

PhilipTS commented 11 months ago

I opened Midi Monitor and started turning nobs and pushing buttons and I would see data in the browser

I downloaded MidiView and it also worked (again Mighty Editor would not connect). With MidiView I exported the below csv file.

MidiView.zip

Can I do anything else?

PhilipTS commented 11 months ago

Just realized that the csv file had no header ...

Line,Time,Direction,Message,Channel,Value,Hex

MidiView

PhilipTS commented 11 months ago

And one more CSV file from MidiView where I was changing things from the Android App.

MidiView2.csv

painkiller8484 commented 11 months ago

I'm here if you need me but PhilipsTS's knowledge is much better than mine. Don't know much for midi commands etc, everything I manage to do is blindly from YouTube tutorials. Anyway I follow and pleased to help if I can

tuntorius commented 11 months ago

I think the MIDI CC messages are mostly identical for the Lite MK2 and the MP-3. Here's the CC messages list for MP-3 from Mightier Amp source: https://github.com/tuntorius/mightier_amp/blob/edb4343ca53e9d222ed9f5aff81d5703d8f6a3dd/lib/bluetooth/devices/NuxConstants.dart#L528 Can you check if they correspond? For example, the EFX_ParaX are used for the EFX sliders, Amp_Para for the amp sliders and so on. The X corresponds to the slider. That means if you move the amp gain slider, you should receive CC message 23 (AMP_Para1). The Head_XXX messages are for changing the active effect for the specified slot. It goes from 1 to the max effect index for the slot.

Also, what is the Bluetooth name of the amp? The one that appears in the official app when you scan for it.

PhilipTS commented 11 months ago

The Bluetooth name of the amp is

NUX NGA-3BT

Will cross check the commands.

tuntorius commented 11 months ago

Here is a test version for Android: https://drive.google.com/file/d/1BSXUvLEPLTq5GcT3d3YgaMuFEAfM30kN/view?usp=sharing It installs as a separate app. It will not overwrite your existing Mightier Amp install. First, let's see if it connects at all. The internal presets will not be loaded but adjusting parameters in the editor tab should be functional. It is very easy to check if it is working by connecting your amp to the desktop Mighty Editor. Any change in Mightier Amp should be visible in the editor. I think it also works the other way around. This makes it very easy to check for errors.

PhilipTS commented 11 months ago

The debug build does not connect to the amp.

Screenshot from the official Mighty Amp where we see the device name

Screenshot_20231102_040157_MightyAmp

Screenshot from Mightier Amp Debug. When I open it it tries to connect.

Screenshot_20231102_041033_Mightier Amp Debug

After some seconds I get Connection Failed.

Screenshot_20231102_041042_Mightier Amp Debug

PhilipTS commented 11 months ago

I also just noticed that when the amp is off I don't get the Connecting popup window ... so I guess when the amp is on the app does find it and it tries to connect to it ...

tuntorius commented 11 months ago

Yes, that means it finds it and does try to connect. I forgot to change the connection establishment method and the app used the one for Mighty Space. This build should fix that: https://drive.google.com/file/d/1BSXUvLEPLTq5GcT3d3YgaMuFEAfM30kN/view?usp=sharing

Btw, Mightier Amp also has a list of found devices in the settings screen, if you haven't found it

PhilipTS commented 11 months ago

I connected and I turned the nobs and buttons on the amps and I saw the changes reflect on the app. When I have some time I will test all buttons from Mighty Editor and check if they reflect in the app (I guess this weekend).

Thank you @tuntorius for this amazing app and for your support ... will get back to you after some testing.

tuntorius commented 11 months ago

That's great to hear. I'm curious if the Lite mk2 has hidden amp models. Its amp section is identical to mighty space, which has 8 amp models that the official amp simply doesn't show. Here is a list of them:

mppro-space

The debug version will let you select those models for the lite mk2. You'll have to judge if they are actually separate amp models, but I bet they are.

PhilipTS commented 11 months ago

I spent some hours yesterday with the amp connected to my PC with MidiView running. I went through all the settings in Mighty Amp (only the Edit Tab) and recorded everything in an XLS file. I then went trough all the settings in Mightier Amp and marked down everything OK/Not OK. I had go Guitar with me (limited space where I have my PC). Will try new weekend to check the extra Amps ... do they work and how they sound ...

NUX Mighty Lite BT MKII - Midi Messages.xlsx

PhilipTS commented 11 months ago

Hello,

I did some more tests (with a guitar plugged) and some Amps Models freeze the Amp (reboot needed). When I select "Twin Reverb" or "Vibro King" I hear a weird sound after a few seconds and the amp freezes. The others seem to work fine (Class A15, Budda, Brit Blues, Match D30, Brit 2000, Uber HiGain). I also noticed that Mightier Amp does not load the preset values from the amp.

I am also trying to figure out how the TAP button works in the Delay effects. I can here that it is effectively changing the time but the Time knob is ton changing. In the Windows app Mighty Editor there is no tap button.

NUX Mighty Lite BT MKII - Midi Messages V2.xlsx

tuntorius commented 10 months ago

Thank you for the extensive testing. That list helped a lot. I think I fixed all the errors from your list, except the loading of amp presets. In the previous build I copy-pasted most of the effect parameters from Mighty Plug Pro because they are very similar but it turns out there were some differences in the delay and reverb blocks.

The tap button is not a specific command. It manipulates the time slider which means it relies on it to be working properly. It may look like it doesn't work since the time slider was swapped with another control almost everywhere.

The Time slider of the delays is in BPM or milliseconds (adjustable in the settings menu) because the original percentage values are meaningless. For some of the amps, I had the exact values how percentages and BPMs are related. For others, I had to measure them by playing a sharp sound in reamp mode, recording it and measuring the time between the echoes for various percentages (some delays have non-linear time slider). I can't say if the bpm range you see is correct for the Lite Mk2, but underneath it goes from 0 to 100% so you've got the entire range.

I added the detune effect by accident. It is not available in the Lite.

Loading the amp presets is not available yet. I mentioned that in the first post with the build. This will be the most difficult to get right. If you send messages to the amp using MidiView, you can try to request the preset data. I think this is the message to request a preset: 0xF0 0x43 0x58 0x70 0x08 0x02 XX 0x80 0xf7 It's a SysEx message. XX is the preset index from 0 to 6.

Here's the new build with the fixes: https://drive.google.com/file/d/1FF-6Adtc-nBB2gNQmonDhCoqwQIUm_t-/view?usp=sharing

PhilipTS commented 10 months ago

I did not test the new version yet but I did some more digging with Wireshark/sendmidi/receivemidi. I managed to figure out some things for the presets and added 2 tabs in my XLS (V3), the last tab has the details. I hope you can make sense out of this. I put specific values on settings and save the preset. Then I looked where these values appeared in the dump ... will do some more digging in the weekend.

NUX Mighty Lite BT MKII - Midi Messages V3.xlsx

PhilipTS commented 10 months ago

P.S. ... To capture the presets I used

f0 43 58 70 0b 00 00 00 00 00 00 00 00 00 f7 for preset 1 f0 43 58 70 0b 00 01 00 00 00 00 00 00 00 f7 for preset 2 etc

I saw it from Wireshark.

tuntorius commented 10 months ago

This won't work because, unlike USB where the packet MTU is huge, the BLE MIDI has 23 byte packet max. All other amps so far use different preset messages over Bluetooth. They are split in 3 or 4 parts and there's some more info in the header telling the current part, the total number of parts and so on. The work you've done is still useful because the actual data where the values are is in the same order. I'll have to make another build that will request the presets and will let you copy-paste the data.

I made a mistake in the preset request message I wrote in the previous post. The message I posted is for asking the amp which is the currently selected channel.

PhilipTS commented 10 months ago

Found some time and I checked all setting and it is almost perfect ... just 5 red lines :)

NUX Mighty Lite BT MKII - Midi Messages V4.xlsx

Is there anything else I could do any other way I could help for the presets?

tuntorius commented 10 months ago

The following build requests the presets and prints them to a console https://drive.google.com/file/d/1sWfZcUb4aUUBGgHMp0ffyZrXr5o7TOXW/view?usp=sharing All the controls should be ok now. The 2 IRs you listed are bonus IRs from choptones and they take the first two slots of the user IRs. They will get their proper name when I implement the IR name reading.

To access the console, go to settings, tap 7 times on the app version row, and then scroll down a bit. Additional menu options will appear, including a console where the preset messages will be printed.

By looking at what you already discovered, I think the preset messages are identical to those of Mighty Plug Pro. Here is a list of all the fields: https://github.com/tuntorius/mightier_amp/blob/1aae7153c236dd4abaaf8be1aa0619843cdc2ebe/lib/bluetooth/devices/NuxConstants.dart#L232 I extracted these from the official app before. It was possible to partially extract the source code but about a year ago they started to encrypt it so I can't get the values for the new amps anymore. Everything that you discovered matches this list. Your message numbering is shifted 7 positions higher because it includes the header. You'll also notice that the 2 big gaps where you could not match anything are the FX not available in the Lite mk2 - an EQ and a separate compressor block.

It's interesting that in your message, the 10 bands of the EQ are not zeros but are set to 50%, which is the neutral position of the sliders - a meaningful value. Also, the 11th byte in your message is in the middle of the FX block enable/type fields but I see that you could not discover what is it for. That's because it's the one for the EQ.

Also, the FX chain order data is there. I don't know if you are familiar with Mighty Plug Pro/Space. You can reorder their FX chain. The official app can't reorder the chain of the Lite but the data is there in the preset. The position is 97 to 104 in your table and the values it contains are valid and match the FX chain of the Lite mk2 exactly: image The CMP and EQ blocks are listed here but are not shown by the app.

I will not be surprised if this amp has nearly identical firmware to Mighty Plug Pro and the missing functionality is not actually missing but hidden by the mobile app UI. I included the EQ block in the build from above. You can try to see if it works. If it does, then we can try with the FX chain reordering and other features.

PhilipTS commented 10 months ago

Debug Console ... AMAZING TOOL :) ... loving it!

I tested everything in my XLS and everything is working perfectly now ... 100% match with Mighty Amp. I hate the TAP button for the delay ... In the windows app Mighty Editor it's missing and in Mighty Amp it does not update the value of the Time knob.

I played around with the EQ 6 and 10 band but I heard no difference in the sound. Extreme V ... all sliders at Min ... all sliders at Max ... and toggling the EQ On/Off No sound difference no matter what I tried so I guess it's not working/enabled. As I mentioned some of the extra AMPs freeze soon after I select them so MAYBE there are some HW differences? Maybe the Lite MKII has e weaker CPU? less RAM? so it can't handle the load for some AMPs and EQ?

Below a TXT of the debug console with the presets and notes of how preset 1 was configured.

NUX Lite MKII Debug Console.txt

Later today or tomorrow I will try to include the info from the debug console in my XLS.

tuntorius commented 10 months ago

Maybe you're right about the weaker CPU. I'll remove the EQ. Here's the next build with patch loading: https://drive.google.com/drive/u/0/folders/17TrDFZePO2_OQ9u-WCHdBrYoEiiisYfG

I also made the QR import by using patches that I found on https://www.mightypatches.com/. This is helpful for the patch loading because the data in the QR is in the same format as the MIDI patch data. The QRs worked with no modification from what I've already implemented for the MP-3. It looks like it's the same for patch midi messages.

I also added the IR name loading. I guess the commands for that are the same as well.

I think the tap button in the official app has no code written for it at all. Up until a year ago, I could extract the source code of the app to a somewhat readable state and that button was doing nothing. I believe it's still the same. However, the older amps like MP-2 and Mighty Air have a functional tap button and the slider moves.

PhilipTS commented 10 months ago

Patches/Presets are loading fine except for the patch level/volume. IR name loading is working fine. I did some testing and it looks like the drum section is working fine.

I also tested QR scanning and it is not working, and there is no output in the debug console.

PhilipTS commented 10 months ago

Hmmm ... I noticed something ... if I scan a QR code ... it LOOKS that nothing happens ... but if press on the AMP IR icons and check everything ... the patch from the QR is loaded !!!

So it looks like it loads the patch from the QR code but it doesn't refresh the display with the new values. Example ... I am looking at the AMP section, I scan a QR code but nothing changes in the AMP section. If I click IR and then come back to AMP it shows the updated values that got loaded from the QR code.

tuntorius commented 10 months ago

Here's a build with the rest of the functionality: https://drive.google.com/file/d/1OMm0WFq4p7S77PAdEYqbRkLFvQNc7caG/view?usp=drive_link

I think everything from the official app is covered - the tuner, USB settings, patch saving. I don't know if the Lite mk2 is the same, but all amps so far do not retain the USB settings.

tuntorius commented 10 months ago

One more thing. You said Twin Reverb and Vibro King are freezing the amp. If you're certain these are the only problematic ones, I can hide them in the official version.

PhilipTS commented 10 months ago

I tested the patch level/volume and it's loading fine. I will do some more testing during the weekend, but I think we are almost ready for 1.0.7 :)

Thank you again for this great app.

PhilipTS commented 10 months ago

I did some more testing ...

Definitely disable the amps Twin Reverb and Vibro King. This time I tested with a guitar plugged in. They did not freeze some very low sound could be heard but after some seconds a click and no sound. The amp did not freeze, I could select another amp BUT as soon as I selected any other amps we had NOISE. I mean HELL BROKE LOOSE NOISE ... my sons ran in to see what happened!!! Both Twin Reverb and Vibro King are dangerous at this point!!! Maybe in some future firmware they get better?

Tuner? we have a tuner in Mightier Amp? ... do we need a tuner? ... well it's not working :) ... We should all be using tuning forks anyway ... ear training ...

I tested the preset [Save to device] button and it's working fine. I scanned some QR codes and they worked fine. The [Save as preset] button is working fine.

Really disable the 2 bad amps and I think 1.0.7 is ready!

I checked the commits you did ... I didn't realize that it was so much work!

Thanks again for all your great work.

TO ALL YOU FREE LOADERS OUT THERE ... BUY THIS GUY SOME KO-FI (and some biscuits?)

painkiller8484 commented 10 months ago

Great job,well-done! My intention is to help, not to become a "wiseguy"..As PhilipTS mentioned. tuner doesn't work. Furthermore, backing track forward and backward buttons don't work either. Also(I don't know if you tried to add this feature but it's helpful), the backing tracks don't have a volume + - db button.

painkiller8484 commented 10 months ago

Edit: backing track forward and backward works perfect, so as backing track volume boost(works, too)

tuntorius commented 10 months ago

Thank you all for the support! I really appreciate it!

I thought the amp has a tuner because when I open the official app in Mighty Lite MKII mode, I see this: image There's a Tuner option in settings. So I thought it has it. Now I checked and there's no mention of it on the product page on their website or in the user manual. Also, there's the exact same app screenshot in the manual with no tuner in it. So, I guess there's no tuner. I'm not surprised. There have been quite a few fails with their app before. Maybe they'll add the tuner in a future firmware update but the the app support is there in advance? I'll hide it for now and will update the app if they add support for it.

painkiller8484 commented 10 months ago

(I hope there is no misunderstanding) There is a tuner in the mighty app and it works. You can even change some tuning parameters like display, Hz and mute

PhilipTS commented 10 months ago

I am sick today (fever) ... if I am OK this weekend I will try to figure out the midi codes for the tuner

painkiller8484 commented 10 months ago

Get well soon my friend💪 we all have external tuners to our gear 😊 Thanks for sharing your work

tuntorius commented 10 months ago

Hope you get well soon!

I published an update without the tuner for now. Like you say it's not that important. I also forgot to add the new amp in release mode so I released the update without the Lite mk2 😆 If you installed it and don't see the amp, check for an update once again. I published the proper version now.

tuntorius commented 10 months ago

I spoke with another Mighty Lite mk2 user and he said the Brit2000 and Uber HiGain sound horrible. However, he said he is not sure if they have problems or if this is because he is not into high-gain amps. What do you think?

painkiller8484 commented 10 months ago

I spoke with another Mighty Lite mk2 user and he said the Brit2000 and Uber HiGain sound horrible. However, he said he is not sure if they have problems or if this is because he is not into high-gain amps. What do you think?

I will test them in 5-6 hours..

PhilipTS commented 10 months ago

Well in my XLS I had the below comments ...

Brit Blues - OK ? Match D30 - OK ? Brit 2000 - OK !!! Uber HiGain - OK !!!

The three !!! translate as HELL YAAAA :P They were ultra high gain ... and maybe they do sound like shit with full gain ... but they didn't cause any problems. I didn't spend time trying to tweak them as I just wanted to see what works. But they did put a smile in my face.

I was just playing around with the tuner in Mighty App. I am so used to my tc electronic tuner ... the one in Mighty App felt ... BAD/IMPRECISE/LAGGY

It uses controller channels 112/113/115 and I think that ...

115 is for the display? with 50 being in tune? 112 would go to 1 when I hit a string and 0 when I muted the sting. 113 would get a value right after 112 would go to 1. the values I noticed were from 0 to 10.

When I opened the tuner in the App i got no CC messages ....

I don't know what else to do ... any suggestions? I don't think that I will use this tuner much ... but it could be useful for some users.

tuntorius commented 10 months ago

Thank you. Yeah, this tuner is like a toy, but people ask for it all the time.

I see the messages have different numbers but their meaning and order is identical to the one I use for the other amps, which is good. There must be one more, probably 114. 112 - note on/off 113 - detected note - 0 to 11 indicating A to G# - I think this is sent only in chromatic mode 114??? - detected string number 1 to 6 - I think this is sent only in guitar or bass mode, not in chromatic. 115 - offset in cents - 50 is in tune as you observed.

There's one thing missing. There must be a SysEx message that the app must send which starts/stops the tuner and sets the config. Let's hope it's the same. Here's a test build: https://drive.google.com/file/d/1R1y_-0FipRD9zWhy3kBTtlso3urYpj5-/view?usp=sharing

If it still doesn't work, I'll need that sysex message. It is sent when the tuner page is open/closed and also when a setting is changed.

PhilipTS commented 10 months ago

Just downloaded the above version but the tuner button does not appear.

No SysEx messages were sent over the USB cable ... rechecked ... and the the Windows Mighty Editor does not have a tuner. I confirm that 114 is the string number.

What is the SysEx number you use ... I will try so send it over USB with SendMIDI. And I can also try +/- 1 values ... me might get lucky ...

PhilipTS commented 10 months ago

I also tried again the Brit 2000 & Uber HiGain ... I think they are my favorites :) I don't know if it sounds like shit compared to a real Marshall JCM 2000 (probably does) but I am glad we have them available.

tuntorius commented 10 months ago

Forgot to reenable the tuner. https://drive.google.com/file/d/1T6im68qmhsi0M0q3REh5HPNWuy_Yw1bm/view?usp=sharing

The message is: f0 43 58 70 6f 01 X1 X2 X3 X4 00 00 00 00 f7 where: X1 is tuner enable, 0 - off, 1-on. The tuner is enabled when entering the page in the app and disabled on exit. X2 is 0 - chromatic mode, 1-guitar compensated, 2 - guitar std, 3-bass X3 is reference pitch 0 to 20(14 in hex), 0=430Hz, 20=450Hz X4 is mute, 0 - off, 1 - on

For example f0 43 58 70 6f 01 01 02 0d 00 00 00 00 00 f7 enables the tuner in guitar std mode, 443hz

One clear sign that the command works is that the guitar will sound dry because all FX processing is bypassed when tuner is on.

PhilipTS commented 10 months ago

Dear @tuntorius I have to prepare you ... if the Lite BT MKII sound this good ... I will be getting a 8BT MKII as soon as it's available :D

PhilipTS commented 10 months ago

Toy tuner is working as good as it can :)

For a free tuner ... it's not bad ...