public class SongUtil
extends java.lang.Object
| Constructor and Description |
|---|
SongUtil() |
| Modifier and Type | Method and Description |
|---|---|
static <N extends Note> |
applyToAllNotes(SongView<N> songView,
java.util.function.Consumer<N> noteConsumer)
Applies the given consumer to all notes in the song view.
|
static <N extends Note> |
getNoteCount(SongView<N> songView)
Returns the total amount of notes in a song.
|
static <N extends Note> |
getUsedCustomInstruments(SongView<N> songView)
Returns a list of all used custom instruments in a song.
|
static <N extends Note> |
getUsedVanillaInstruments(SongView<N> songView)
Returns a list of all used vanilla instruments in a song.
|
static <N extends Note> |
iterateAllNotes(SongView<N> songView,
java.util.function.Predicate<N> notePredicate)
Applies the given predicate to all notes in the song view.
|
static <N extends Note> |
removeDoubleNotes(SongView<N> songView)
Removes duplicate notes which are on the same tick.
|
static <N extends Note> |
removeNotesIf(SongView<N> songView,
java.util.function.Predicate<N> notePredicate)
Removes all notes which match the given predicate.
|
static <N extends Note> |
removeSilentNotes(SongView<N> songView)
Removes all notes which have a volume of 0.
|
static <N extends Note> |
removeSilentNotes(SongView<N> songView,
float threshold)
Removes all notes which have a volume lower than or equal the given threshold.
|
public static <N extends Note> void applyToAllNotes(SongView<N> songView, java.util.function.Consumer<N> noteConsumer)
N - The note typesongView - The song viewnoteConsumer - The note consumerpublic static <N extends Note> void iterateAllNotes(SongView<N> songView, java.util.function.Predicate<N> notePredicate)
N - The note typesongView - The song viewnotePredicate - The note predicatepublic static <N extends Note> void removeNotesIf(SongView<N> songView, java.util.function.Predicate<N> notePredicate)
N - The note typesongView - The song viewnotePredicate - The predicatepublic static <N extends Note> void removeDoubleNotes(SongView<N> songView)
N - The note typesongView - The song viewpublic static <N extends Note> void removeSilentNotes(SongView<N> songView)
N - The note typesongView - The song viewpublic static <N extends Note> void removeSilentNotes(SongView<N> songView, float threshold)
N - The note typesongView - The song viewthreshold - The thresholdpublic static <N extends Note> java.util.Set<Instrument> getUsedVanillaInstruments(SongView<N> songView)
N - The note typesongView - The song viewpublic static <N extends Note> java.util.Set<NbsCustomInstrument> getUsedCustomInstruments(SongView<N> songView)
N - The note typesongView - The song view