Hi. I’m totally new to Cabbage but enjoying the challenge so far. Both the Cabbage Audio program and forum seem like a nice creative environment.
I have a number of individual instrument samples all with a single sample file at Middle C (midi 60). Using the comboBox example I can see how to load each individual instrument wav file but so far haven’t managed to fix the reference note to midi = 60 and then scale/pitch the other notes. Currently it plays the same note for all keys on the midi keyboard whereas I would like to use the single instrument wav file to be the source for the keyboard range.
Ultimately I would also like to make it future proof for when I have a sample from a different note so I would also include a slider to adjust the reference MIDI note (along the lines of several of the file player examples).
I’ve looked through most of the example files but haven’t managed to find how this would be achieved. Is there an example file that shows how this could be done (that isn’t too complicated with other functions or sound sources)?
I have some comment lines in my .csd file which I’ve tried in various ways without success:
;icps cpsmidi p4 = 60 ; read in midi note data as cycles per second
;iamp ampmidi 1 ; read in midi velocity (as a value within the range 0 - 1)
;iMidiRef chnget “MidiRef” ; MIDI unison reference note
;inote = icps/cpsmidinn(iMidiRef)
;ispeed = icps/cpsmidinn(iMidiRef) ; derive playback speed from note played in relation to a reference note (MIDI note 60 / middle C)
;iFrqRatio = icps/cpsmidinn(iMidiRef) ; derive playback speed from note played in relation to a reference note (MIDI note 60 / middle C)
comboSample w MIDI ref.csd (2.1 KB)
Any help in getting me started on my Cabbage journey would be greatly appreciated.