Module Expr Str Import alias Import alias identifier Import alias Import alias identifier Import alias ImportFrom alias Assign NameStore ListLoad Str Str Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Return NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad Return BinOpAdd NameLoad Call AttributeLoad NameLoad attr Str decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad keyword Call AttributeLoad NameLoad attr keyword SubscriptLoad AttributeLoad NameLoad attr Index Str keyword SubscriptLoad AttributeLoad NameLoad attr Index Str Expr Yield NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign SubscriptStore AttributeLoad NameLoad attr Index Str Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Str SubscriptLoad AttributeLoad NameLoad attr Index Str SubscriptLoad NameLoad Index Str decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body AugAssignMult AttributeStore AttributeLoad NameLoad attr attr BinOpPow Num BinOpDiv SubscriptLoad NameLoad Index Str Num decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body AugAssignAdd AttributeStore AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Index Str decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body If CompareLtLtE Num BinOpAdd SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Num body Return For NameStore AttributeLoad AttributeLoad NameLoad attr attr body Assign SubscriptStore NameLoad Index Str Call NameLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body If CompareLtLtE Num BinOpAdd SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Num body Return Assign AttributeStore AttributeLoad NameLoad attr attr ListComp Call NameLoad NameLoad SubscriptLoad NameLoad Index Str comprehension NameStore AttributeLoad AttributeLoad NameLoad attr attr decorator_list NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults Num body Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body For NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad body Assign SubscriptStore NameLoad Index Str AttributeLoad NameLoad attr Expr Yield NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num Num Num body Expr Call AttributeLoad NameLoad attr NameLoad If CompareLtE NameLoad Num body Raise Call NameLoad Str If CompareLtE NameLoad Num body Raise Call NameLoad Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body For NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad body For NameStore Call NameLoad AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index Str Call AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword NameLoad Expr Yield NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num Num Num body Expr Call AttributeLoad NameLoad attr NameLoad If CompareLtE NameLoad NameLoad body Raise Call NameLoad Str If CompareLtE NameLoad Num body Raise Call NameLoad Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword NameLoad For NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad body For NameStore NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Expr Yield NameLoad decorator_list decorator_list
N/A N/A Pitch deformation algorithms N/A librosa N/A pyrubberband pyrb N/A re N/A numpy np N/A six base BaseTransformer N/A __all__ N/A PitchShift RandomPitchShift LinearPitchShift transpose N/A N/A label n_semitones N/A N/A N/A Transpose a chord label by some number of semitones

    Parameters
    ----------
    label : str
        A chord string

    n_semitones : float
        The number of semitones to move `label`

    Returns
    -------
    label_transpose : str
        The transposed chord label

     N/A match N/A N/A re match N/A N/A six text_type (?P<note>[A-G][b#]*)(?P<mod>.*) N/A N/A six text_type label N/A N/A match N/A N/A label N/A note N/A N/A match group note N/A new_note N/A N/A librosa midi_to_note N/A N/A N/A librosa note_to_midi note n_semitones octave False N/A N/A new_note N/A N/A match group mod N/A AbstractPitchShift N/A BaseTransformer N/A N/A Abstract base class for pitch shifting transformations __init__ N/A N/A self N/A N/A N/A Abstract base class for pitch shifting.

        This implements the deformations, but does not manage state.
         N/A N/A N/A BaseTransformer __init__ self N/A N/A N/A self _register key_mode|chord|chord_harte N/A self deform_note N/A N/A N/A self _register pitch_hz N/A self deform_frequency N/A N/A N/A self _register pitch_midi N/A self deform_midi N/A N/A N/A self _register chord_roman|pitch_class N/A self deform_tonic N/A states N/A N/A self jam N/A N/A N/A mudabox N/A N/A jam sandbox muda N/A state N/A dict tuning N/A N/A librosa estimate_tuning y N/A N/A mudabox _audio N/A y sr N/A N/A mudabox _audio N/A sr N/A N/A state N/A audio N/A N/A mudabox state N/A N/A N/A N/A N/A mudabox _audio N/A y N/A N/A pyrb pitch_shift N/A N/A mudabox _audio N/A y N/A N/A mudabox _audio N/A sr N/A state N/A n_semitones N/A staticmethod deform_frequency N/A N/A annotation state N/A N/A N/A N/A N/A annotation data value N/A 2.0 N/A N/A state N/A n_semitones 12.0 N/A staticmethod deform_midi N/A N/A annotation state N/A N/A N/A N/A N/A annotation data value N/A state N/A n_semitones N/A staticmethod deform_tonic N/A N/A annotation state N/A N/A N/A N/A -0.5 N/A N/A state N/A tuning N/A state N/A n_semitones 0.5 N/A N/A N/A obs N/A N/A annotation data value N/A N/A N/A obs N/A tonic N/A transpose N/A obs N/A tonic N/A state N/A n_semitones N/A staticmethod deform_note N/A N/A annotation state N/A N/A N/A N/A -0.5 N/A N/A state N/A tuning N/A state N/A n_semitones 0.5 N/A N/A N/A N/A N/A annotation data value N/A N/A transpose obs N/A state N/A n_semitones N/A obs N/A N/A annotation data value N/A staticmethod N/A PitchShift N/A AbstractPitchShift N/A N/A Static pitch shifting by (fractional) semitones

    This transformation affects the following attributes:

    - Annotations
        - key_mode
        - chord, chord_harte, chord_roman
        - pitch_hz, pitch_midi, pitch_class
    - Audio

    Attributes
    ----------
    n_semitones : float
        The number of semitones to transpose the signal.
        Can be positive, negative, integral, or fractional.

    See Also
    --------
    RandomPitchShift
    LinearPitchShift

    Examples
    --------
    >>> # Shift down by a quarter-tone
    >>> D = muda.deformers.PitchShift(n_semitones=-0.5)
     __init__ N/A N/A self n_semitones N/A 1 N/A N/A N/A N/A AbstractPitchShift __init__ self N/A N/A self n_semitones N/A float n_semitones N/A states N/A N/A self jam N/A N/A N/A state N/A N/A AbstractPitchShift states self jam N/A N/A N/A state N/A n_semitones N/A self n_semitones N/A N/A state N/A N/A RandomPitchShift N/A AbstractPitchShift N/A N/A 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

    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)
     __init__ N/A N/A self n_samples mean sigma N/A 3 0.0 1.0 N/A N/A N/A N/A AbstractPitchShift __init__ self N/A N/A sigma 0 N/A N/A N/A ValueError sigma must be strictly positive N/A N/A n_samples 0 N/A N/A N/A ValueError n_samples must be None or positive N/A N/A self n_samples n_samples N/A N/A self mean N/A float mean N/A N/A self sigma N/A float sigma N/A states N/A N/A self jam N/A N/A N/A state N/A N/A AbstractPitchShift states self jam N/A N/A _ N/A range N/A self n_samples N/A N/A N/A state N/A n_semitones N/A N/A N/A np random normal loc N/A self mean scale N/A self sigma size None N/A N/A state N/A N/A LinearPitchShift N/A AbstractPitchShift N/A N/A Linearly spaced pitch shift generator

    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

    lower : float
    upper : float
        The lower and upper bounds for the shift sampling

    See Also
    --------
    PitchShift
    RandomPitchShift

    Examples
    --------
    >>> # 5 shifts spaced between -2 and +2 semitones
    >>> D = muda.deformers.LinearPitchShift(n_samples=5, lower=-2, upper=2)
     __init__ N/A N/A self n_samples lower upper N/A 3 -1 1 N/A N/A N/A N/A AbstractPitchShift __init__ self N/A N/A upper lower N/A N/A N/A ValueError upper must be strictly larger than lower N/A N/A n_samples 0 N/A N/A N/A ValueError n_samples must be strictly positive N/A N/A self n_samples n_samples N/A N/A self lower N/A float lower N/A N/A self upper N/A float upper N/A states N/A N/A self jam N/A N/A N/A shifts N/A N/A np linspace N/A self lower N/A self upper num N/A self n_samples endpoint True N/A state N/A N/A AbstractPitchShift states self jam N/A N/A n_semitones shifts N/A N/A N/A state N/A n_semitones n_semitones N/A N/A state N/A N/A