Sorry, I must have been tired.
I didn't realise that we were having two separate conversations here.
@Caff. The question above still stands. You should be able to to get the keyscan code, then tweak your base sample to produce the appropriate pitch.
@fall_x. Sounds like what you are doing is very much for fun, coz otherwise I think you can buy a small midi-keyboard from as little as £40.
As you are aware the midi note range is from 0 to 127, with middle C at 60.
So a typical 'note-on' message for middle C is:
144 + channel (0 to 15), 60, 127 (velocity value).
And a typical 'note-off' message for middle C is:
128 + channel (0 to 15), 60, 127 (velocity value).
(Sorry if I'm 'teaching my grandmother to suck eggs' here.)
So your only real problem is converting your input device range to a range of 0 to 127. OK?
I didn't realise that we were having two separate conversations here.
@Caff. The question above still stands. You should be able to to get the keyscan code, then tweak your base sample to produce the appropriate pitch.
@fall_x. Sounds like what you are doing is very much for fun, coz otherwise I think you can buy a small midi-keyboard from as little as £40.
As you are aware the midi note range is from 0 to 127, with middle C at 60.
So a typical 'note-on' message for middle C is:
144 + channel (0 to 15), 60, 127 (velocity value).
And a typical 'note-off' message for middle C is:
128 + channel (0 to 15), 60, 127 (velocity value).
(Sorry if I'm 'teaching my grandmother to suck eggs' here.)
So your only real problem is converting your input device range to a range of 0 to 127. OK?