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 is supposed to implement the decoding of .splice drum machine files. See golang-challenge.com/go-challenge1/ for more information

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pattern

type Pattern struct {
	Version string
	Tempo   float32
	Tracks  []Track
}

Pattern is the high level representation of the drum pattern contained in a .splice file.

func DecodeFile

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

DecodeFile decodes the drum machine file found at the provided path and returns a pointer to a parsed pattern which is the entry point to the rest of the data.

func (*Pattern) Decode

func (p *Pattern) Decode(r io.Reader) error

Decode a binary sequence containing a drum pattern.

func (Pattern) String

func (p Pattern) String() string

String returns the pattern in a printable string

type Step

type Step uint8

Step is a single step in a track

func (Step) String

func (step Step) String() string

String returns a printable reprsentation of a step

type Track

type Track struct {
	ID    uint8
	Title string
	Steps [4][4]Step
}

Track contains a single track found in the .splice file

func (*Track) Decode

func (track *Track) Decode(r io.Reader) (uint, error)

Decode a track from a binrary sequence into track, returns the number of bytes read from the stream or an error

func (Track) String

func (track Track) String() string

String returns a printable reprsentation of a track

Jump to

Keyboard shortcuts

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