danso_function 2.0.0 copy "danso_function: ^2.0.0" to clipboard
danso_function: ^2.0.0 copied to clipboard

This is a package for danso-flutter-application

danso_function ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ #

v 2.0.0 is released!! Applied Null Safety

Release Note #

## 2.0.0

- Applied Null Safety

## 1.0.3

- Hot fix!! deleted assets for ios

## 1.0.2

- Hot fix!! deleted assets for ios

## 1.0.1

- Hot fix!! deleted flutterMidi.unmute()

## 1.0.0

- Finally Made all the functions danso application needed ๐Ÿ”ฅ๐Ÿ”ฅ
- But, need some subtle adjustment, so will be updated continuosly

## 0.0.6

- Made playJungGanBo(JungGanBo jungGanBo) function!!
- But Need to adjust

## 0.0.5

- Hot Fix!! Need to change jung gan bo string structure and Accept it!

## 0.0.4

- Completed JungGanBoClass
- Passed all the Test about JungGanBoClass

## 0.0.3

- Made toChineseCharacter and toHangeul in YulmyeongNote class

## 0.0.2

- PitchModelInterface for danso yulmyeong
- Made as Singleton.
- It maps user input frequencies to danso yulmyeong

## 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!


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 #

  1. Frequency์™€ ๋‹จ์†Œ์˜ ์œจ๋ช…์„ mapping ์‹œ์ผœ์ค€๋‹ค. function #1
  2. User์—๊ฒŒ ๊ธฐ์ค€์Œ์„ ์ž…๋ ฅ๋ฐ›์•„์„œ ๊ธฐ์ค€ ์ž…์ถœ๋ ฅ frequency์—๋‹ค๊ฐ€ userAdjust๋ฅผ ๋”ํ•ด์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•œ๋‹ค. function #2
  3. userWidthFrequency๋ฅผ ์ •ํ•ด์„œ Hit ๋˜๋Š” Frequency์˜ ๋ฒ”์œ„๋ฅผ ์ •ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•œ๋‹ค. function #3
  4. ์Œ์ด ํ•ด๋‹น ์œจ๋ช…์— ๋งž๋Š”์ง€ ๊ฒ€์‚ฌํ•ด ์ฃผ๋Š” ๊ธฐ๋Šฅ์„ ํ•œ๋‹ค. function #4
  5. ํ•ด๋‹น ์œจ๋ช…์˜ frequency๋ฅผ return ํ•˜๋Š” ๊ธฐ๋Šฅ์„ ํ•œ๋‹ค. function #5
  6. ์œจ๋ช… List์˜ ์Œ์„ ์™„๋งŒํ•˜๊ฒŒ ํ‰๊ท ๊ฐ’์„ ๋‚ด ์ฃผ๋Š” ๊ธฐ๋Šฅ์„ ํ•œ๋‹ค function #6

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) {}

  //function #6
  double getModerateAverageFrequencyByListOfPitches(List<double> pitches) {}
}

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);

  });

  test('getModerateAverageFrequencyByListOfPitches Test' , () {
    List<double> testList = [700.0, 650.0, 1.3, 1680.1, 750.0];
    PitchModelInterface testModel = new PitchModel();
    expect(testModel.getModerateAverageFrequencyByListOfPitches(testList), 700.0);
  });


JungGanBo #

This is JungGanBo Class. JungGanBo is made of Jung and Jung is made of YulmyeongNote. Therefore, JungGanBo has a list member of Jung named sheet, and Jung has a list of Yulmyeong named yulmyeongs. This class also pallerize JungGanBo String Format.

Abstract #

  1. Constructor : FlutterMidi() ๊ฐ์ฒด๋ฅผ ๋ฏธ๋ฆฌ ์ƒ์„ฑํ•ด ๋‘๊ณ  SoundFont๋„ ๋„ฃ์–ด์„œ ๋ฏธ๋ฆฌ ์„ธํŒ… ํ•ด ๋‘”๋‹ค.
  2. ํ•ด๋‹น ์ •๊ฐ„๋ณด์˜ ์Œ์„ ๋‹จ์†Œ์— ์žฅ๋‹จ์˜ ์†๋„์— ๋งž์ถฐ์„œ ์„ค์ • ํ•ด ์ค€๋‹ค. function#1
  3. ํ•˜๋‚˜์˜ ์Œ์„ ์›ํ•˜๋Š” ์‹œ๊ฐ„ ๋งŒํผ ์—ฐ์ฃผํ•ด ์ค€๋‹ค. function#2

Class #

class JungGanBo implements JungGanBoInterface {
    String _title;
    JangDan _jangDan;
    List<Jung> _sheet = [];

    String get title => _title;
    JangDan get jangDan => _jangDan;
    List<Jung> get sheet => _sheet;
    //todo make method

