Skip to content

Conversation

@liushuyu
Copy link
Member

@liushuyu liushuyu commented Jan 3, 2017

Added one basic and widely used RPN CC handling: Pitch Sensitivity (aka Pitch Range)
CC code sequence:

101, 0  ; Indicate a RPN-MSB entry
100, 0  ; Indicate a RPN-MSB entry
; The combination above (0, 0) indicates to change Pitch Sensitivity (aka Pitch Range)
6, <value in semitones / 127>
38, 0 ; End

This will fix #1967


This change is Reviewable

@senseab
Copy link
Contributor

senseab commented Jan 4, 2017

I would say two flags might be better. The prevCC = 201 looks strange.

@liushuyu
Copy link
Member Author

liushuyu commented Jan 4, 2017

Because I need to prepare for other CC message other than (0,0)

@senseab
Copy link
Contributor

senseab commented Jan 4, 2017 via email

@softrabbit
Copy link
Member

I'm not entirely sure about the code. What if there's a CC 101, X ; CC 100,0, won't that be interpreted the same for any X? I believe the order of these CCs isn't dictated by the MIDI standard.

Here's how I'd implement the RPN logic: https://github.com/softrabbit/lmms/blob/midi_import/plugins/MidiImport/MidiImport.cpp#L520. I think it's the more future-proof way, in case other RPNs are needed at some point.

@senseab
Copy link
Contributor

senseab commented Jan 4, 2017

Okay, CC101 means RPN MSB and CC100 means RPN LSB. RPN MSB seems to be always 0 or 127(Null). While RPN LSB = 0 and MSB = 0, it means Pitch Bend Sensitivity.

CC101 RPN MSB CC100 RPN LSB Meaning
0 0 Pitch Range
0 1 Fine Tune
0 2 Coarse Tune
127 127 Null

I was read your code. Pitch bend should be multiplied by pitchRangeModel, or you will hear incorrect tones after you import MIDI file. here is a MIDI file you can test https://cfp.vim-cn.com/cbcNg

Base64 decoder is needed. And it will be correct while you hear a octave.

For more info about MIDI controller, see http://www.indiana.edu/~emusic/cntrlnumb.html

@softrabbit
Copy link
Member

I was read your code. Pitch bend should be multiplied by pitchRangeModel, or you will hear incorrect tones after you import MIDI file. here is a MIDI file you can test https://cfp.vim-cn.com/cbcNg

I never said it was complete 😄. Looks like I was going to post-process the pitch ranges in case they happened in a different track in the file, but that might be a pretty rare situation. Just simply multiplying while reading the track will probably work fine for something like 99% of all files.

I guess #1967 can be closed when this is merged.

@senseab
Copy link
Contributor

senseab commented Jan 4, 2017 via email

@senseab
Copy link
Contributor

senseab commented Jan 5, 2017

Now looks like my style.....
And now i reailze that, bool is bad for this

@liushuyu
Copy link
Member Author

liushuyu commented Jan 5, 2017

Well, some more annoying things occurred and proved this solution is not applicable. Close this out for future reference.

@liushuyu liushuyu closed this Jan 5, 2017
@softrabbit
Copy link
Member

Well, some more annoying things occurred and proved this solution is not applicable.

Please, document them for future reference.

@liushuyu
Copy link
Member Author

liushuyu commented Jan 5, 2017 via email

@softrabbit
Copy link
Member

Comment here, this is the most likely place for people to look for info.

@liushuyu
Copy link
Member Author

liushuyu commented Jan 5, 2017

Comment here, this is the most likely place for people to look for info.

Okay, I will do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants