Closed keithchan9999 closed 1 year ago
madmom does not have such a sophisticated process management, so you need to do this by yourself, i.e. wrap the beat tempo sub-pipelines in a parallel processor and use in_processor to feed it.
in_processor = madmom.features.beats.RNNBeatProcessor(**kwargs)
beat_tracker = madmom.features.beats.DBNBeatTrackingProcessor(**kwargs)
beat_processor = madmom.processors.IOProcessor(beat_tracker, beat_callback)
tempo_estimator = madmom.features.tempo.TempoEstimationProcessor(**kwargs)
tempo_processor = madmom.processors.IOProcessor(tempo_estimator, tempo_callback)
parallel_processor = madmom.processors.ParallelProcessor([beat_processor, tempo_processor], num_threads=2)
pipeline = madmom.processors.SequentialProcessor(in_processor, parallel_processor)
madmom.processors.process_online(pipeline, **kwargs)
However, you have to make sure the your beat_callback
and tempo_callback
accept two arguments (data, output)
.
HTH,
Expected behaviour
Please describe how you expected madmom to behave.
Actual behaviour
I am trying to run both a beat processor and a tempo processor which wraps under a parallel processor. But I got an error like this:
File "mad.py", line 158, in main madmom.processors.process_online(parallel_processor, kwargs) File "C:\Users\kido9\miniconda3\envs\mad\lib\site-packages\madmom\processors.py", line 885, in process_online _process((processor, frame, outfile, process_args)) File "C:\Users\kido9\miniconda3\envs\mad\lib\site-packages\madmom\processors.py", line 289, in _process return process_tuple[0](*process_tuple[1:-1], *process_tuple[-1]) File "C:\Users\kido9\miniconda3\envs\mad\lib\site-packages\madmom\processors.py", line 120, in call return self.process(args, kwargs) TypeError: process() takes 2 positional arguments but 3 were given
Tried to troubleshoot but unfortunately I ain't any expert on that.
Steps needed to reproduce the behaviour
Information about installed software
Please provide some information about installed software.