class_docstr: State space for rhythmic pattern tracking with a HMM.
  
  Model a joint state space with the given `state_spaces` by stacking the
  individual state spaces.
  
  Parameters
  ----------
  state_spaces : list
      List with state spaces to model.
  
  References
  ----------
  .. [1] 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.
class_docstr_tok: ["State","space","for","rhythmic","pattern","tracking","with","a","HMM",".","Model","a","joint","state","space","with","the","given","`","state_spaces","`","by","stacking","the","individual","state","spaces",".","Parameters","--","--","--","--","--","state_spaces",":","list","List","with","state","spaces","to","model",".","References","--","--","--","--","--","..","[","1","]","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","."]
code: def __init__(self, state_spaces):
      # combine the given state spaces in a single state space
      self.num_patterns = len(state_spaces)
      self.state_spaces = state_spaces
      self.state_positions = np.empty(0)
      self.state_intervals = np.empty(0, dtype=int)
      self.state_patterns = np.empty(0, dtype=int)
      self.num_states = 0
      # save the first and last states of the individual patterns in a list
      self.first_states = []
      self.last_states = []
      # stack the individual state spaces
      for p, pss in enumerate(state_spaces):
          # define position, interval and pattern states
          self.state_positions = np.hstack(
              (self.state_positions, pss.state_positions)
          )
          self.state_intervals = np.hstack(
              (self.state_intervals, pss.state_intervals)
          )
          self.state_patterns = np.hstack(
              (self.state_patterns, np.repeat(p, pss.num_states))
          )
          # append the first and last states of each pattern
          self.first_states.append(
              pss.first_states[0] + self.num_states
          )
          self.last_states.append(pss.last_states[-1] + self.num_states)
          # finally increase the number of states
          self.num_states += pss.num_states
  
imports: from __future__ import absolute_import, division, print_function
  import numpy
  from madmom.ml.hmm import ObservationModel, TransitionModel
label_desc: Use image node_id 1 to create a new MultiPatternStateSpace object from inherited base classes: object with example: obj = MultiPatternStateSpace(state_spaces)