Comments (7)
Hi,
I had similar issues and found a solution for my case.
I'm not sure if it applies to those cases above, but maybe it helps.
My setup is very simple: a single potentiometer sending ControlChange when I rotate it.
I got lots of "Unexpected data byte" unless I did @slyt's trick.
Solution: Use
struct HairlessMidiSettings : public midi::DefaultSettings
{
static const bool UseRunningStatus = false;
static const long BaudRate = 115200;
};
MIDI_CREATE_CUSTOM_INSTANCE(HardwareSerial, Serial, MIDI, HairlessMidiSettings);
instead of
MIDI_CREATE_DEFAULT_INSTANCE();
Reason: a ControlChange message consists of 3 bytes: 1 "status" byte indicating the type of message and the channel and 2 "data" bytes for controller number and value.
Now there's a MIDI-feature called "running status" to save some bytes. If the status byte doesn't change (because we send lots of ControlChanges on the same channel), instead of sending
S D1 D1 S D2 D2 S D3 D3 S D4 D4 S D5 D5 ...
a midi device can just omit the repetitions of status byte S
and just send
S D1 D1 D2 D2 D3 D3 D4 D4 D5 D5 ...
Now guess what happens if your MIDI controller (like mine) ONLY sends ControlChange messages... it will only send one single status byte followed by an endless stream of data bytes. And if Hairless MIDI connects to your Arduino only after it already runs for a while it will never see the status byte, leading to "unexpected data bytes".
The code above disables the "running status" feature in the MIDI library.
from hairless-midiserial.
I was also getting the same error for a while, although my set up is quite different than yours. Try changing the baud rate again in Preferences, personally I started from the top down until I was able to receive appropriate MIDI messages from my COM Port. The 'unexpected data byte" error disappeared and my controller was stable, but only stable after changing 'flow control' to XON/XOFF. Experiment around a bit and you may find the sweet spot.
from hairless-midiserial.
Hi,
I have the same issue with ControlChange messages. I did a small test and found:
CC works only if I also send NoteOn and NoteOff message
NoteOn messages are not recognised ,until I also send NoteOff message.
UPDATE:
Seems it works but I have to set a message(CC,NoteOn/OFF) going out twice.
Is it a bug?
EDIT: Sorry for the multiple edits but I isolated some issues:
If I send a single CC it's not recognised.But if I send 2 CC but on different channels then both are recognised.
from hairless-midiserial.
@korakios are you also receiving these messages on Windows?
from hairless-midiserial.
I am on Windows 64bit. Tested on win7_64 and win8.1_64.
Also if I send a single NoteOn it's not recognised ,but if I send a NoteOn and then NoteOff message it's ok. Tell me If you need any more info.Thank you.
from hairless-midiserial.
I'm on Windows 7 64-bit. I also had the same problem when using the arduino midi library with hairless.
Sending the control change on two channels (thanks @korakios) seemed to help remedy the problem (although not an ideal fix).
MIDI.sendControlChange(16, val, 1); //send to midi control change MIDI.sendControlChange(16, val, 2); //send to midi control change
from hairless-midiserial.
Incredible that you figured it out what's going on. I tried a lot of programs and no one worked well for me that custom trick is awesome. Thanks for sharing it. Saved me a lot of time for my homework.
from hairless-midiserial.
Related Issues (20)
- 120ms Latency? HOT 2
- Adding command-line support & console output HOT 1
- Alsa Problem under Ubuntu
- Program Opening Problem
- Add minimize to system tray
- Hairless input re-injected into output HOT 3
- Arduino Clone with CH340 wihtout FTDI driver HOT 2
- macOS Big Sur compatibility HOT 6
- raw mode for debugging
- Not seeing loopMidi port at all
- Continuous playback
- Window dosnt look right
- Half Hairless - CH340 Device as MIDI Out HOT 1
- Not working for Mac OS Monterey HOT 3
- HELP WITH UPDATING SO THAT IT WORKS WITH MONTEREY HOT 6
- ESP32 usage HOT 2
- Sending over Serial on Atmega32u4
- Download page not working HOT 2
- Unable to download file HOT 10
- Set default ports when opening the program
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hairless-midiserial.