Songwriter Player

by mrrepac
5
4
3
2
1
Score: 51/100

Description

Obsidian plugin: advanced sidebar audio player for songwriting — waveform, marker, A-B loop zone, play counters

Reviews

No reviews yet.

Stats

0
stars
263
downloads
0
forks
64
days
18
days
18
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
46
commits

Latest Version

18 days ago

Changelog

🎧 Added

A track can be filed into the note you are looking at. The Copy track to current note command — or the same item in a playlist row's right-click menu — puts a copy in the vault's own attachment folder and embeds it in the note as a waveform. The marker, loop zone, counters and measured tempo and key travel with it, so the copy is not a stranger the plugin has to analyse all over again. Sending the same track twice links the copy already sitting there instead of piling up twins. The music does not stop: filing is not listening.

A track can leave for the world. Drag a playlist row — or the loaded track's name — into a note and it drops in as a link, as before. Hold Alt and the file itself goes out instead: to the explorer, the desktop, or an audio editor. REAPER only accepts a real file on disk, not the virtual one an ordinary browser drag offers, so Alt hands over the path the way the file explorer does. This was settled by experiment rather than documentation. The cost of splitting the two gestures: Alt-dragging into Obsidian itself does nothing. The native handoff is desktop-only.

A double click on an audio file in the file explorer plays it. A single click still behaves as it did.

The playlist can be ordered by name, tempo, play count, or how recently the file changed. The order you see is the order ⏮ ⏭ walk — one sequence, not two — and it is remembered. Folder playlists only: a list built from a note keeps the order the note gives it.

The A-B loop zone can be switched off. For anyone who does not loop fragments, zones were a hazard rather than a tool: a stray drag across the waveform made one, and a track with a zone then circled instead of moving down the list. Off, the drag stays a click, saved zones are ignored, and the playlist plays through. Nothing is deleted — switch it back on and the zones are where you left them.

The marker has a button. Dropping one used to mean tapping the stop key three times in a row, which is not something anyone finds by hand. The ⚑ button sits in the track row and appears only while there is a marker to drop.

⚡ Changed

While music is playing, opening notes no longer disturbs the player. Until now a note holding a single audio file replaced the whole queue the moment it opened — so a thirty-track folder collapsed to one file behind your back. The track kept playing, which is why this was easy to miss until you pressed next. Now the queue and the track are left alone while sound is playing; the offer to switch still appears, so nothing is taken away. Opening an audio file is still a direct instruction and still obeyed. The "always pick up" mode is unchanged, because that is what it says it does.

The offer no longer appears for a track that is already playing. Opening its own note — to read the lyrics, say — used to propose switching to what you were already listening to.

🛟 Fixed

A data.json that cannot be read is no longer replaced by an empty one. Obsidian hands a plugin nothing when the file will not parse, which is indistinguishable from a fresh install — and the next time the plugin unloaded, that emptiness was written over the file. Markers, loop zones, play counts and measurements, gone with no warning. A damaged file is now copied to data.json.bak, the plugin says so and stays out of the way: nothing is written over it until it is repaired or removed.

🧹 Under the hood

The rule for what happens when a file is opened now lives in one small module with a test for every branch, instead of being spread through the handler that also does the work. Playlist order and the choice of a copy's name are separate modules for the same reason. The settings tab moved out of main.ts, which had grown past a thousand lines.

Full changelog: https://github.com/mrrepac/obsidian-songwriter-player/compare/1.7.0...1.8.0

README file from

Github

Songwriter Player

An advanced sidebar audio player for songwriting.

Obsidian's embedded audio unloads as the note scrolls, and playback cuts off. Songwriter keeps the player in its own side panel: scroll your lyrics as much as you like — the music keeps playing. Playback even survives closing the panel (the sound lives in the plugin, not in the UI).

Читаете по-русски? Есть русская версия README.

Features

  • Right-sidebar panel — opened with the ribbon button (a note icon) or a command.
  • Pickup from the note — the player takes the audio from the note you open (an embed ![[song.mp3]] or a link [[song.mp3]]). If music is already playing, it offers to switch with a small banner instead of interrupting. The mode is configurable: hybrid / always / manual.
  • Track waveform:
    • single click — play from there (a click outside the loop zone clears the zone);
    • double click — set the marker;
    • press and drag — select an A-B zone;
    • drag a zone edge — move it (the cursor turns into ↔).
  • Marker (⚑) — one point per track: mark the spot you keep coming back to while working on a song. "Play from marker" always starts there (with no marker — from the start). The marker is remembered per file, and the ⚑ button in the track row drops it again — it appears only while there is one to drop.
  • A-B loop zone — a selected fragment of the waveform plays in a loop; the zone start automatically becomes the marker, so "Play from marker" restarts the loop from its beginning. Seeking outside the zone by hand does not drag you back — the loop only kicks in when playback itself reaches the B edge. The zone is remembered per file; clear it by clicking outside it or with the Clear A-B loop zone command (the marker stays). If zones only get in your way, switch them off in settings: a drag across the waveform stops selecting one, saved zones are ignored, and a track that has one plays through to the next instead of circling. Nothing is deleted — turning the setting back on brings the zones back.
  • Playlist — open a note holding several audio files and they line up as its playlist; open an audio file and every audio file next to it in the folder does. The list sits under the player (collapsible, remembers its state): the current track is highlighted, each row shows its play count and a ⚑ if the track has a marker, a click switches to it — and keeps playing if something was playing. ⏮ ⏭ walk the list, and the list survives ejecting the track, so you can pick the next one from it. Optionally the playlist plays through on its own; a track with an A-B zone keeps looping instead.
  • Drag a track out — drag a row (or the loaded track's name) into a note and it drops in as a link; hold Alt while dragging and the file itself goes out instead — to the system file explorer, the desktop, or an audio editor such as REAPER, which only accepts a real file on disk, not the virtual one an ordinary browser drag offers. Alt-dragging into Obsidian itself does nothing — that is the deliberate cost of splitting the two gestures. The native handoff is desktop-only; on mobile there is no such route.
  • Order the playlist — the button in the playlist header sorts it by name, tempo, play count or how recently the file changed; the chosen order is what ⏮ ⏭ walk, and it is remembered. Folder playlists only: a playlist built from a note keeps the order the note itself gives it.
  • Copy a track into the note you are looking at — the Copy track to current note command, or the same item in a playlist row's right-click menu. The copy lands in the vault's own attachment folder and is embedded in the note as a waveform; the track's marker, loop zone, counters and measured tempo and key come with it. Playback is not interrupted — filing is not listening. Sending the same track again links the copy that is already there instead of making a twin.
  • Play count and total listened time — next to the track name (▶ 27 · 2h40m). A run only counts once 5 seconds have actually sounded (start-and-stop does not count; pause-and-resume keeps accumulating). Every loop-zone pass is a new run. Listened time accumulates only while sound is actually playing. Right-click the counter to reset both.
  • Back to the track's note — click the track name (or Alt+D) to jump to the note the track was picked up from: if it is open in a tab, that tab is focused, otherwise the note opens; if the source is unknown, any note linking to the file is used.
  • Unload track — the ⏏ button in the track row (or the Unload track command): the player clears and holds nothing while you work on other things; the hotkeys cannot fire by accident. Load a track again with the "Load audio from the note" button or just by opening a note with audio.
  • Open externally (ported from the Open Audio Externally plugin): a ⧉ button to the right of the track name in the panel — and the same button next to every embedded audio player in notes. Click opens the file in the default app, right-click reveals it in the system explorer. Commands: Open track in default app, Reveal track in system explorer. The embedded-player buttons can be turned off in settings.

The marker and the zone are visible right on the waveform (an orange flag and a highlighted fragment) — there are no separate indicators in the panel. Time, buttons and volume share a single line under the waveform.

Hotkeys (defaults)

All commands can be rebound in Settings → Hotkeys. The Russian keyboard layout is duplicated out of the box.

Command Keys
Play from marker (or from start) Alt+X
Stop (double press: the next Alt+X plays from the start, marker intact; triple: the marker and the zone are deleted) Alt+C
Set marker at current position Alt+Z
Play/Pause Alt+P
Open track's note Alt+D
Seek back / forward Alt+, / Alt+.
Previous / next track in the playlist Alt+B / Alt+N
Play slower / faster (one bpm a step, the key stays put) Alt+- / Alt+=
Transpose down / up a semitone (desktop only) Alt+PageDown / Alt+PageUp
Play as recorded again — speed and key Alt+0

On the numeric keypad the four of them sit together, under one hand: Alt+÷ / Alt+× transpose down and up, Alt+− / Alt++ step the tempo.

Without default keys: Clear marker, Clear A-B loop zone, Load audio from current note, Open player panel, Unload track, Copy track to current note, Open track in default app, Reveal track in system explorer.

Settings

Besides the basics (pickup mode, seek step, start from marker) there is a playlist section (whole folder as a playlist, play the playlist through) and a fine-tuning one: the play-count threshold, the double-stop window, the waveform height, and the embedded-player button.

Data

Markers, loop zones and counters are stored in the plugin's data.json, keyed by the audio file path; when a file is renamed inside the vault, its data moves along automatically.

The interface follows Obsidian's language (English, or Russian when the app is set to Russian), works on desktop and mobile ("open externally" needs desktop).

Building

npm install
npm run build   # tsc typecheck + esbuild → main.js
npm run dev     # watch mode
npm test        # bundles the real source and drives it against stubs

The tests need no framework: they bundle src/ exactly as it ships, run it with a stub obsidian module, and drive the result — so what is checked is the artifact users install, not a restatement of the logic. The settings suite guards the round trip through data.json, where a field added to the type but forgotten in the migration is written faithfully and then dropped on the next start.

License

GNU AGPL-3.0. The plugin bundles essentia.js 0.1.3 (Music Technology Group, Universitat Pompeu Fabra) for tempo and key detection — it is licensed under the AGPL-3.0, so the combined work is too. The essentia sources are at https://github.com/MTG/essentia; the copy shipped inside main.js is the unmodified npm build.

Using the plugin carries no obligations. Distributing a modified version does: the source has to stay available under the same license.


Author: mrrepac · AGPL-3.0