class_docstr: Pattern tracking with a dynamic Bayesian network (DBN) approximated by a
  Hidden Markov Model (HMM).
  
  Parameters
  ----------
  pattern_files : list
      List of files with the patterns (including the fitted GMMs and
      information about the number of beats).
  min_bpm : list, optional
      Minimum tempi used for pattern tracking [bpm].
  max_bpm : list, optional
      Maximum tempi used for pattern tracking [bpm].
  num_tempi : int or list, optional
      Number of tempi to model; if set, limit the number of tempi and use a
      log spacings, otherwise a linear spacings.
  transition_lambda : float or list, optional
      Lambdas for the exponential tempo change distributions (higher values
      prefer constant tempi from one beat to the next one).
  fps : float, optional
      Frames per second.
  
  Notes
  -----
  `min_bpm`, `max_bpm`, `num_tempo_states`, and `transition_lambda` must
  contain as many items as rhythmic patterns are modeled (i.e. length of
  `pattern_files`).
  If a single value is given for `num_tempo_states` and `transition_lambda`,
  this value is used for all rhythmic patterns.
  
  Instead of the originally proposed state space and transition model for
  the DBN [1]_, the more efficient version proposed in [2]_ is used.
  
  References
  ----------
  .. [1] Florian Krebs, Sebastian Böck and Gerhard Widmer,
         "Rhythmic Pattern Modeling for Beat and Downbeat Tracking in Musical
         Audio",
         Proceedings of the 15th International Society for Music Information
         Retrieval Conference (ISMIR), 2013.
  .. [2] Florian Krebs, Sebastian Böck and Gerhard Widmer,
         "An Efficient State Space Model for Joint Tempo and Meter Tracking",
         Proceedings of the 16th International Society for Music Information
         Retrieval Conference (ISMIR), 2015.
  
  Examples
  --------
  Create a PatternTrackingProcessor from the given pattern files. These
  pattern files include fitted GMMs for the observation model of the HMM.
  The returned array represents the positions of the beats and their position
  inside the bar. The position is given in seconds, thus the expected
  sampling rate is needed. The position inside the bar follows the natural
  counting and starts at 1.
  
  >>> from madmom.models import PATTERNS_BALLROOM
  >>> proc = PatternTrackingProcessor(PATTERNS_BALLROOM, fps=50)
  >>> proc  # doctest: +ELLIPSIS
  <madmom.features.downbeats.PatternTrackingProcessor object at 0x...>
  
  Call this PatternTrackingProcessor with a multi-band spectrogram to obtain
  the beat and downbeat positions. The parameters of the spectrogram have to
  correspond to those used to fit the GMMs.
  
  >>> from madmom.audio.spectrogram import LogarithmicSpectrogramProcessor, SpectrogramDifferenceProcessor, MultiBandSpectrogramProcessor
  >>> from madmom.processors import SequentialProcessor
  >>> log = LogarithmicSpectrogramProcessor()
  >>> diff = SpectrogramDifferenceProcessor(positive_diffs=True)
  >>> mb = MultiBandSpectrogramProcessor(crossover_frequencies=[270])
  >>> pre_proc = SequentialProcessor([log, diff, mb])
  
  >>> act = pre_proc('tests/data/audio/sample.wav')
  >>> proc(act)  # doctest: +ELLIPSIS
  array([[0.82, 4.  ],
         [1.78, 1.  ],
         ...,
         [3.7 , 3.  ],
         [4.66, 4.  ]])
