flutter_notemus 2.0.1 copy "flutter_notemus: ^2.0.1" to clipboard
flutter_notemus: ^2.0.1 copied to clipboard

Professional music notation rendering for Flutter. SMuFL-compliant with 2932 Bravura glyphs, beams, dynamics, articulations, and JSON import/export.

Flutter Notemus #

pub.dev License

Professional music notation rendering for Flutter with SMuFL + Bravura.

Current release target #

What this package provides #

  • High quality notation rendering on Flutter Canvas
  • Core notation model (Staff, Measure, Note, Chord, Rest, etc.)
  • Layout engine with rhythmic spacing and collision handling
  • Multi-voice support (MultiVoiceMeasure)
  • Grand-staff and multi-staff scenarios
  • Importers: JSON, MusicXML, MEI
  • MIDI pipeline:
    • notation-to-MIDI mapping
    • repeat and volta expansion
    • metronome timeline generation
    • .mid file export
    • native audio backend contract and bridge

Installation #

Add dependency:

dependencies:
  flutter_notemus: ^2.0.1

Then run:

flutter pub get

Required initialization #

Load Bravura font and SMuFL metadata before rendering:

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_notemus/flutter_notemus.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();

  final loader = FontLoader('Bravura');
  loader.addFont(
    rootBundle.load('packages/flutter_notemus/assets/smufl/Bravura.otf'),
  );
  await loader.load();

  await SmuflMetadata().load();

  runApp(const MyApp());
}

Quick start #

import 'package:flutter/material.dart';
import 'package:flutter_notemus/flutter_notemus.dart';

class DemoScore extends StatelessWidget {
  const DemoScore({super.key});

  @override
  Widget build(BuildContext context) {
    final staff = Staff(
      measures: [
        Measure()
          ..add(Clef(clefType: ClefType.treble))
          ..add(TimeSignature(numerator: 4, denominator: 4))
          ..add(Note(
            pitch: const Pitch(step: 'C', octave: 5),
            duration: const Duration(DurationType.quarter),
          ))
          ..add(Note(
            pitch: const Pitch(step: 'D', octave: 5),
            duration: const Duration(DurationType.quarter),
          ))
          ..add(Note(
            pitch: const Pitch(step: 'E', octave: 5),
            duration: const Duration(DurationType.quarter),
          ))
          ..add(Note(
            pitch: const Pitch(step: 'F', octave: 5),
            duration: const Duration(DurationType.quarter),
          )),
      ],
    );

    return MusicScore(staff: staff, staffSpace: 12);
  }
}

MIDI quick example #

import 'dart:io';
import 'package:flutter_notemus/flutter_notemus.dart';

Future<void> exportMidi(Staff staff) async {
  final sequence = MidiMapper.fromStaff(staff);
  final bytes = MidiFileWriter.write(sequence);
  await File('score.mid').writeAsBytes(bytes, flush: true);
}

Feature status #

Implemented and production-ready:

  • Core notation model and rendering pipeline
  • Notes, rests, chords, ties, slurs, tuplets, beams
  • Clefs, key signatures, time signatures, barlines
  • Dynamics, articulations, ornaments, octave marks, volta brackets
  • Multi-voice layout and rendering
  • MIDI mapping and MIDI file export

Partially implemented or pending:

Detailed backlog document:

  • docs/OPEN_ISSUES.md

API references #

Primary entry points:

  • MusicScore
  • LayoutEngine
  • StaffRenderer
  • NotationParser
  • MidiMapper
  • MidiFileWriter
  • MethodChannelMidiNativeAudioBackend
  • MidiNativeSequenceBridge

Public exports:

  • lib/flutter_notemus.dart
  • lib/midi.dart

Development and quality #

Common local checks:

dart analyze
flutter test
flutter pub publish --dry-run

Publishing to pub.dev #

Recommended flow:

flutter pub get
flutter test
flutter pub publish --dry-run
flutter pub publish

License #

  • Project code: Apache-2.0 (LICENSE)
  • Bravura font: SIL Open Font License 1.1
  • SMuFL specification: W3C Music Notation Community Group
2
likes
0
points
35
downloads

Publisher

unverified uploader

Weekly Downloads

Professional music notation rendering for Flutter. SMuFL-compliant with 2932 Bravura glyphs, beams, dynamics, articulations, and JSON import/export.

Homepage
Repository (GitHub)
View/report issues

Topics

#flutter #music #notation #rendering #smufl

License

unknown (license)

Dependencies

collection, flutter, pdf, printing, xml

More

Packages that depend on flutter_notemus

Packages that implement flutter_notemus