Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/python3 #15

Merged
merged 16 commits into from
Oct 25, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
language: python
sudo: required
dist: trusty
python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"
before_install:
# get a working ffmpeg
- sudo add-apt-repository --yes ppa:mc3man/trusty-media
- sudo apt-get update -qq
- sudo apt-get install -qq ffmpeg
# install numpy etc. via miniconda
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
wget http://repo.continuum.io/miniconda/Miniconda-3.8.3-Linux-x86_64.sh -O miniconda.sh;
else
wget http://repo.continuum.io/miniconda/Miniconda3-3.8.3-Linux-x86_64.sh -O miniconda.sh;
fi
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda config --add channels pypi
- conda info -a
- deps='pip cython numpy scipy nose pep8'
- conda create -q -n test-environment "python=$TRAVIS_PYTHON_VERSION" $deps
- source activate test-environment
install:
- pip install -e .
before_script:
- pep8 --ignore=E402 madmom tests bin
script:
- nosetests
# TODO: add executable programs
7 changes: 4 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,17 @@ Installation
Prerequisites
-------------

To install the ``madmom`` package, you must have Python version 2.7 and the
following packages installed:
To install the ``madmom`` package, you must have either Python 2.7 or Python
3.3 or newer and the following packages installed:

- `numpy <http://www.numpy.org>`_
- `scipy <http://www.scipy.org>`_
- `cython <http://www.cython.org>`_
- `nose <https://github.com/nose-devs/nose>`_ (to run the tests)

If you need support for audio files other than ``.wav`` with a sample rate of
44.1kHz and 16 bit depth, you need ``ffmpeg`` (or ``avconv`` on Ubuntu Linux).
44.1kHz and 16 bit depth, you need ``ffmpeg`` (``avconv`` on Ubuntu Linux has
some decoding bugs, so we advise not to use it!).

Please refer to the `requirements.txt <requirements.txt>`_ file for the minimum
required versions and make sure that these modules are up to date, otherwise it
Expand Down
4 changes: 3 additions & 1 deletion bin/BeatDetector
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ BeatDetector beat tracking algorithm.

"""

from __future__ import absolute_import, division, print_function

import glob
import argparse

Expand Down Expand Up @@ -94,7 +96,7 @@ def main():

# print arguments
if args.verbose:
print args
print(args)

# input processor
if args.load:
Expand Down
4 changes: 3 additions & 1 deletion bin/BeatTracker
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ BeatTracker beat tracking algorithm.

"""

from __future__ import absolute_import, division, print_function

import glob
import argparse

Expand Down Expand Up @@ -92,7 +94,7 @@ def main():

# print arguments
if args.verbose:
print args
print(args)

# input processor
if args.load:
Expand Down
4 changes: 3 additions & 1 deletion bin/CRFBeatDetector
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ CRFBeatDetector beat tracking algorithm.

"""

from __future__ import absolute_import, division, print_function

import glob
import argparse

Expand Down Expand Up @@ -95,7 +97,7 @@ def main():

# print arguments
if args.verbose:
print args
print(args)

# input processor
if args.load:
Expand Down
4 changes: 3 additions & 1 deletion bin/ComplexFlux
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ ComplexFlux onset detection algorithm.

"""

from __future__ import absolute_import, division, print_function

import argparse

from madmom.processors import IOProcessor, io_arguments
Expand Down Expand Up @@ -72,7 +74,7 @@ def main():
args.online = False
# print arguments
if args.verbose:
print args
print(args)

# input processor
if args.load:
Expand Down
4 changes: 3 additions & 1 deletion bin/DBNBeatTracker
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ DBNBeatTracker beat tracking algorithm.

"""

from __future__ import absolute_import, division, print_function

import glob
import argparse

Expand Down Expand Up @@ -96,7 +98,7 @@ def main():

# print arguments
if args.verbose:
print args
print(args)

# input processor
if args.load:
Expand Down
4 changes: 3 additions & 1 deletion bin/DownBeatTracker
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ DownBeatTracker (down-)beat tracking algorithm.

"""

from __future__ import absolute_import, division, print_function

import glob
import argparse

Expand Down Expand Up @@ -92,7 +94,7 @@ def main():

# print arguments
if args.verbose:
print args
print(args)

# input processor
if args.load:
Expand Down
4 changes: 3 additions & 1 deletion bin/LogFiltSpecFlux
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ LogFiltSpecFlux onset detection algorithm.

"""

from __future__ import absolute_import, division, print_function

import argparse

from madmom.processors import IOProcessor, io_arguments
Expand Down Expand Up @@ -71,7 +73,7 @@ def main():
args.online = False
# print arguments
if args.verbose:
print args
print(args)

# input processor
if args.load:
Expand Down
4 changes: 3 additions & 1 deletion bin/MMBeatTracker
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ MMBeatTracker multi model beat tracking algorithm.

"""

from __future__ import absolute_import, division, print_function

import glob
import argparse

