home/ atoms/ sonic-pi-sample-rpitch

rpitch: shifts a sample's pitch by semitones without manually calculating the equivalent rate

rpitch: N transposes a sample by N semitones by computing the appropriate rate value internally. rpitch: 12 doubles the rate (one octave up); rpitch: -12 halves it. rate: and rpitch: can be combined: the pitch shift from rpitch: is applied multiplicatively on top of rate:, separating timbral/speed manipulation from harmonic transposition. Makes melodic sample use practical without needing to convert semitones to rate multipliers manually.

Examples

sample :bass_trance_c, rpitch: 7 # perfect 5th up sample :ambi_choir, rate: 0.25, rpitch: 3 # slow + minor 3rd up

Assessment

Play a sample in a major chord (root, major 3rd, perfect 5th) using rpitch:. Explain what rpitch: 12 does in terms of the underlying rate.

“rpitch:` of `3` actually corresponds to a rate of `1.1892`”
corpus · sonic-pi-built-in-tutorial · chunk 50