    JungGanBo(String title, String jangDan, String formatString) {
        _title = title;
        setJangDanString(jangDan);
        setJungGanBoSheetFromFormatString(formatString);
    }
    ...
}

class Jung {
  DivisionStatus _divisionStatus;
  List<YulmyeongNote> _yulmyeongs = [];

  DivisionStatus get divisionStatus => _divisionStatus;
  List<YulmyeongNote> get yulmyeongs => _yulmyeongs;

  Jung(String formatString) {
    ...
  }
  ...
}

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());
      }
    }
  }

JungGanBoPlayer #

This is JungGanBoPlayer to play JungGanBo Class.

Abstract #

  1. Constructor : FlutterMidi() ๊ฐ์ฒด๋ฅผ ๋ฏธ๋ฆฌ ์ƒ์„ฑํ•ด ๋‘๊ณ  SoundFont๋„ ๋„ฃ์–ด์„œ ๋ฏธ๋ฆฌ ์„ธํŒ… ํ•ด ๋‘”๋‹ค.
  2. ํ•ด๋‹น ์ •๊ฐ„๋ณด์˜ ์Œ์„ ๋‹จ์†Œ์— ์žฅ๋‹จ์˜ ์†๋„์— ๋งž์ถฐ์„œ ์„ค์ • ํ•ด ์ค€๋‹ค. function#1
  3. ํ•˜๋‚˜์˜ ์Œ์„ ์›ํ•˜๋Š” ์‹œ๊ฐ„ ๋งŒํผ ์—ฐ์ฃผํ•ด ์ค€๋‹ค. function#2

Class #

class JungGanBoPlayer {
  FlutterMidi _flutterMidi = FlutterMidi();
  JungGanBo _jungGanBo;

  JungGanBoPlayer() {
    ...
  }
  // function 1
  play(JungGanBo jungGanBo) {
    ...
  }
  // function 2
  playOneNoteDurationTime(YulmyeongNote yulmyeongNote, int durationTime) {
    ...
  }
}

JangDan Class #

This is JangDan class.

Abstract #

  1. ์žฅ๋‹จํด๋ž˜์Šค๋Š” enum jangDanType์„ ๊ฐ€์ง€๊ณ  ์žˆ๋‹ค.
  2. ์žฅ๋‹จํด๋ž˜์Šค์—์„œ ํ•ด๋‹น jangDanType์— ๋Œ€ํ•œ tempo์™€ 1์ •์— ๋ช‡์ดˆ์˜ ์‹œ๊ฐ„์ด ์†Œ์š”๋˜์•ผ ํ•˜๋Š” ์ง€๊ฐ€ ์ •์˜ ๋˜์–ด ์žˆ๋‹ค.

Class #

class JangDan {
  JangDan(JangDanType jangDanType) {
    ...
  }

  JangDanType get jangDanType => ...;
  double get tempo => ...;
  int get milliSecond => ...;
  ...
}

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 #

์ •๊ฐ„๋ณด๋ฅผ ์ฝ๋Š” ์ˆœ์„œ๋Š” ์œ„์—์„œ ์•„๋ž˜๋กœ, ์˜ค๋ฅธ์ชฝ ์ค„์—์„œ ์™ผ์ชฝ ์ค„๋กœ ์ฝ์–ด๋‚˜๊ฐ„๋‹ค. ๋‹ค๋งŒ ์ •๊ฐ„ ์†์˜ ์œจ๋ช…์€ ์™ผ์ชฝ์—์„œ ์˜ค๋ฅธ์ชฝ์œผ๋กœ ์ฝ์€ ๋‹ค์Œ ์œ„์—์„œ ์•„๋ž˜๋กœ ์ฝ๋Š”๋‹ค. ์ •๊ฐ„๋ณด์— ์“ฐ์ด๋Š” ์šฉ์–ด์™€ ์ค‘์š”ํ•œ ๋ถ€ํ˜ธ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.

  • ๊ฐ : ์˜ค์„ ๋ณด์˜ ํ•œ ๋‹จ์— ํ•ด๋‹นํ•˜๋Š” ๊ฒƒ์„ โ€˜๊ฐโ€™ ์ด๋ผ ํ•œ๋‹ค.
  • ๊ฐ• : ์˜ค์„ ๋ณด์˜ ํ•œ๋งˆ๋””์— ํ•ด๋‹นํ•˜๋Š” ๊ฒƒ์„ โ€˜๊ฐ•โ€™ ์ด๋ผ ํ•œ๋‹ค.
  • ์ • : ์˜ค์„ ๋ณด์˜ ํ•œ ๋ฐ•์— ํ•ด๋‹นํ•˜๋Š” ๊ฒƒ์„ โ€˜์ •โ€™ ์ด๋ผ ํ•œ๋‹ค.
2
likes
100
pub points
0%
popularity

Publisher

unverified uploader

This is a package for danso-flutter-application

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, flutter_midi

More

Packages that depend on danso_function