Expand Down Expand Up @@ -104,7 +106,7 @@ def main():

# print arguments
if args.verbose:
print args
print(args)

# input processor
if args.load:
Expand Down
4 changes: 3 additions & 1 deletion bin/OnsetDetector
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ OnsetDetector onset detection algorithm.

"""

from __future__ import absolute_import, division, print_function

import glob
import argparse

Expand Down Expand Up @@ -88,7 +90,7 @@ def main():

# print arguments
if args.verbose:
print args
print(args)

# input processor
if args.load:
Expand Down
4 changes: 3 additions & 1 deletion bin/OnsetDetectorLL
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ OnsetDetectorLL online onset detection algorithm.

"""

from __future__ import absolute_import, division, print_function

import glob
import argparse

Expand Down Expand Up @@ -100,7 +102,7 @@ def main():

# print arguments
if args.verbose:
print args
print(args)

# input processor
if args.load:
Expand Down
8 changes: 5 additions & 3 deletions bin/PianoTranscriptor
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ PianoTranscriptor (piano) note transcription algorithm.

"""

from __future__ import absolute_import, division, print_function

import glob
import argparse

Expand All @@ -17,7 +19,7 @@ from madmom.audio.spectrogram import (LogarithmicFilteredSpectrogramProcessor,
from madmom.ml.rnn import RNNProcessor, average_predictions
from madmom.features import ActivationsProcessor
from madmom.features.onsets import PeakPickingProcessor
from madmom.features.notes import (write_midi, write_notes, write_frequencies,
from madmom.features.notes import (write_midi, write_notes, write_mirex_format,
note_reshaper)


Expand Down Expand Up @@ -102,7 +104,7 @@ def main():

# print arguments
if args.verbose:
print args
print(args)

# input processor
if args.load:
Expand Down Expand Up @@ -136,7 +138,7 @@ def main():
elif args.output_format == 'midi':
output = write_midi
elif args.output_format == 'mirex':
output = write_frequencies
output = write_mirex_format
else:
raise ValueError('unknown output format: %s' % args.output_format)
out_processor = [peak_picking, output]
Expand Down
8 changes: 5 additions & 3 deletions bin/PickleProcessor
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ PickleProcessor.

"""

import cPickle
from __future__ import absolute_import, division, print_function

import pickle
import argparse

from madmom.processors import io_arguments
Expand All @@ -28,14 +30,14 @@ def main():
help='pickled processor')
parser.add_argument('--version', action='version',
version='PickleProcessor v0.1')
sp = io_arguments(parser, output_suffix='.txt', pickle=False)
io_arguments(parser, output_suffix='.txt', pickle=False)

# parse arguments
args = parser.parse_args()
kwargs = vars(args)

# create a processor
processor = cPickle.load(kwargs.pop('processor'))
processor = pickle.load(kwargs.pop('processor'))
# and call the processing function
args.func(processor, **kwargs)

Expand Down
4 changes: 3 additions & 1 deletion bin/SpectralOnsetDetection
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Spectral onset detection script.

"""

from __future__ import absolute_import, division, print_function

import argparse

from madmom.processors import IOProcessor, io_arguments
Expand Down Expand Up @@ -84,7 +86,7 @@ def main():
'%s.' % args.onset_method)
# print arguments
if args.verbose:
print args
print(args)

# input processor
if args.load:
Expand Down
4 changes: 3 additions & 1 deletion bin/SuperFlux
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ SuperFlux onset detection algorithm.

"""

from __future__ import absolute_import, division, print_function

import argparse

from madmom.processors import IOProcessor, io_arguments
Expand Down Expand Up @@ -71,7 +73,7 @@ def main():
args.online = False
# print arguments
if args.verbose:
print args
print(args)

# input processor
if args.load:
Expand Down
4 changes: 3 additions & 1 deletion bin/SuperFluxNN
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ SuperFlux with neural network based peak picking onset detection algorithm.

"""

from __future__ import absolute_import, division, print_function

import glob
import argparse

Expand Down Expand Up @@ -85,7 +87,7 @@ def main():

# print arguments
if args.verbose:
print args
print(args)

# input processor
if args.load:
Expand Down
8 changes: 5 additions & 3 deletions bin/TempoDetector
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ TempoDetector tempo estimation algorithm.

"""

from __future__ import absolute_import, division, print_function

import glob
import argparse

Expand Down Expand Up @@ -91,7 +93,7 @@ def main():

# print arguments
if args.verbose:
print args
print(args)

# input processor
if args.load:
Expand Down Expand Up @@ -124,8 +126,8 @@ def main():
from functools import partial
writer = partial(write_tempo, mirex=True)
elif args.tempo_format in ('raw', 'all'):
# borrow the note writer for outputting multiple values
from madmom.features.notes import write_notes as writer
# borrow the event writer for outputting multiple values
from madmom.utils import write_events as writer
else:
# normal output
writer = write_tempo
Expand Down
Loading