सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
एक शुद्ध Dart कार्यान्वयन एक Soundfont सिंथेसाइज़र है जो .sf2 ऑडियो नमूने खेलता है, जिससे Flutter ऐप में क्रॉस-प्लेटफॉर्म संगीत प्ले बैक संभव होता है। उच्च गुणवत्ता वाले वाद्ययंत्रों के ध्वनि को नैटिव डिपेंडेंसी के बिना एकीकृत करने के लिए डेवलपर्स के लिए डिज़ाइन किया गया है। यह पैकेज Android, iOS, macOS, Windows और Linux जैसे कई प्लेटफॉर्म को सपोर्ट करता है, जिससे यह पोर्टेबल ध्वनि सिंथेसिस की आवश्यकता वाले संगीत ऐप्स के लिए आदर्श है। यह Dart की शक्ति का उपयोग करके न्यूनतम सेटअप के साथ रियल-टाइम ऑडियो रेंडरिंग प्रदान करता है।
उपयोग
कस्टम इंस्ट्रुमेंट साउंड के साथ MIDI फ़ाइल्स को प्लेयर करना
संगीत शिक्षा एप्लिकेशन बनाना
Flutter में इंटरैक्टिव संगीत वाद्ययंत्र बनाना
नमूना वाद्ययंत्र लाइब्रेरी को एकीकृत करना
क्रॉस-प्लेटफॉर्म ऑडियो एप्लिकेशन विकसित करना
मुख्य विशेषताएँ
शुद्ध डार्ट कार्यान्वयन
.sf2 Soundfont फ़ाइलों का समर्थन करता है
प्लेटफॉर्म के अनुकूलता
रियल-टाइम ऑडियो सिंथेसिस
हल्का और एकीकरण में आसान
मूल कोड की आवश्यकता नहीं है
इनके लिए उपयुक्त
म्यूजिक ऐप्स बनाने वाले Flutter डेवलपर्स
इंटरैक्टिव ऑडियो वाला शैक्षिक सॉफ्टवेयर
पोर्टेबल उपकरण के ध्वनि की आवश्यकता वाले ऐप्स
प्लेटफॉर्म-विशिष्ट ऑडियो लाइब्रेरी से बचने वाले प्रोजेक्ट
कोड सरलता और पोर्टेबिलिटी को प्राथमिकता देने वाले विकासकर्ता
विचार योग्य बातें
कम क्षमता वाले उपकरणों पर प्रदर्शन में भिन्नता हो सकती है
बड़े .sf2 फ़ाइल मेमोरी का उपयोग बढ़ाते हैं
साउंडफॉन्ट 2.0 प्रारूप तक सीमित
ऑडियो संसाधनों के ध्यान से प्रबंधन की आवश्यकता होती है
जटिल बहुध्वनि या उन्नत प्रभावों के लिए अनअनुकूलित
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
dart_melty_soundfont is a SoundFont synthesizer (i.e. '.sf2' player) written in pure Dart.
It is a port of MeltySynth (C#, MIT License) written by Nobuaki Tanaka, to Dart.
https://github.com/sinshu/meltysynth
Dependencies
This package has no dependencies.
Maintanence
This project was specifically designed to not require maintanence, in large part by not having any dependencies. Apart from breaking changes to the Dart language (rare), it should be solid code that works for decades. It will work on any Dart SDK sdk>=2.12 indefinitely.
This package was written against Dart SDK 2.16.1.
Example
Synthesize a simple chord:
// Necessary Importsimport'package:dart_melty_soundfont/dart_melty_soundfont.dart';
import'package:flutter/services.dart'show rootBundle;
// load sf2ByteData bytes = await rootBundle.load('assets/akai_steinway.sf2');
// Create the synthesizer.Synthesizer synth = Synthesizer.loadByteData(bytes,
SynthesizerSettings(
sampleRate: 44100,
blockSize: 64,
maximumPolyphony: 64,
enableReverbAndChorus: true,
));
// optional: print available instruments (aka presets)List<Preset> p = synth.soundFont.presets;
for (int i = 0; i < p.length; i++) {
String instrumentName = p[i].regions.isNotEmpty ? p[i].regions[0].instrument.name : "N/A";
print('[preset $i] name: ${p[i].name} instrument: $instrumentName');
}
// optional: select first instrument (aka preset)
synth.selectPreset(channel: 0, preset: 0);
// turn on some notes
synth.noteOn(channel: 0, key: 72, velocity: 120);
synth.noteOn(channel: 0, key: 76, velocity: 120);
synth.noteOn(channel: 0, key: 79, velocity: 120);
synth.noteOn(channel: 0, key: 82, velocity: 120);
// create a pcm bufferArrayInt16 buf16 = ArrayInt16.zeros(numShorts: 44100 * 3);
// render the waveform (1 second)
synth.renderMonoInt16(buf16);
// turn off a note
synth.noteOff(channel: 0, key: 72, velocity: 120);
// render another second
synth.renderMonoInt16(buf16);
Polyphone Soundfont Editor
Some of the test cases were generated with Polyphone.
https://www.polyphone-soundfonts.com/
Freeverb by Jezar at Dreampoint
The implementation of the reverb effect is based on Freeverb.
https://music.columbia.edu/pipermail/music-dsp/2001-October/045433.html