add method

void add(
  1. MusicalElement element
)

Add element to this voice

Implementation

void add(MusicalElement element) {
  elements.add(element);

  // Set voice number on notes
  if (element is Note) {
    // Note: This would require modifying Note class to have mutable voiceNumber
    // For now, voice tracking is manual
  }
}