danso_function 0.0.6
danso_function: ^0.0.6 copied to clipboard
This is a package for danso-flutter-application
danso_function ๐ฅ๐ฅ๐ฅ #
Release Note #
## 0.0.1
* Initial release
* Sorry for users, this might be a package for private application. So you might not as well use this package. Thanks!
## 0.0.2
* PitchModelInterface for danso yulmyeong
* Made as Singleton.
* It maps user input frequencies to danso yulmyeong
## 0.0.3
* Made toChineseCharacter and toHangeul in YulmyeongNote class
## 0.0.4
* Completed JungGanBoClass
* Passed all the Test about JungGanBoClass
## 0.0.5
* Hot Fix!! Need to change jung gan bo string structure and Accept it!
## 0.0.6
* Made playJungGanBo(JungGanBo jungGanBo) function!!
* But Need to adjust
Getting started #
flutter pub add danso_function
Features #
PitchModel Interface #
This is PitchModelInterface. PitchModelInterface class is an interface and PitchModel is concrete Model. So you can use PitchModelInterface to use functions which I made. Here are functions I made.
Abstract #
- Frequency์ ๋จ์์ ์จ๋ช
์ mapping ์์ผ์ค๋ค.
function #1
- User์๊ฒ ๊ธฐ์ค์์ ์
๋ ฅ๋ฐ์์ ๊ธฐ์ค ์
์ถ๋ ฅ frequency์๋ค๊ฐ userAdjust๋ฅผ ๋ํด์ ์ฌ์ฉํ ์ ์๊ฒ ํ๋ค.
function #2
- userWidthFrequency๋ฅผ ์ ํด์ Hit ๋๋ Frequency์ ๋ฒ์๋ฅผ ์ ํ ์ ์๊ฒ ํ๋ค.
function #3
- ์์ด ํด๋น ์จ๋ช
์ ๋ง๋์ง ๊ฒ์ฌํด ์ฃผ๋ ๊ธฐ๋ฅ์ ํ๋ค.
function #4
- ํด๋น ์จ๋ช
์ frequency๋ฅผ return ํ๋ ๊ธฐ๋ฅ์ ํ๋ค.
function #5
InterFace #
class PitchModelInterface {
//function #1
YulmyeongNote getYulmyeongByFrequency(double userFrequency) {}
//function #2
void settingAdjust(double userInputFrequency) {}
//function #3
//PitchConst ์์ const value๋ณ๊ฒฝํด์ ์ ํ๊ธฐ, ui์์๋ ๊ธฐ๋ฅ ์ ๊ณต x
//function #4
bool isCorrectPitch(double userFrequency, YulmyeongNote detectPitch) {}
//function #5
double getFrequencyByYulmyeongNote(YulmyeongNote outPutPitch) {}
}
Usage #
test('Pitch Model getYulmyeongByFrequency tae high', () {
PitchModel pitchModel = new PitchModel();
expect(
pitchModel.getYulmyeongByFrequency(1479.98 + 11) ==
YulmyeongNote(Yulmyeong.tae, ScaleStatus.high),
true);
});
test('Pitch Model isCorrectPitch', () {
PitchModel pitchModel = new PitchModel();
expect(
pitchModel.isCorrectPitch(
STANDARD_PITCH, YulmyeongNote(Yulmyeong.tae, ScaleStatus.origin)),
true);
});
test('Pitch Model isCorrectPitch', () {
PitchModel pitchModel = new PitchModel();
expect(
pitchModel.isCorrectPitch(
STANDARD_PITCH, YulmyeongNote(Yulmyeong.tae, ScaleStatus.high)),
false);
});
test('Singleton test', () {
PitchModelInterface pitchModel = new PitchModel();
PitchModelInterface pitchModel2 = new PitchModel();
//PitchModel pitchModel3 = new PitchModel();
pitchModel.settingAdjust(760.11);
expect(
pitchModel2.isCorrectPitch(
760.11, new YulmyeongNote(Yulmyeong.tae, ScaleStatus.origin)),
true);
});
JungGanBo Interface #
This is JungGanBo Interface.
Abstract #
- inprogress
InterFace #
inprogress ....
Usage #
-
Jung Gan Bo Example Image
-
Jung Gan Bo string structure
ht|t|t#t|h|mh#J|o|YJ#t|--h|m#ht-|t|t#h-t|h-m|yj-#y|mhm|ymy#j|o|^#ht|t|t#t|--h|mh#J|o|YJ#t|--h|m#ht-|t|t#h-t|h-m|yj-#y|mhm|ymy#j|o|^#y-j|y-m|yj#y-j|y-m|yj|m|m|h#m|--h|mh#ht|t|t#t|h|mh#J|o|YJ#t|--h|m#ht-|t|t#h-t|h-m|yj-#y|mhm|ymy#j|o|^#
- Jung Gan Bo Function Usage
void playJungGanBo() async {
JungGanBo testJungGanBo = new JungGanBo("๋๋ผ์งํ๋ น", "์ธ๋ง์น์ฅ๋จ",
"ht|t|t#t|h|mh#J|o|YJ#t|--h|m#ht-|t|t#h-t|h-m|yj-#y|mhm|ymy#j|o|^#ht|t|t#t|--h|mh#J|o|YJ#t|--h|m#ht-|t|t#h-t|h-m|yj-#y|mhm|ymy#j|o|^#y-j|y-m|yj#y-j|y-m|yj|m|m|h#m|--h|mh#ht|t|t#t|h|mh#J|o|YJ#t|--h|m#ht-|t|t#h-t|h-m|yj-#y|mhm|ymy#j|o|^#");
testJungGanBo.sheet[0].yulmyeongs[0];
for (var i = 0; i < testJungGanBo.sheet.length; i++) {
for (var j = 0; j < testJungGanBo.sheet[i].yulmyeongs.length; j++) {
// To do what you can do with YulmyeonNote
print(testJungGanBo.sheet[i].yulmyeongs[j].toHangeul());
}
}
}
Additional information #
What is yulmyeong(์จ๋ช ) and danso(๋จ์) #
Yulmyeong is Korean Traditional Notes for music. And danso is Korean Traditional instrument. more information soon...
Terms of JungGanBo #
์ ๊ฐ๋ณด๋ฅผ ์ฝ๋ ์์๋ ์์์ ์๋๋ก, ์ค๋ฅธ์ชฝ ์ค์์ ์ผ์ชฝ ์ค๋ก ์ฝ์ด๋๊ฐ๋ค. ๋ค๋ง ์ ๊ฐ ์์ ์จ๋ช ์ ์ผ์ชฝ์์ ์ค๋ฅธ์ชฝ์ผ๋ก ์ฝ์ ๋ค์ ์์์ ์๋๋ก ์ฝ๋๋ค. ์ ๊ฐ๋ณด์ ์ฐ์ด๋ ์ฉ์ด์ ์ค์ํ ๋ถํธ๋ ๋ค์๊ณผ ๊ฐ๋ค.
- ๊ฐ : ์ค์ ๋ณด์ ํ ๋จ์ ํด๋นํ๋ ๊ฒ์ โ๊ฐโ ์ด๋ผ ํ๋ค.
- ๊ฐ : ์ค์ ๋ณด์ ํ๋ง๋์ ํด๋นํ๋ ๊ฒ์ โ๊ฐโ ์ด๋ผ ํ๋ค.
- ์ : ์ค์ ๋ณด์ ํ ๋ฐ์ ํด๋นํ๋ ๊ฒ์ โ์ โ ์ด๋ผ ํ๋ค.