Documentation ¶
Overview ¶
Package organya is a Go implementation of the Organya sound format. It can be used to parse Organya files and makes it possible to play them back using your own implementation.
Usage ¶
Reading an Organya file is very simple. Just use the `Open` method and provide the path to the Organya file:
package main import ( "pkg.nimblebun.works/go-organya" ) func main() { org, err := organya.Open("/path/to/file.org") if err != nil { panic(err) } // ... }
You can now take advantage of the methods and properties that are exposed to you.
Index ¶
Constants ¶
const ( // OrgTrackCount defines the number of possible Organya tracks in a file (16). OrgTrackCount int = 0x10 // OrgNoChange is the byte that specifies that a current resource property // must not be different from the one before it. OrgNoChange uint8 = 0xFF )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Organya ¶
type Organya struct { WaitValue uint16 `json:"waitValue"` LoopStart uint32 `json:"loopStart"` LoopEnd uint32 `json:"loopEnd"` Tracks [OrgTrackCount]Track `json:"tracks"` }
Organya defines the file data of an Organya file.
func (*Organya) NewSession ¶
NewSession will initialize a playback session on the provided Organya object.
type Resource ¶
type Resource struct { Start uint32 `json:"start"` Duration uint8 `json:"duration"` Note uint8 `json:"note"` Volume uint8 `json:"volume"` Pan uint8 `json:"pan"` }
Resource defines a single sound resource.
type Session ¶
type Session struct { Angles [OrgTrackCount]float64 ResourceUpTo [OrgTrackCount]uint16 CurrentClick uint32 Org *Organya }
Session is the playback session of an Organya object.
func (*Session) GetResource ¶
GetResource will return the current resource from the provided track.
func (*Session) TrackSounding ¶
TrackSounding specifies whether the provided track is active.