code: def runProgression(self, progression, streaming=True):
      nChords = len(progression)
      chordsProgressionReal = self.stringToRealProgression(progression)
      changeChordTime = 1.0
      dur = nChords * changeChordTime
      sampleRate = 44100
      hopSize = 2048
      nFrames = int(dur * sampleRate / hopSize) - 1
      frameRate = float(sampleRate) / float(hopSize)
      nextChange = frameRate * changeChordTime
      # compute expected Chords and the input pcp for the chordsdetection
      # algorithm:
      pcp = zeros([nFrames, 12])
      expectedChords = []
      j = 0
      for i in range(nFrames):
          if i == int(nextChange):
              j += 1
              nextChange += frameRate * changeChordTime
          expectedChords.append(progression[j % nChords])
          pcp[i] = chordsProgressionReal[j % nChords]
  
      pool = Pool()
  
      if streaming:
          gen = VectorInput(pcp)
          chordsDetection = ChordsDetection(
              windowSize=2.0, hopSize=hopSize
          )
  
          gen.data >> chordsDetection.pcp
          chordsDetection.chords >> (pool, "chords.progression")
          chordsDetection.strength >> (pool, "chords.strength")
          run(gen)
  
      else:
          from essentia.standard import (
              ChordsDetection as stdChordsDetection,
          )
  
          chordsDetection = stdChordsDetection(
              windowSize=2.0, hopSize=hopSize
          )
          chords, strength = chordsDetection(pcp)
          for i in range(len(chords)):
              pool.add("chords.progression", chords[i])
              pool.add("chords.strength", float(strength[i]))
  
      # as sometimes the algorithm gets confused at the transition from one chord to the other,
      # the test will be restricted to not having more errors than transitions
  
      failure = 0
      for i in range(nFrames):
          if pool["chords.progression"][i] != expectedChords[i]:
              failure += 1
          self.assertValidNumber(pool["chords.strength"][i])
          self.assertTrue(pool["chords.strength"][i] > 0)
  
      self.assertTrue(failure <= nChords)
  
file_path: essentia/test/src/unittests/tonal/test_chordsdetection_streaming.py
imports: from essentia_test import *
  from essentia.streaming import ChordsDetection
label_desc: Use image node_id 2 for calling the TestChordsDetection_Streaming obj's underlying member method code with example usage: obj.runProgression(progression, streaming) without return types