#russian #lyrics #chord #stress #nlp

bin+lib amdm

Rust client for amdm.ru with Russian lyrics stress marking and meter analysis

1 unstable release

Uses new Rust 2024

0.1.0 Jan 25, 2026

#2213 in Text processing

MIT license

140KB
2.5K SLoC

amdm

Rust client for amdm.ru (Russian guitar chord database) with Russian lyrics stress marking and meter analysis.

Features

  • Fetch songs, search results, and artist pages from amdm.ru
  • Parse guitar chords with transposition support
  • Russian stress mark annotation using neural networks (ONNX models)
  • Syllable meter analysis for Russian poetry/lyrics

CLI Usage

# Search for songs
amdm "мельница голубая трава"

# Show full lyrics with chords
amdm show "мельница голубая трава"

# Show Nth search result
amdm show "мельница" 3

# Fetch artist page
amdm artist melnitsa

# Output as JSON
amdm show "мельница" --json

# Add stress marks to lyrics (downloads models on first use)
amdm show "мельница голубая трава" --stress

# Show meter analysis
amdm show "мельница голубая трава" --meter

Library Usage

use amdm_rs::{AmdmClient, Result};

#[tokio::main]
async fn main() -> Result<()> {
    let client = AmdmClient::new()?;

    // Search for songs
    let results = client.search("мельница", 1).await?;

    // Fetch a song
    if let Some(result) = results.results.first() {
        let song = client.song_from_result(result).await?;
        println!("{} - {}", song.meta.artist_name, song.meta.song_title);

        for section in &song.sections {
            for line in &section.lines {
                println!("{}", line.lyrics);
            }
        }
    }

    Ok(())
}

Stress Marking

The stress engine uses ONNX models from the ruaccent project. Models are downloaded automatically to your system cache directory on first use (~50MB).

use amdm_rs::stress::StressEngine;

let mut engine = StressEngine::load(&model_path)?;
let stressed = engine.process("привет мир");
// Output: "прив+ет м+ир" (+ marks stressed vowels)

License

MIT

Dependencies

~11–31MB
~414K SLoC