fbpx
Skip to main content

MIDI Forum

Question about Pitc...
 
Notifications
Clear all

Question about Pitchbend_c messages within midicsv (mid converted to csv format) data?

8 Posts
4 Users
0 Reactions
8,728 Views
Ruchir
Posts: 3
Active Member
Topic starter
 

Hello friends,
I've been working on a midicsv data analysis project and i came across a midi file which had following format in data,

1, 4003, Note_on_c, 0, 61, 0
1, 4012, Pitch_bend_c, 0, 8192
1, 4140, Note_on_c, 0, 61, 74
1, 4369, Pitch_bend_c, 0, 7661
1, 4395, Pitch_bend_c, 0, 7204
1, 4420, Pitch_bend_c, 0, 6770

Now I know what a pitch bender is physically, however as I found pitch_bend_c almost in 80% of instances within the file, I was a bit confused and had a few question which I've tried to google but could'nt find any source that had a clear answer.

1. Why do we see here Pitch_bend_c status in place of the regular Note_off_c message?
Has that anything to do with the performance / instrument or it is just a different method/standard of specification?
2. If that is a different method / standard of specification, can we somehow translate/convert it to the 'regular' method?

Note: I've linked the file here for your reference: file with the data

Thank you in advance for your guidance in this matter.

 
Posted : 22/09/2020 3:54 am
Geoff
Posts: 1047
Noble Member
 

I'm not really sure what you're asking here.

Pitch Bend is a perfectly normal Controller setting, which is implemented on many devices, and supported by many devices for playback. The data you show looks perfectly normal.

Exactly how this function is implemented will vary somewhat between devices, and settings on those devices (nothing to do with midi). If PB uses a wheel, then operating that wheel could generate midi controller changes, or it could generate a 'flood' of midi instructions depending on the device, and it's sensitivity. And by 'flood' I do mean to the point of this being a problem. If you are getting too much (this is subjective) PB info you could check the sensitivity settings on your device.

Pitch Bend is nothing to do with Note Off. Pitch Bend is perfectly legitimate, if it's being generated, and clearly it is.

Looking at the separate data file, there seems to be no Note Off messages, and this seems to be wrong. I would expect to see Note Off messages. Are these being 'lost' in the flood of PB?

You say nothing about your setup, which is not helpful. If you're using one of the cheap midi/USB connectors, these CAN cause problems, including lost data

Oh, just thought. You must be using some sort of process (software ?) to generate the 'midicsv' format data. This might be set to disregard Note Off. In some situations, this might be a reasonable option.

Geoff

 
Posted : 22/09/2020 4:45 am
Pedro Lopez-Cabanillas
Posts: 154
Estimable Member
 

Looking at the separate data file, there seems to be no Note Off messages, and this seems to be wrong. I would expect to see Note Off messages.

There are note on messages with velocity=0, which is just equivalent to note off.

This is the same as a note off:

1, 4003, Note_on_c, 0, 61, 0

The preference for using note on events with velocity=0 over note off ones is that they allow more compact data streams when applying running status.

Oh, just thought. You must be using some sort of process (software ?) to generate the 'midicsv' format data. This might be set to disregard Note Off. In some situations, this might be a reasonable option.

midicsv is software by John Walker that preserves note off events quite well:

https://fourmilab.ch/webtools/midicsv/

 
Posted : 22/09/2020 3:09 pm
Geoff
Posts: 1047
Noble Member
 

Duh - yes. This must be my stupid day? I missed the obvious, and carried on from there, and dug an even deeper hole!!

Fresh start tomorrow??

Geoff

 
Posted : 22/09/2020 3:41 pm
Ruchir
Posts: 3
Active Member
Topic starter
 

Hello

Thank you all for your kind inputs and responses.

It appears that due to some tech problem/ software error this sort of junk messages were generated in the file.

I've re-converted the midi file through midicsv and it looks just fine with Note_on_c as well as matching Note_off _c messages

Sorry for the trouble I gave

 
Posted : 24/09/2020 12:23 am
Eddie Lotter
Posts: 295
Reputable Member
 

[quotePost id=9654]Basically, I am still having the same question about mid converted csv files, as I just do not understand some of those things, and how should I control them.[/quotePost]
@Joe, can you be more specific? Your question is too vague for us to provide a meaningful response.

 
Posted : 06/07/2021 7:10 am
Geoff
Posts: 1047
Noble Member
 

Hello Joe and Zoe,

There seems to be some confusion here.

We deal here with midi files (among other related things) and a midi file (SMF or Standard Midi File) is a binary file containing binary data to represent music. This data needs special software to process it, and especially to inspect the data or edit it.

To make some of these jobs easier, there are ways to convert the binary file into readable/editable text (and if required to convert the text file back into useable Midi (.MID file). Use of a .CSV file is one of the available options, CSV has some format to it, but is still readable and editable text. Other options include XML data, or even just plain text with one line per midi event but with the data components vertically aligned (so that editing is still easy, but you need to take care to maintain the correct vertical alignment).

You cannot normally use the text version (such as a csv file) directly, you need to convert it back to midi so that you can 'play' the file via any sort of midi instrument.

There should not be any problem opening a csv file, it is just a simple text file, and text editor (such as NotePad within WinDoze) should be OK. If you cannot open it, then maybe it is no longer a simple text file, it has got corrupted. Maybe it's been changed into a midi file, so it is now binary data. I'd need to see the file to know further.

Regarding the other question, yes, there are two 'correct' ways to implement a Note Off within a midi file. Either as a specific Note Off command, where the velocity would be relevant ONLY for a keyboard which had the ability to generate Note Off velocity (which few can), OR as Note On but with a zero Velocity. This second option is there to make greater use of the 'Running Status' facility, where each midi command that uses the same status byte as the previous command can omit the status byte and the system will spot the missing status byte and reuse the last status byte used. This will save some data, but it will not provide much help if the data swaps between Note On and Note Off commands (as there are different status bytes) but will provide much more benefit if Note On with zero velocity is used for Note Off. Running Status is totally optional. You don't have to use it. Many older midi files do use it however (it makes the data/files smaller) so software to play midi files SHOULD know what to do with Running Status data.

Geoff

 
Posted : 07/07/2021 8:11 am
Pedro Lopez-Cabanillas
Posts: 154
Estimable Member
 

[quotePost id=9664] I still cannot figure out some things, if we actually have a note on messages with velocity=0, is that equivalent to note off?! I am not really sure about that, I have read on the internet that it might depend from one case to another.[/quotePost]

You should read the official MIDI specifications, instead of paying attention to dubious random internet sources. The documents are available for download here:
https://www.midi.org/specifications/midi1-specifications/m1-v4-2-1-midi-1-0-detailed-specification-96-1-4

 
Posted : 07/07/2021 2:37 pm
Share: