def clean_chords(data, right_slash=False, resolve_enharmonics=True, time_threshold=100):
    """
    From chords_chordino computed by chordino, clean them. Will only use
    letters and # and b by default. Adim becomes A, Ebmaj7 becomes Eb, ...
    G7/B becomes G, unless right_slash is True.

    :param data: (dict) JAMS, a list of chords such as:
         [
        {
          "time": 0.185759637,
          "confidence": null,
          "duration": null,
          "value": "N"
        },... ]
    :param right_slash: (bool) For a chord like 'G7/B', use B.
    :param resolve_enharmonics: (bool) For instance Db becomes C#. Use only #.
    :param time_threshold: (int) Ignore chord if it last less than this value (in ms)

    :returns: An array or clean chords, like ["G#", "A#", "B"]. Same repeated chords are reduced to one occurence.
    """

    enharm_from = ["Ab", "Bb", "Cb", "Db", "Eb", "Fb", "Gb"]
    enharm_to = ["G#", "A#", "B", "C#", "D#", "E", "F#"]

    chord_simples = []  # cleaner chord succession

    # Remove duplicated
    chord_num = -1
    for chord_raw in data:
        chord = chord_raw["value"]
        chord_num += 1

        # Skip unknown chord (like N for chordino or X for crema)
        if chord in ["N", "X"]:
            continue

        # Skip chord that does not last long enough
        if chord_num + 1 <= len(data) - 1:
            cur_ts = chord_raw['time']
            next_ts = data[chord_num + 1]['time']
            if ((next_ts * 1000) - (cur_ts * 1000)) < time_threshold:
                continue

        # Use right of slash
        if "/" in chord and right_slash:
            chord = chord.split("/")[-1]

        # Take first char of chord for now
        chord_simple = chord[0]

        # Take first char + second char if # or b
        # Ignore following chars that contain more accurate information like
        # 'm', 'm6', 'maj', 'dim', ...
        if len(chord) > 1 and chord[1] in ["b", "#"]:
            chord_simple += chord[1]

        # Resolve enharmonics
        if resolve_enharmonics:
            if chord_simple in enharm_from:
                chord_simple = enharm_to[enharm_from.index(chord_simple)]

        # First element of chord_simples
        if len(chord_simples) > 0:
            previous_chord = chord_simples[-1]
        else:
            chord_simples.append(chord_simple)
            continue

        # Skip similar chord to previous one
        if chord_simple == previous_chord:
            continue

        chord_simples.append(chord_simple)

    return chord_simples