(transpose_range=(0, 1))
Iterates through pairs of MIDI notes and buttons.
Iterates through pairs of MIDI notes and buttons.
Iterates through pairs of MIDI notes and buttons .
def gold_iterator(transpose_range=(0, 1)):
  """Iterates through pairs of MIDI notes and buttons."""
  maxlen = gold_longest()
  for transpose in range(*transpose_range):
    for midi_notes, buttons in _GOLD:
      midi_notes = [int(x) + transpose for x in midi_notes.split(",")]
      buttons = [int(x) for x in list(buttons)]
      seqlen = len(midi_notes)
      assert len(buttons) == len(midi_notes)
      assert seqlen <= maxlen
      midi_notes += [21] * (maxlen - seqlen)
      buttons += [0] * (maxlen - seqlen)
      yield [midi_notes], [buttons], seqlen
def gold_iterator ( transpose_range = ( 0 , 1 ) ) : maxlen = gold_longest ( ) for transpose in range ( * transpose_range ) : for midi_notes , buttons in _GOLD : midi_notes = [ int ( x ) + transpose for x in midi_notes . split ( "," ) ] buttons = [ int ( x ) for x in list ( buttons ) ] seqlen = len ( midi_notes ) assert len ( buttons ) == len ( midi_notes ) assert seqlen <= maxlen midi_notes += [ 21 ] * ( maxlen - seqlen ) buttons += [ 0 ] * ( maxlen - seqlen ) yield [ midi_notes ] , [ buttons ] , seqlen