Skip to content

Iterating over events in musical time #177

Description

@mward19

I can't figure out how to "iterate in musical time over the music tree".

After reading the documentation on ly.music, I cannot seem to decode what is meant by the phrase "Using the Music.events() method and the events module, it is possible to iterate in musical time over the music tree, e.g. to convert music to another format.". This is precisely what I want to do.

At first, I assume that Music.events refers to ly.music.Music.events(). Well, ly.music.Music.events() just calls ly.music.event.Events.traverse(), which itself seems to call ly.music.Music.events. This seems to be recursive. Why does ly.music.Music.events() take as parameters e, time, and scaling? What do they mean? Is e an ly.music.event.Events object? Because if so, I can't figure out what it's doing besides returning a number. It doesn't seem to be able to record anything about what it's traversing.

I would love to use this library to avoid reinventing the wheel, but I can't seem to figure out how it works from the documentation.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions