Show what the song plays around a pattern as ghost notes (#339)
A bass line is written against the chords it goes with. Until now the piano roll showed only the pattern itself, so writing a part to fit the rest of a song meant switching between the Pattern and the Song tab. - A double-click on a pattern item remembers song, item and the round clicked into for that pattern. The place lives in the session, not in the project, and goes by the item's id, so moving the item moves the ghost notes along. - Opened from the Assets panel, the pattern shows the item of the last double-click. Without one, a pattern that lies in exactly one item of all the songs shows that item's first round. - Ghost notes are the pattern items of the other tracks all along the song, and on the own track the items before and after and the other rounds of the item. The round edited itself does not count. Sound items have no notes. - A ghost note sits on the row it sounds with: its own transpose, less the transpose of the item the pattern was opened from. - The roll draws them grey, without an edge, under the notes. Resting on one names its track and its pattern. - The header has a Ghosts switch, on by default, and names where they come from, e.g. "Tune · Bass · bar 5". - The time axis pans back to the start of the song, with bar and grid lines before the pattern. Fit still frames only the pattern. - A click or a paste outside the pattern no longer lands. Before, only the time left of bar 1 was closed, notes could still be drawn past the end, where they are kept but never played. - The rounds of a pattern item are now worked out in one place, itemNotes() in song.ts, which songSequence() and the ghost notes share. Tests: - Unit ghosts (new): 5 green. Counter-check with the round edited not left out and the own transpose not taken off: 2 red. - Unit piano-roll: 1 new (pan back to the song, lines before bar 1). Counter-check without the song's start: red. - e2e 65 (melektaus-atx): ALL PASSED - 38 checks (3 new). The first run was red on the tooltip check: the ghost note it rested on lay a fifth up, outside the rows Fit frames. The test now uses a tone. - e2e 64 (melektaus-atx): ALL PASSED - 30 checks. - Gate (melektaus-atx): CHECK EXIT 0, 260 files, 4027 tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c33d6d98e5
commit
d505f6ed27
13 files changed
+521
-33
No files matched your search
@@ -10,6 +10,8 @@ import {
|
||||
songSequence,
|
||||
songTempo,
|
||||
} from '../../core/music/song';
|
||||
import { roundAt } from '../../core/music/ghosts';
|
||||
import { patternLength } from '../../core/music/pattern';
|
||||
import { songBuses } from '../../core/music/songBuses';
|
||||
import { sampleCount, takeName, takeStart, takeTrack, takeTrackIndex, wavBytes } from '../../core/music/take';
|
||||
import { ticksOfSeconds } from '../../core/music/time';
|
||||
@@ -106,7 +108,17 @@ export class SongEditor extends AssetTabEditor<SongAsset, SongTimeline> {
|
||||
const asset = this.asset();
|
||||
if (asset && this.isPlaying) this.music.setBuses(songBuses(this.state.project, { ...asset, tracks }));
|
||||
};
|
||||
timeline.onOpenPattern = (patternId) => activateAsset(state, patternId);
|
||||
timeline.onOpenPattern = (item, tick) => {
|
||||
const song = this.asset();
|
||||
const pattern = findAssetOf(state.project, item.asset, 'pattern');
|
||||
if (song && pattern)
|
||||
state.patternPlaces.set(pattern.id, {
|
||||
songId: song.id,
|
||||
itemId: item.id,
|
||||
round: roundAt(item, patternLength(pattern), tick),
|
||||
});
|
||||
activateAsset(state, item.asset);
|
||||
};
|
||||
timeline.onDiscardTake = () => this.stop({ discard: true });
|
||||
this.mount(timeline, [
|
||||
this.playButton,
|
||||
|
||||
Reference in new issue
Block a user