Skip to content

Commit

Permalink
#2295 テストにおいてSequencerSnapTicksを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
romot-co committed Nov 20, 2024
1 parent 1e23122 commit d15f3a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/components/Sing/SequencerRuler/index.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const meta: Meta<typeof Presentation> = {
tpqn: 480,
offset: 0,
numMeasures: 32,
sequencerSnapType: 4,
"onUpdate:playheadTicks": fn<(value: number) => void>(),
onDeselectAllNotes: fn(),
},
Expand Down
3 changes: 1 addition & 2 deletions src/sing/domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -593,8 +593,7 @@ export const shouldPlayTracks = (tracks: Map<TrackId, Track>): Set<TrackId> => {
};

/**
* 指定されたティックをグリッドに合わせて丸める。
* グリッドはsnapTicksの倍数になる。
* 指定されたティックを直近のグリッドに合わせる
*/
export function snapTicksToGrid(ticks: number, snapTicks: number): number {
return Math.round(ticks / snapTicks) * snapTicks;
Expand Down

0 comments on commit d15f3a8

Please sign in to comment.