Home

Awesome

Go GoReportCard Coverage Status Go Reference

go-scala

A pure Go library to parse Scala SCL and KBM files to support microtunings

A reimplementation, in Go, of the Surge team's C++ tuning-library. This is mostly a copy of that library, but with some name changes and refactoring to make the library idiomatic Go.

This version of the Go library (tagged v1.2.0) corresponds to the release_1.1.0 tag of the source C++ library

Usage

$ go get github.com/chinenual/go-scala

Example

An example of using the API:

import (
  "github.com/chinenual/go-scala"
)
...
s,_ := scala.ScaleFromSCLFile("./my-scale.scl")
k,_ := scala.KeyboardMappingFromKBMFile("./my-mapping.kbm")
t,_ := scala.TuningFromSCLAndKBM(s,k)
fmt.Printf("The frequency of C4 and A4 are %v and %v\n",
    t.FrequencyForMidiNote(60)
    t.FrequencyForMidiNote(69))

Building and testing the library:

$ go get -v -t -d ./...
$ go build
$ go test