Python & Music: Performance question

Terry Reedy tjreedy at udel.edu
Sun Apr 6 12:35:58 EDT 2003


"David Asorey Álvarez" <forodejazz at yahoo.es> wrote in message
news:1759581e.0304060218.164d4cd4 at posting.google.com...
> Hello, group.
>
> I'm developing a small music program, and I have some doubts.
>
>    I want define a class, Note, which represents a note. It has two
> attributes, pitch and duration (quarter note, half note, etc). There
> will be a lot of instances of this object, maybe hundreds of notes,
> and the program needs access to all of this objects and read its
> attributes.

An alternative would be to simply model a note as a tuple (pitch,
note).
More compact and faster.

Terry






More information about the Python-list mailing list