drum

package
v0.0.0-...-e04bdec Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2015 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package drum implements a simple library for Splice files. A Splice file typically ends with an extencion ".splice"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pattern

type Pattern struct {
	Hardware string  //hardware used to create file //[32]byte
	Tempo    float32 //tempo
	Tracks   []Track //slice of all tracks in file
	// contains filtered or unexported fields
}

Pattern contains high level splice data.

func DecodeFile

func DecodeFile(path string) (*Pattern, error)

DecodeFile reads and decodes a file of type Splice. Input: use argument 'path' to specify the Splice filename Output: returns a *Pattern of the data read and decoded Returns error if any errors are encountered.

func (*Pattern) String

func (p *Pattern) String() string

Prints Pattern, *p, in a human-readable format

type Track

type Track struct {
	ID int32 //unique id

	Name  string   //track name
	Steps [16]byte //notes for this track
	// contains filtered or unexported fields
}

Track contains information for a single track.

func (Track) PlayNote

func (t Track) PlayNote(s int) bool

PlayStep returns true if step, s, of Track t needs to be played (equals 1) Otherwise, returns false

func (Track) String

func (t Track) String() string

Prints Track, *t, in a human-readable format

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL