Note Clip Generator

Note Clip Generator

Note clip generators are scriptable objects you can use to quickly populate Rhythm Timeline tracks.

You can create one like so:

Image

Not generators that auto set note clip paramters are quite useful as those cannot be set in the prefab. For example the RandomVector2NoteClipGenerator is useful in VR scene to simply set random placement of notes without having to manually set them one by one.

You can then set the Rhythm Timeline and specify the track id to spawn the Note Definitions too.

Image

To generate the notes all you need is to right-click the inspector header and press “Generate Notes”

Image

API

You should definetly consider making your own custom note generators if you make custom notes. Or use the Midi to Timeline settings.

It’s simple to make. For example this is the RandomVector2NoteClipGenerator

/// <summary>
/// This object is used to generate a note clips inside the rhythm timeline.
/// Inherit this class to make your own note clip generator.
/// You can use this generator in the Midi to Rhythm Timeline tool.
/// </summary>
[CreateAssetMenu(fileName = "RandomVector2NoteClipGenerator", menuName="Dypsloom/Rhythm Timeline/Note Generator/RandomVector2NoteClipGenerator")]
public class RandomVector2NoteClipGenerator : BasicNoteClipGenerator
{
    public Vector2 MinValues;
    public Vector2 MaxValues;

    public override RhythmClip GenerateClip(RhythmTrack rhythmTrack, double clipStart, double clipDuration,
        NoteDefinition noteDefinition, GenerateClipOverrideOption overrideOption = GenerateClipOverrideOption.ClearPreviousNotes)
    {
        var rhythmClip = base.GenerateClip(rhythmTrack, clipStart, clipDuration, noteDefinition,overrideOption);
        
        rhythmClip.ClipParameters.Vector2Parameter = new Vector2(Random.Range(MinValues.x, MaxValues.x), Random.Range(MinValues.y, MaxValues.y));
        return rhythmClip;
        
    }
}