-
May 6th, 2022, 10:56 PM
#1
Thread Starter
Hyperactive Member
SerialPort configuration for MIDI
Hi all, Conventional MIDI serial protocol - as its developers say - runs at 31250 baud rate, 8 data bits, 1 stop bit, 1 start bit and none parity (not sure for this one). The underlined item does not exist in SerialPort control properties in VB.NET what should I do?
-
May 7th, 2022, 09:48 AM
#2
Thread Starter
Hyperactive Member
Re: SerialPort configuration for MIDI
-
May 7th, 2022, 10:18 AM
#3
Thread Starter
Hyperactive Member
Re: SerialPort configuration for MIDI
As a faultfinding action, behavior to pressing middle 'C' key was monitored and results are shown in table below:
Status Byte (1) |
Pitch Byte (2) |
Velosity Byte (3) |
0X20 |
0XF8 |
don't care |
Which expected results are:
Status Byte (1) |
Pitch Byte (2) |
Velosity Byte (3) |
0X90 |
0X3C |
don't care |
Serial Port settings: 31250 sps baud rate, 8 bits data, 1 stop bit, parity (none and mark same results)
In a similar way for Key-off event there is:
Status Byte (1) |
Pitch Byte (2) |
Velosity Byte (3) |
0X00 |
0XF8 |
0X00 0XFF |
Which correct response should be (A hundred percent sure that it should be 3 bytes max):
Status Byte (1) |
Pitch Byte (2) |
Velosity Byte (3) |
0X80 |
0X3C |
0X40 |
My inference is there's a '1' bit shifted to left. Consider 0x90 (1001 0000) to 0x20 (0010 0000) and similarly 0x80 (1000 0000) to 0x00 (0000 0000).
Should I keep looking to rectify the Serial Port 1 start bit additional setting?
Or correct every receiving byte by shifting 1 bit to right? (>>1 with 1 for status bytes, >>1 with 0 for value byte(s))?
-
May 10th, 2022, 12:37 AM
#4
Thread Starter
Hyperactive Member
Re: SerialPort configuration for MIDI
Update: Well, nothing new were achieved and no answers yet... but, there's a promising thing about uart protocol which can appliable on every kind of microcontrollers. The 'start bit' thing had been built-in on this protocol - thanks to its developers - And as it can be monitored by PC, it should be a way to configure SerialPort control with 1 start bit to spy a MIDI simplex communication.
Here's the uart data frame:
Attachment 184794
-
May 10th, 2022, 08:53 AM
#5
Re: SerialPort configuration for MIDI
I believe one start bit is default / standard. I'd collect a lot of bytes from the device and look for patterns. Are you certain you are capturing all messages?
Look at this MIDI tutorial.https://learn.sparkfun.com/tutorials...l/all#messages
-
May 10th, 2022, 11:29 AM
#6
Thread Starter
Hyperactive Member
Re: SerialPort configuration for MIDI
 Originally Posted by dbasnett
Are you certain you are capturing all messages?
Yes sir, Note On messages (for middle 'C') are 3 bytes all the time and they are repeatable. Here's the sniffed packets (For note on middle 'C'): Cursor point to the end are Note Off for middle 'C' messages which should be 3 bytes and last FF is a wrong reading obviously.

If you mean are buffered data digitally okay? I might say 'not sure' because my oscilloscope is an audio frequency range one, so I'm not able to see what's going on but the cp2102 uart to usb converter proofed to be OK in recent projects. That's the reason I'm suspected to Visual Studio low-level configuration or such.
Last edited by pourkascheff; May 12th, 2022 at 01:22 PM.
-
May 10th, 2022, 02:56 PM
#7
Re: SerialPort configuration for MIDI
 Originally Posted by pourkascheff
Yes sir, Note On messages (for middle 'C') are 3 bytes all the time and they are repeatable. Here's the sniffed packets (For note on middle 'C'): Cursor point to the end are Note Off for middle 'C' messages which should be 3 bytes and last FF is a wrong reading obviously.
Attachment 184801
If you mean are buffered data digitally okay? I might say 'not sure' because my oscilloscope is an audio frequency range one, so I'm not able to see what's going on but the cp2102 uart to usb converter proofed to be OK in recent projects. That's the reason I'm suspected to Visual Studio low-level configuration or such.
Can't see any of your attachments...
-
May 12th, 2022, 01:22 PM
#8
Thread Starter
Hyperactive Member
Re: SerialPort configuration for MIDI
 Originally Posted by dbasnett
Can't see any of your attachments...
Corrected sir.
-
May 12th, 2022, 01:46 PM
#9
Re: SerialPort configuration for MIDI
In the link I posted there is a finite state machine with a heading of Message Parsing.
Did you follow that? Did you read the paragraphs that follow it?
-
Jun 21st, 2022, 11:32 AM
#10
Thread Starter
Hyperactive Member
Re: SerialPort configuration for MIDI
 Originally Posted by dbasnett
In the link I posted there is a finite state machine with a heading of Message Parsing.
Did you follow that? Did you read the paragraphs that follow it?
Um, not quite sir. I mean I forgot moore's diagram and how to extract its functionality. But what I'm one hundred percent sure is that UART protocol includes 1 start bit in itself which can easily achievable on C based microcontrollers IDEs but how do to such thing in VB (The mothership of most of them)?
-
Jun 21st, 2022, 12:15 PM
#11
Re: SerialPort configuration for MIDI
 Originally Posted by pourkascheff
Um, not quite sir. I mean I forgot moore's diagram and how to extract its functionality. But what I'm one hundred percent sure is that UART protocol includes 1 start bit in itself which can easily achievable on C based microcontrollers IDEs but how do to such thing in VB (The mothership of most of them)?
https://www.vbforums.com/showthread....=1#post5566895
-
Mar 23rd, 2023, 11:45 AM
#12
Thread Starter
Hyperactive Member
Re: SerialPort configuration for MIDI
(2023 Update) Well, I know it is not even entered to VisualStudio VB.NET yet... I was going to do things with received bytes but since readings are invalid/wrong I should rectify it first.
Is my code-generating machine produces them wrongly? Could it be faulty? Nothing else came up to my mind... I'm using Alesis Q49 it is USB MIDI-controller but also covers a DIN5 conventional port. I used DIN5 with external power same identical wrong reading.
I am considering to create an account on Gearspace.com (formerly called Gearslutz)
Last edited by pourkascheff; Mar 23rd, 2023 at 11:49 AM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|