class_docstr: Randomized pitch shifter
  
  Pitch is transposed by a normally distributed random variable.
  
  This transformation affects the following attributes:
  
  - Annotations
      - key_mode
      - chord, chord_harte, chord_roman
      - pitch_hz, pitch_midi, pitch_class
  - Audio
  
  Attributes
  ----------
  n_samples : int > 0
      The number of samples to generate per input
  
  mean : float
  sigma : float > 0
      The parameters of the normal distribution for sampling
      pitch shifts
  
  rng : None, int, or np.random.RandomState
      The random number generator state.
  
      If `None`, then `np.random` is used.
  
      If `int`, then `rng` becomes the seed for the random state.
  
  See Also
  --------
  PitchShift
  LinearPitchShift
  
  Examples
  --------
  >>> # 5 random shifts with unit variance and mean of 1 semitone
  >>> D = muda.deformers.PitchShift(n_samples=5, mean=1.0, sigma=1)
class_docstr_tok: ["Randomized","pitch","shifter","Pitch","is","transposed","by","a","normally","distributed","random","variable",".","This","transformation","affects","the","following","attributes",":","-","Annotations","-","key_mode","-","chord",",","chord_harte",",","chord_roman","-","pitch_hz",",","pitch_midi",",","pitch_class","-","Audio","Attributes","--","--","--","--","--","n_samples",":","int",">","0","The","number","of","samples","to","generate","per","input","mean",":","float","sigma",":","float",">","0","The","parameters","of","the","normal","distribution","for","sampling","pitch","shifts","rng",":","None",",","int",",","or","np.random.RandomState","The","random","number","generator","state",".","If","`","None","`",",","then","`","np.random","`","is","used",".","If","`","int","`",",","then","`","rng","`","becomes","the","seed","for","the","random","state",".","See","Also","--","--","--","--","PitchShift","LinearPitchShift","Examples","--","--","--","--",">",">",">","#","5","random","shifts","with","unit","variance","and","mean","of","1","semitone",">",">",">","D","=","muda.deformers.PitchShift","(","n_samples=5",",","mean=1.0",",","sigma=1",")"]
code: def __init__(self, n_samples=3, mean=0.0, sigma=1.0, rng=None):
      AbstractPitchShift.__init__(self)
  
      if sigma <= 0:
          raise ValueError("sigma must be strictly positive")
  
      if n_samples <= 0:
          raise ValueError("n_samples must be None or positive")
  
      self.n_samples = n_samples
      self.mean = float(mean)
      self.sigma = float(sigma)
      self.rng = rng
      self._rng = _get_rng(rng)
  
imports: import librosa
  import pyrubberband
  import re
  import numpy
  import six
  from copy import deepcopy
  from ..base import BaseTransformer, _get_rng
label_desc: Use image node_id 1 to create a new RandomPitchShift object from inherited base classes: AbstractPitchShift with example: obj = RandomPitchShift(n_samples, mean, sigma, rng)