cpjku / madmom Goto Github PK
View Code? Open in Web Editor NEWPython audio and music signal processing library
Home Page: https://madmom.readthedocs.io
License: Other
Python audio and music signal processing library
Home Page: https://madmom.readthedocs.io
License: Other
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.
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.
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.
Most of the duplicated code could be refactored to audio.filters
.
The behaviour of negative indices for the FramedSignal
is not consistent:
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.
This is a kind of meaningless method, module-level function dominant_interval()
can be used directly instead.
It would be nice to have some convenience methods to:
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.
This is a minor inconsistency which could be resolved easily by renaming the argument.
Any thoughts?
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.
Clean up namespaces of all modules, i.e. delete all imports needed only during the loading of the module.
Usually, all Processors provide the same functionality as the underlaying class. However, the Signal
class does not provide the same functionality as the SignalProcessor
, namely it misses the norm
and att
parameters to normalise or attenuate the signal, respectively.
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
_assemble_ffmpeg_call
has an extra buf_size
option.
To be more consistent, put correct
to the end.
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
This does the trick, but I am not sure what kind of error to raise:
Right now, it always uses self.method
. Also propagate this option down to process()
(see Issue #33).
Also refactor the 'dbn' method functionality to its own function.
There are numerous glitches in this module:
BeatTrackingStateSpace
refers to a single beat to be modelled, whereas PatternTrackingStateSpace
models multiple patterns.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.
Right now it is a bit limited in how different settings can be used, e.g. it is not possible to use different filterbanks for various frame sizes.
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.
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.
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.
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.
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.
This is a leftover without functionality. block_size
should be move to the process() method of the Processor.
http://pytest.org/latest/fixture.html#fixtures gives some nice examples, but the tests don't have to be rewritten for py.test
necessarily.
While we're at it, make it also 2D capable, i.e. work also with beats or notes
If needed, the normalisation can be performed in the beat tracking classes before the observations are passed to the Viterbi algorithm.
Sometimes it's float
, sometimes int
.
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.).
Right now the MultiBandSpectrogram
instantiates a FilteredSpectrogram
, which is a bit surprising (at least), this should be a normal Spectrogram
.
While we're at it, also try to fix the cyclic-import warnings.
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:
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.