MCPcopy Create free account
hub / github.com/FunAudioLLM/FunMusic / keep_rhythm

Function keep_rhythm

inspiremusic/utils/common.py:100–104  ·  view source on GitHub ↗
(next_token, current_time_signature)

Source from the content-addressed store, hash-verified

98 m.weight.data.normal_(mean, std)
99
100def keep_rhythm(next_token, current_time_signature):
101 allowed_durations = get_allowed_durations(current_time_signature)
102 if next_token not in allowed_durations:
103 next_token = random.choice(allowed_durations)
104 return next_token
105
106def keep_harmony(next_token, current_chord):
107 allowed_notes = get_allowed_notes(current_chord) # Define allowed notes for the chord

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected