Skip to content

Commit

Permalink
Merge pull request #32 from bmcfee/transform_jam_requirement
Browse files Browse the repository at this point in the history
Transform jam requirement
  • Loading branch information
bmcfee committed Feb 22, 2017
2 parents cf9f38e + cf0d453 commit ce7c3cc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ be easily consumed by statistical algorithms. Some desired features:
>>> sr, hop_length = 44100, 512

>>> # Create a feature extraction object
>>> p_cqt = pumpp.feature.ConstantQ(name='cqt', sr=sr, hop_length=hop_length)
>>> p_cqt = pumpp.feature.CQT(name='cqt', sr=sr, hop_length=hop_length)

>>> # Create some annotation extractors
>>> p_beat = pumpp.task.BeatTransformer(sr=sr, hop_length=hop_length)
Expand Down
4 changes: 1 addition & 3 deletions pumpp/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from .feature import FeatureExtractor


def transform(audio_f, *ops, **kwargs):
def transform(audio_f, jam, *ops):
'''Apply a set of operations to a track
Parameters
Expand All @@ -41,8 +41,6 @@ def transform(audio_f, *ops, **kwargs):
# Load the audio
y, sr = librosa.load(audio_f, sr=None, mono=True)

jam = kwargs.pop('jam', None)

if jam is None:
jam = jams.JAMS()
jam.file_metadata.duration = librosa.get_duration(y=y, sr=sr)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def test_transform(audio_f, jam, sr, hop_length):
namespace='tag_open',
labels=['rock', 'jazz'])]

data = pumpp.transform(audio_f, jam=jam, *ops)
data = pumpp.transform(audio_f, jam, *ops)

# Fields we should have:
assert set(data.keys()) == set(['stft/mag', 'stft/phase',
Expand Down

0 comments on commit ce7c3cc

Please sign in to comment.