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: 8 Imported by: 0

README

Implementation of the Go Challenge 1

  • Author: Alexandre Grison
  • Country: France
  • Twitter: @algrison

Thanks for the challenge :-)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pattern

type Pattern struct {
	// contains filtered or unexported fields
}

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

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 NewPattern

func NewPattern(version string, tempo float32) *Pattern

NewPattern creates a new Pattern instance from its Splice version and tempo

func (*Pattern) AddTrack

func (p *Pattern) AddTrack(track *Track)

AddTrack adds a Track to a Pattern

func (*Pattern) String

func (p *Pattern) String() string

String formats a Pattern as a String using the challenge specified format

type Track

type Track struct {
	// contains filtered or unexported fields
}

Struct representing a Track inside a Splice

func NewTrack

func NewTrack(id int64, name string, seq []byte) *Track

NewTrack creates a new track instance from its id, name and sequence

func (*Track) String

func (t *Track) String() string

String formats a Track as a String where steps are grouped by 4 and separated with a pipe character

Jump to

Keyboard shortcuts

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