FLUTTER ECOSYSTEM

craigomac/piano

一個用於處理鋼琴鍵和樂譜的 Flutter 套件

鋼琴 專案封面
Stars
91
Forks
32
最近推送(UTC)
2024年6月1日
專案狀態
未封存
Craig McMahon GitHub avatar
GITHUB User

Craig McMahon ↗

I've been programming since QBASIC, and a mobile developer since PalmPilot. These days I like Swift, Flutter and machine learning.

Amsterdam, The Netherlands官方網站 ↗
語言Dart

此儲存庫發佈的套件

使用的依賴

依賴清單 7 項

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 README

Piano

A Flutter package that provides:

  • logic for working with musical notes, clefs and octaves;
  • a widget that can render notes on a clef;
  • an interactive piano widget.

Where is it used?

In "Learn The Notes", a simple sight reading trainer you can find on the iOS App Store here and macOS App Store here.

Example showing musical clef and interactive piano

How do I use it?

Here's an example app:

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:piano/piano.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return CupertinoApp(
        title: 'Piano Demo',
        home: Center(
          child: InteractivePiano(
            highlightedNotes: [
              NotePosition(note: Note.C, octave: 3)
            ],
            naturalColor: Colors.white,
            accidentalColor: Colors.black,
            keyWidth: 60,
            noteRange: NoteRange.forClefs([
              Clef.Treble,
            ]),
            onNotePositionTapped: (position) {
              // Use an audio library like flutter_midi to play the sound
            },
          ),
        ));
  }
}

More like this

  • I blog about Flutter here: https://handform.net/
  • I'm on LinkedIn: https://www.linkedin.com/in/craigbmcmahon/