Coder Social home page Coder Social logo

cpjku / madmom Goto Github PK

View Code? Open in Web Editor NEW
1.2K 43.0 199.0 6.42 MB

Python audio and music signal processing library

Home Page: https://madmom.readthedocs.io

License: Other

Python 97.21% Cython 2.79%
audio-analysis signal-processing machine-learning music-information-retrieval python numpy scipy cython

madmom's Issues

remove obsolete class constants

Formerly, most of these class constants were needed to set the default values for both the __init__() and the add_arguments() method. Since the latter moved to use None as default for most arguments, the class constants are more or less obsolete. We should remove them before someone starts using them.

change README for PyPI

Right now, on PyPI the same README is displayed. It includes a lot of information not needed for PyPI users but lacks other stuff such as acks.

make sure that pip install works as desired

Commit a75b388 removed the install_requires list from setup.py because this was the easiest to get http://madmom.readthedocs.org working.

Before that change all builds failed due to missing atlas/blas libraries when upgrading numpy/scipy.
Now, building the docs works with the "Install your project inside a virtualenv using setup.py install" option checked works at least.

If pip install madmom fails, we must look into using conda, which readthedocs added support for recently.

unify negative indices behaviour of FramedSignal

The behaviour of negative indices for the FramedSignal is not consistent:

  • if a single frame at position -1 is requested, the frame left of the first one is returned (as documented),
  • if a slice [-1:] is requested, the last frame is returned.

The idea of returning the frame left of the first one was to be able to calculate a correct first order difference, but it is somehow not really what people expect.

add convenience methods to MIDIFile to add notes, set tempo and time signature

It would be nice to have some convenience methods to:

  • add notes
  • set tempo
  • set time signature

of a MIDIFile, the method should take both take input given in seconds or beats.
These methods should be added to MIDIFile since the events need to be put into a track, but the tempo and time signature events can be in another track.

Suggestion: let the method accept an argument to indicate the unit to be used (seconds/beats), if none is given, it should use the (recently removed) instance attribute.

mm.audio.ffmpeg.get_file_info fails extracting sample_rate when using avprobe

avprobe (version 9.18) prints sample_rate as a float:

[streams.stream.0]
index=0
codec_name=flac
codec_long_name=FLAC (Free Lossless Audio Codec)
codec_type=audio
codec_time_base=1/44100
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
sample_rate=44100.000000
channels=1
bits_per_sample=0
avg_frame_rate=0/0
time_base=1/44100
start_time=N/A
duration=216.685714

which is why

info['sample_rate'] = int(line[len('sample_rate='):])

does not work.

Namespaces

Clean up namespaces of all modules, i.e. delete all imports needed only during the loading of the module.

ImportError: No module named TempoDetector

when i run : python TempoDetector single test.wav
the error come up,some logs is:
File "D:\Program Files\WinPython-64bit-2.7.10.3\python-2.7.10.amd64\lib\multip
rocessing\forking.py", line 489, in prepare
file, path_name, etc = imp.find_module(main_name, dirs)
ImportError: No module named TempoDetector

please help thx

MIDI: note_ticks_to_beats broken

While refactoring the code to use enumerate instead of range(len()) (see attached patch), I discovered that the note_ticks_to_beats method does alter the notes if called multiple times. Maybe we should save the state (i.e. if ticks are given in beats or seconds) similar to what we do with make_ticks_abs and make_ticks_rel.
midi_enumerate.txt

refactor beats_hmm.pyx

There are numerous glitches in this module:

  1. no clear distinction of singular/plural; i.e. BeatTrackingStateSpace refers to a single beat to be modelled, whereas PatternTrackingStateSpace models multiple patterns.
  2. no way to model a bar with tempo transitions at the beat level
  3. very long class names, e.g. the "tracking" part could be removed completely

add **kwargs to process()

Add/pass **kwargs to/from the process() methods of all processors. This is needed if we want to be able to set/change/overwrite some processing options during run time.

remove `fref` attribute of `Filterbank`

Move it to the subclasses which actually use/need it.

Additionally, the PitchClassProfileFilterbank does neither have corner_frequencies nor center_frequencies. This should be refactored as well.

redo MFCCs

Set the filterbank and transform to MelFilterbank and dct, respectively? There's always the Cepstrogram class if other parameters are needed / wanted.

Move the FFCC_* constants into the class.

unify ParallelProcessor.add_arguments()

ParallelProcessor.add_arguments() is the only add_arguments method which does not follow the convention that an argument parser is not added to the group if it is None. The meaning of None and negative numbers for num_threads should be reverse.

What parameters were used to generate stereo_sample.notes in the tests?

When applying the PianoTranscriptor script to the tests/data/stereo_sample.wav sample I get note predictions much different than those currently present in the tests/data/stereo_sample.notes file. I'm wondering if the tests/data/stereo_sample.notes was generated by a human hand? If not it may be helpful to provide a concrete example as it seems some of the documentation for the scripts in /bin is sparse and out of date.

I'd be pitch in and help in updating some of the documentation if it's useful to others.

refactor PropertyMixin

It would be nice to not have this imported at several places. Better make a private Mixin per module, this also helps to keep the namespace clean.

Python 3 compatibility of evaluation.alignment.load_alignment

Possible solution:

if values is None:
        # return 'empty' alignment
        return np.array([[0, -1]])
    elif isinstance(values, (list, np.ndarray)):
        values = np.atleast_2d(values)
    else:
        values = np.loadtxt(values, ndmin=2)

Check if np.atleast_2d(values) is enough and unify the other loading functions (beats, etc.).

pickling / unpickling of data object

While working on issue #44, I discovered that not all information is recovered after pickling the data class objects. E.g. the Spectrogram does not save its stft sand frames attribute (which is totally ok, since it would require a lot of extra space), but in turn is not able to obtain the bin_frequencies, since it requires information about the sample_rate of the underlying audio. Possible solutions would be:

  1. save the crucial information when pickling and use it after unpickling,
  2. remove all the pickling of data classes functionality,
  3. clearly state that not everything can be done after pickling data objects

Of course 1) is the desired solution, but if no-one uses the functionality right now (it is a leftover of how I prepared the data for training of neural networks) 2) would also be a valid solution. We can always re-add the functionality later if needed.

Any thoughts?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.