ceol

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package ceol provides functionality to handle .ceol files and .ceol encoded data (Bosca Ceoil files)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DurationFromQuarters

func DurationFromQuarters(bpm, quarters int) time.Duration

DurationFromQuarters should not be here, should be in a package managing bpm and time Duration from quarters expects four quarters to occur per beat, (direct complaints at terry cavanagh), and returns a time.Duration for n quarters in the given bpm.

Types

type Ceol

type Ceol struct {
	Version       int
	Swing         int
	Effect        int
	EffectValue   int
	Bpm           int
	PatternLength int
	BarLength     int
	Instruments   []Instrument
	Patterns      []Pattern
	LoopStart     int
	LoopEnd       int
	Arrangement   [][8]int
}

Ceol represents a complete .ceol file

func Open

func Open(r io.Reader) (Ceol, error)

Open returns a Ceol from an io.Reader

func (Ceol) ChordPattern

func (c Ceol) ChordPattern() sequence.ChordPattern

ChordPattern converts a Ceol's patterns and arrangement into a playable chord pattern for sequences

type Filter

type Filter struct {
	Volume       int
	LPFCutoff    int
	LPFResonance int
}

Filter represents a single entry in a .ceol's pattern's filter block

type Instrument

type Instrument struct {
	Index        int
	IsDrumkit    int
	Palette      int
	LPFCutoff    int
	LPFResonance int
	Volume       int
}

Instrument represents a single entry in a .ceol's instrument block

type Note

type Note struct {
	PitchIndex int // C4 = 60
	Length     int
	Offset     int
}

Note represents a single entry in a .ceol's pattern's note block

type Pattern

type Pattern struct {
	Key        int
	Scale      int
	Instrument int
	Palette    int
	Notes      []Note
	Filters    []Filter
}

Pattern represents a single entry in a .ceol's pattern block

Jump to

Keyboard shortcuts

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