Measure class

Represents a single bar of music containing an ordered list of MusicalElements.

Use add to append elements. When a TimeSignature is present (or inherited from a previous measure) the add method enforces capacity: adding a note that would exceed the bar's rhythmic value throws a MeasureCapacityException.

Example:

final measure = Measure()
  ..add(TimeSignature(numerator: 4, denominator: 4))
  ..add(Note(pitch: const Pitch(step: 'C', octave: 4),
            duration: const Duration(DurationType.whole)));
Implementers

Constructors

Measure({bool autoBeaming = true, BeamingMode beamingMode = BeamingMode.automatic, List<List<int>> manualBeamGroups = const [], TimeSignature? inheritedTimeSignature, int? number})
Creates a new Measure.

Properties

autoBeaming bool
Controla se as notas devem ser automaticamente agrupadas com beams true = auto-beaming ativo (padrão) false = usar bandeirolas individuais (flags)
getter/setter pair
beamingMode BeamingMode
Estratégia específica de beaming para casos especiais
getter/setter pair
currentMusicalValue double
Calcula o valor total atual das figuras musicais no compasso.
no setter
elements List<MusicalElement>
All musical elements in this measure, in order.
final
hashCode int
The hash code for this object.
no setterinherited
inheritedTimeSignature TimeSignature?
TimeSignature herdado de compasso anterior (usado para validação preventiva)
getter/setter pair
isValidlyFilled bool
Verifica se o compasso está corretamente preenchido.
no setter
manualBeamGroups List<List<int>>
Grupos manuais de beams - lista de listas de índices de notas a serem agrupadas Exemplo: [0, 1, 2, 3, 4] = agrupa notas 0,1,2 em um beam e 3,4 em outro
getter/setter pair
number int?
Número do compasso, correspondente ao atributo MEI <measure @n>. null = numeração automática pelo motor de layout.
getter/setter pair
remainingValue double
Calcula quanto tempo ainda resta no compasso.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timeSignature TimeSignature?
Obtém a fórmula de compasso ativa neste compasso.
no setter

Methods

add(MusicalElement element) → void
Adiciona um elemento musical ao compasso.
canAddDuration(Duration duration) bool
Verifica se ainda há espaço para adicionar uma duração específica.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited