Skip to content

About

smallhotelroom-app

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

smallhotelroom-app

Offline chord and lyric reader, string strum/arpeggio sequencer, polyrhythm metronome, and reference ear tuner built with Vite, React, SQLite (sql.js WASM), Capacitor, and Tauri.

Depends on smallhotelroom.github.io (git clone it next to this repository).

0. [optional] Linter install (VSCode extension)

npm run linter:install

1. Database (songs-official.db)

Generate the SQLite database (public/songs.db & dist-dbs/songs-official.db) from smallhotelroom.github.io Markdown songs, which defaults to official ("clean") configured via shr-config.yaml which uses variables that can be stored in your personal .env (see .env.example for example):

npm run db:build

[Optional] The previous command, depending on the files present in your device, can generate several database files. If you want the same command to do the same process but additionally merge them into an additional merged database at the end (slightly slower):

npm run db:build -- --merge

[Optional] For single custom inputs, e.g. the following outputs dist-dbs/songs-cosecha.db with playlist "cosecha":

npm run db:build -- --input ~/jgvictoresAsrob/chords/0-GUITAR/cosecha

[Optional] You can also cusomize the custom output path:

npm run db:build -- --input ~/jgvictoresAsrob/chords/0-GUITAR/cosecha --output dist-dbs/my-custom.db

2. PDF Generator

Build PDF from public/songs.db:

npm run pdf:build -- --output SmallHotelRoom.pdf 

More examples:

npm run pdf:build -- --db dist-dbs/songs-curated.db --playlist "Español" --template templates/espanol.tex --transpose -5 --capo-drop-correction --output Ukelele_Espanol.pdf

3. Local Web Development

nvm use
npm install
npm run dev

Build and preview the production web bundle locally:

npm run build
npm run preview

4. Android (via Docker)

First, download or build the Docker image (only needed once or when Dockerfile changes)

Option A: Pull the pre-built image (Fastest)

The build environment is hosted privately on the GitHub Container Registry to save time.

  1. Create a GitHub Personal Access Token (Classic) and check the read:packages scope.
  2. Log in to the registry (replace with your username and token):
    echo "YOUR_TOKEN" | docker login ghcr.io -u YOUR_USERNAME --password-stdin
  3. Later on (when you run the compiler), Docker will automatically pull the image.

Option B: Build locally

  1. Build the Docker compiler image:
    docker compose build

4.1. Android (via Docker): Debug

Compile the debug APK (android/app/build/outputs/apk/debug/app-debug.apk):

docker compose up

Install the debug APK onto a USB-connected Android device:

docker compose run --rm android-builder adb install -r android/app/build/outputs/apk/debug/app-debug.apk

If fails, possibly you may locally (sudo apt install android-tools-adb):

adb install -r android/app/build/outputs/apk/debug/app-debug.apk

More useful debug commands: debug/view live Android device logs:

docker compose run --rm android-builder adb logcat | grep -i capacitor

Even more useful debug commands: Open an interactive shell inside the Android builder container:

docker compose run --rm android-builder bash

4.2. Android (via Docker): Release APK

Or compile the release APK (ls android/app/build/outputs/apk/release/app-release-*.apk):

GRADLE_TASK=assembleRelease docker compose up

4.3. Android (via Docker): Play Store bundle

Or compile the Play Store bundle (ls android/app/build/outputs/bundle/release/app-release.aab):

GRADLE_TASK=bundleRelease docker compose up

5. iOS

Sync web assets and Capacitor plugins to the Xcode project (ios/):

npm run build
npx cap sync ios

Open in Xcode (requires macOS):

npx cap open ios

6. Guitar Pro to Small Hotel Room Markdown Importer

CLI Options

Flag Default Description
--list-tracks false Inspect tracks in a GP file (strings, capo, tuning, chord count, lyrics) and exit.
`--track <index name>` Auto
--chord-source <mode> auto Where to read harmony from: auto (explicit GP A chords, fallback to tab), chords (only explicit GP A chords, carried across non-rest bars), or tab (ignore GP labels, infer strictly from tab frets).
`--output <file dir>` Alongside input
--group-size <n> 4 Number of bars per (...) chord group.
--groups-per-line <n> 2 Number of (...) groups per line.
--enable-sections false Emit [Section] markers from Guitar Pro rehearsal marks.
--no-lyrics false Skip rough-draft lyrics extraction.
--stdout false Print generated Markdown to stdout instead of writing a file.

Inspect tracks in a file first:

npm run gp:import -- "file.gp5" --list-tracks

Basic conversion (auto-detect track, hybrid chord source):

npm run gp:import -- "file.gp"

Pick a specific track by index or name:

npm run gp:import -- "file.gp5" --track 0 --output "./imported/"
npm run gp:import -- "file.gp" --track "Acoustic" --output "./imported/"

Use only explicit Guitar Pro A-shortcut chords (useful when the tab contains riffs or arpeggios and the real harmony is marked with A):

npm run gp:import -- "file.gp" --chord-source chords

Ignore Guitar Pro chord labels and infer strictly from tab frets (useful when GP chord labels are missing or inaccurate):

npm run gp:import -- "file.gp5" --chord-source tab

Enable [Section] headers and preview in terminal:

npm run gp:import -- "file.gp" --enable-sections --stdout

Batch convert an entire folder of .gp / .gp5 files:

npm run gp:import -- "./gp-archive/" --output "./imported-md/"

Custom grouping (e.g., 2 bars per group, 4 groups per line, no lyrics):

npm run gp:import -- "file.gp" --group-size 2 --groups-per-line 4 --no-lyrics

7. How to bump version

E.g. bumping v0.2.0 to v0.2.1,

Manually upgrade android/app/build.gradle (required for Google Play):

versionCode 2
versionName "0.2.1"

Where:

  • versionCode 2 (an integer that must increment by +1 for every APK/AAB uploaded)
  • versionName "0.2.1" (the version string shown in Android App Info).

Then bump package.json and package-lock.json:

npm version v0.2.1 --no-git-tag-version

And finally create the annotated tag on latest commit and push it:

git tag -a v0.2.1 -m "v0.2.1 - <msg>"
git push origin v0.2.1

8. Notes on syntax

Syntax for custom chords section:

## Chords
Cmaj7: x32000
Bm7b5: x2323x
D5: x577xx
C#aug: x4322x
F#sus2: 244122 "Thumb on 6th"
G7 (uke): 0212
C#7 (uke): 1,1,1,4

About

smallhotelroom-app

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages