Skip to content
This repository was archived by the owner on Mar 2, 2025. It is now read-only.

music を jotai で管理するように変更 #39

Merged
merged 4 commits into from
Sep 16, 2024

Conversation

SatooRu65536
Copy link
Member

@SatooRu65536 SatooRu65536 commented Sep 14, 2024

close #36

  • curveCoordinates, highlightedSections を atom に置き換え
  • intervalsbeats を atom で定義
    • curveCoordinates, highlightedSections が更新されると intervalsbeats も勝手に更新される
    • Read Onry / Wright Only について: https://jotai.org/docs/core/atom
    • これに合わせて不要な部分を削除
  • settingsAtom を追加
  • music を atom に置き換え

色々やってるけど、これまでの動作自体に変化がなければ(一旦は)問題ないです!

atom の流れは↓な感じです
左端の atom が更新されると矢印の先の atom も合わせて更新されていきます

graph LR
    subgraph 設定関係
        bpnAtom --> settingsAtom
        octaveRangeAtom --> settingsAtom
        barCountAtom --> settingsAtom
        beatCountAtom --> settingsAtom
        minNoteDurationAtom --> settingsAtom
    end

    subgraph draw画面
        curveCoordinatesAtom -- createInterval() --> intervalsAtom
    end

    subgraph tap画面
        highlightedSectionsAtom -- highlightMap2Beat() --> beatsAtom
    end

    intervalsAtom --> musicAtom
    beatsAtom --> musicAtom
    settingsAtom --> musicAtom
    musicAtom -- createMusic() --> d(music)
Loading

Copy link
Collaborator

@NenfuAT NenfuAT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tap動作の方は問題なさそうです

@SatooRu65536 SatooRu65536 merged commit 52e96c2 into main Sep 16, 2024
1 check passed
@SatooRu65536 SatooRu65536 deleted the issues/36-feat-music-atom branch September 16, 2024 11:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

music を jotai に持たせる
2 participants