Skip to content

Commit

Permalink
Merge pull request #117 from beasteers/name_defaults
Browse files Browse the repository at this point in the history
Added name defaults
  • Loading branch information
bmcfee authored Apr 14, 2022
2 parents 057d114 + b7edf1e commit 4009672
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pumpp/feature/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class FeatureExtractor(Scope):
Setting to `uint8` will produced quantized features.
'''
def __init__(self, name, sr, hop_length, conv=None, dtype='float32'):
def __init__(self, name=None, sr=22050, hop_length=512, conv=None, dtype='float32'):

super(FeatureExtractor, self).__init__(name)

Expand Down
2 changes: 1 addition & 1 deletion pumpp/feature/cqt.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class CQT(FeatureExtractor):
Otherwise, use linear magnitude
'''
def __init__(self, name, sr, hop_length, n_octaves=8, over_sample=3,
def __init__(self, name='cqt', sr=22050, hop_length=512, n_octaves=8, over_sample=3,
fmin=None, log=False, conv=None, dtype='float32'):
super(CQT, self).__init__(name, sr, hop_length, conv=conv, dtype=dtype)

Expand Down
3 changes: 2 additions & 1 deletion pumpp/feature/fft.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ class STFT(FeatureExtractor):
STFTMag
STFTPhaseDiff
'''
def __init__(self, name, sr, hop_length, n_fft, log=False, conv=None, dtype='float32'):
def __init__(self, name='stft', sr=22050, hop_length=512, n_fft=2048, log=False,
conv=None, dtype='float32'):
super(STFT, self).__init__(name, sr, hop_length, conv=conv, dtype=dtype)

self.n_fft = n_fft
Expand Down
4 changes: 2 additions & 2 deletions pumpp/feature/mel.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class Mel(FeatureExtractor):
Setting to `uint8` will produce quantized features.
'''
def __init__(self, name, sr, hop_length, n_fft, n_mels, fmax=None,
log=False, conv=None, dtype='float32'):
def __init__(self, name='mel', sr=22050, hop_length=512, n_fft=2048, n_mels=128,
fmax=None, log=False, conv=None, dtype='float32'):
super(Mel, self).__init__(name, sr, hop_length, conv=conv, dtype=dtype)

self.n_fft = n_fft
Expand Down
3 changes: 2 additions & 1 deletion pumpp/feature/rhythm.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class Tempogram(FeatureExtractor):
Setting to `uint8` will produce quantized features.
'''
def __init__(self, name, sr, hop_length, win_length, conv=None, dtype='float32'):
def __init__(self, name='tempogram', sr=22050, hop_length=512, win_length=384,
conv=None, dtype='float32'):
super(Tempogram, self).__init__(name, sr, hop_length, conv=conv, dtype=dtype)

self.win_length = win_length
Expand Down
3 changes: 2 additions & 1 deletion pumpp/feature/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class TimePosition(FeatureExtractor):
The hop length of analysis windows
'''

def __init__(self, name, sr, hop_length, conv=None, dtype='float32'):
def __init__(self, name='time_position', sr=22050, hop_length=512,
conv=None, dtype='float32'):
super(TimePosition, self).__init__(name, sr, hop_length, conv=conv,
dtype=dtype)

Expand Down

0 comments on commit 4009672

Please sign in to comment.