Skip to content

Latest commit

 

History

History
44 lines (31 loc) · 1.23 KB

README.md

File metadata and controls

44 lines (31 loc) · 1.23 KB

go-ultrastar

Go Reference

This project provides multiple Go packages for working with UltraStar songs. Have a look at the Docs.

Packages

The main ultrastar package implements the main types for programmatically interacting with karaoke songs.

The txt subpackage implements a parser and a serializer for the UltraStar TXT format.

Installation

go get codello.dev/ultrastar

Quick Start

import (
  "codello.dev/ultrastar"
  "codello.dev/ultrastar/txt"
)

// Parse song from a file
file, _ := os.Open("some/song.txt")
defer file.Close()
song, err := txt.ReadSong(file)

// Do some transformations
song.Title = "Never Gonna Give You Up"
song.MusicP1.ConvertToLeadingSpaces()
// Work with GAP, VIDEOGAP, etc. using native Go types
song.Gap = 2 * time.Second
// The ultrastar package provides convenient types for Pitches, Beats, BPM, ...
song.MusicP1.Notes[2].Pitch = ultrastar.NamedPitch("F#2")

// Write song back to file
err = txt.WriteSong(file, song)

Have a look at the Docs to see everything you can do.