class_docstr_tok: ["Pattern","tracking","with","a","dynamic","Bayesian","network","(","DBN",")","approximated","by","a","Hidden","Markov","Model","(","HMM",")",".","Parameters","--","--","--","--","--","pattern_files",":","list","List","of","files","with","the","patterns","(","including","the","fitted","GMMs","and","information","about","the","number","of","beats",")",".","min_bpm",":","list",",","optional","Minimum","tempi","used","for","pattern","tracking","[","bpm","]",".","max_bpm",":","list",",","optional","Maximum","tempi","used","for","pattern","tracking","[","bpm","]",".","num_tempi",":","int","or","list",",","optional","Number","of","tempi","to","model",";","if","set",",","limit","the","number","of","tempi","and","use","a","log","spacings",",","otherwise","a","linear","spacings",".","transition_lambda",":","float","or","list",",","optional","Lambdas","for","the","exponential","tempo","change","distributions","(","higher","values","prefer","constant","tempi","from","one","beat","to","the","next","one",")",".","fps",":","float",",","optional","Frames","per","second",".","Notes","--","--","-","`","min_bpm","`",",","`","max_bpm","`",",","`","num_tempo_states","`",",","and","`","transition_lambda","`","must","contain","as","many","items","as","rhythmic","patterns","are","modeled","(","i.e",".","length","of","`","pattern_files","`",")",".","If","a","single","value","is","given","for","`","num_tempo_states","`","and","`","transition_lambda","`",",","this","value","is","used","for","all","rhythmic","patterns",".","Instead","of","the","originally","proposed","state","space","and","transition","model","for","the","DBN","[","1","]","_",",","the","more","efficient","version","proposed","in","[","2","]","_","is","used",".","References","--","--","--","--","--","..","[","1","]","Florian","Krebs",",","Sebastian","B\u00f6ck","and","Gerhard","Widmer",",","``","Rhythmic","Pattern","Modeling","for","Beat","and","Downbeat","Tracking","in","Musical","Audio","''",",","Proceedings","of","the","15th","International","Society","for","Music","Information","Retrieval","Conference","(","ISMIR",")",",","2013",".","..","[","2","]","Florian","Krebs",",","Sebastian","B\u00f6ck","and","Gerhard","Widmer",",","``","An","Efficient","State","Space","Model","for","Joint","Tempo","and","Meter","Tracking","''",",","Proceedings","of","the","16th","International","Society","for","Music","Information","Retrieval","Conference","(","ISMIR",")",",","2015",".","Examples","--","--","--","--","Create","a","PatternTrackingProcessor","from","the","given","pattern","files",".","These","pattern","files","include","fitted","GMMs","for","the","observation","model","of","the","HMM",".","The","returned","array","represents","the","positions","of","the","beats","and","their","position","inside","the","bar",".","The","position","is","given","in","seconds",",","thus","the","expected","sampling","rate","is","needed",".","The","position","inside","the","bar","follows","the","natural","counting","and","starts","at","1",".",">",">",">","from","madmom.models","import","PATTERNS_BALLROOM",">",">",">","proc","=","PatternTrackingProcessor","(","PATTERNS_BALLROOM",",","fps=50",")",">",">",">","proc","#","doctest",":","+ELLIPSIS","<","madmom.features.downbeats.PatternTrackingProcessor","object","at","0x","...",">","Call","this","PatternTrackingProcessor","with","a","multi-band","spectrogram","to","obtain","the","beat","and","downbeat","positions",".","The","parameters","of","the","spectrogram","have","to","correspond","to","those","used","to","fit","the","GMMs",".",">",">",">","from","madmom.audio.spectrogram","import","LogarithmicSpectrogramProcessor",",","SpectrogramDifferenceProcessor",",","MultiBandSpectrogramProcessor",">",">",">","from","madmom.processors","import","SequentialProcessor",">",">",">","log","=","LogarithmicSpectrogramProcessor","(",")",">",">",">","diff","=","SpectrogramDifferenceProcessor","(","positive_diffs=True",")",">",">",">","mb","=","MultiBandSpectrogramProcessor","(","crossover_frequencies=","[","270","]",")",">",">",">","pre_proc","=","SequentialProcessor","(","[","log",",","diff",",","mb","]",")",">",">",">","act","=","pre_proc","(","'tests\/data\/audio\/sample.wav","'",")",">",">",">","proc","(","act",")","#","doctest",":","+ELLIPSIS","array","(","[","[","0.82",",","4",".","]",",","[","1.78",",","1",".","]",",","...",",","[","3.7",",","3",".","]",",","[","4.66",",","4",".","]","]",")"]
docstr: Add DBN related arguments for pattern tracking to an existing parser
  object.
  
  Parameters
  ----------
  parser : argparse parser instance
      Existing argparse parser object.
  pattern_files : list
      Load the patterns from these files.
  min_bpm : list, optional
      Minimum tempi used for beat tracking [bpm].
  max_bpm : list, optional
      Maximum tempi used for beat tracking [bpm].
  num_tempi : int or list, optional
      Number of tempi to model; if set, limit the number of states and
      use log spacings, otherwise a linear spacings.
  transition_lambda : float or list, optional
      Lambdas for the exponential tempo change distribution (higher
      values prefer constant tempi from one beat to the next one).
  
  Returns
  -------
  parser_group : argparse argument group
      Pattern tracking argument parser group
  
  Notes
  -----
  `pattern_files`, `min_bpm`, `max_bpm`, `num_tempi`, and
  `transition_lambda` must have the same number of items.
code: def add_arguments(
      parser,
      pattern_files=None,
      min_bpm=MIN_BPM,
      max_bpm=MAX_BPM,
      num_tempi=NUM_TEMPI,
      transition_lambda=TRANSITION_LAMBDA,
  ):
      """
      Add DBN related arguments for pattern tracking to an existing parser
      object.
  
      Parameters
      ----------
      parser : argparse parser instance
          Existing argparse parser object.
      pattern_files : list
          Load the patterns from these files.
      min_bpm : list, optional
          Minimum tempi used for beat tracking [bpm].
      max_bpm : list, optional
          Maximum tempi used for beat tracking [bpm].
      num_tempi : int or list, optional
          Number of tempi to model; if set, limit the number of states and
          use log spacings, otherwise a linear spacings.
      transition_lambda : float or list, optional
          Lambdas for the exponential tempo change distribution (higher
          values prefer constant tempi from one beat to the next one).
  
      Returns
      -------
      parser_group : argparse argument group
          Pattern tracking argument parser group
  
      Notes
      -----
      `pattern_files`, `min_bpm`, `max_bpm`, `num_tempi`, and
      `transition_lambda` must have the same number of items.
  
      """
      from ..utils import OverrideDefaultListAction
  
      # add GMM options
      if pattern_files is not None:
          g = parser.add_argument_group("GMM arguments")
          g.add_argument(
              "--pattern_files",
              action=OverrideDefaultListAction,
              default=pattern_files,
              help="load the patterns (with the fitted GMMs) "
              "from these files (comma separated list)",
          )
      # add HMM parser group
      g = parser.add_argument_group(
          "dynamic Bayesian Network arguments"
      )
      g.add_argument(
          "--min_bpm",
          action=OverrideDefaultListAction,
          default=min_bpm,
          type=float,
          sep=",",
          help="minimum tempo (comma separated list with one "
          "value per pattern) [bpm, default=%(default)s]",
      )
      g.add_argument(
          "--max_bpm",
          action=OverrideDefaultListAction,
          default=max_bpm,
          type=float,
          sep=",",
          help="maximum tempo (comma separated list with one "
          "value per pattern) [bpm, default=%(default)s]",
      )
      g.add_argument(
          "--num_tempi",
          action=OverrideDefaultListAction,
          default=num_tempi,
          type=int,
          sep=",",
          help="limit the number of tempi; if set, align the "
          "tempi with log spacings, otherwise linearly "
          "(comma separated list with one value per pattern)"
          " [default=%(default)s]",
      )
      g.add_argument(
          "--transition_lambda",
          action=OverrideDefaultListAction,
          default=transition_lambda,
          type=float,
          sep=",",
          help="lambda of the tempo transition distribution; "
          "higher values prefer a constant tempo over a "
          "tempo change from one bar to the next one (comma "
          "separated list with one value per pattern) "
          "[default=%(default)s]",
      )
      # add output format stuff
      g = parser.add_argument_group("output arguments")
      g.add_argument(
          "--downbeats",
          action="store_true",
          default=False,
          help="output only the downbeats",
      )
      # return the argument group so it can be modified if needed
      return g
  
imports: from __future__ import absolute_import, division, print_function
  import sys
  import warnings
  import numpy
  from .beats import threshold_activations
  from .beats_hmm import BarStateSpace, BarTransitionModel, GMMPatternTrackingObservationModel, MultiPatternStateSpace, MultiPatternTransitionModel, RNNBeatTrackingObservationModel, RNNDownBeatTrackingObservationModel
  from ..ml.hmm import HiddenMarkovModel
  from ..processors import ParallelProcessor, Processor, SequentialProcessor
  from ..utils import string_types
label_desc: Use image node_id 3 for calling the PatternTrackingProcessor obj's underlying member method code with example usage: obj.add_arguments(parser, pattern_files, min_bpm, max_bpm, num_tempi, transition_lambda) and returns: g