stage

package
v0.0.0-...-a4c0b9d Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Board

type Board struct {
	EventNote    gsignal.Event[int]
	EventVictory gsignal.Event[bool]
	// contains filtered or unexported fields
}

func NewBoard

func NewBoard(ctx *Context, config BoardConfig) *Board

func (*Board) ClearProgram

func (b *Board) ClearProgram()

func (*Board) Init

func (b *Board) Init(scene *ge.Scene)

func (*Board) ProgramTick

func (b *Board) ProgramTick(delta float64) bool

func (*Board) StartProgram

func (b *Board) StartProgram(prog SynthProgram)

type BoardConfig

type BoardConfig struct {
	Canvas *Canvas

	Level *gamedata.LevelData

	MaxInstruments int

	Targets []gamedata.Target
}

type Canvas

type Canvas struct {
	Running bool
	// contains filtered or unexported fields
}

func NewCanvas

func NewCanvas(ctx *Context, scene *ge.Scene, img *ebiten.Image) *Canvas

func (*Canvas) AddGraphics

func (c *Canvas) AddGraphics(o ge.SceneGraphics)

func (*Canvas) ClearPlot

func (c *Canvas) ClearPlot(id int)

func (*Canvas) Draw

func (c *Canvas) Draw()

func (*Canvas) DrawInstrumentIcon

func (c *Canvas) DrawInstrumentIcon(dst *ebiten.Image, kind gamedata.InstrumentKind, clr color.RGBA)

func (*Canvas) DrawPath

func (c *Canvas) DrawPath(dst *ebiten.Image, p vector.Path, width float32, clr ge.ColorScale)

func (*Canvas) DrawPathFilled

func (c *Canvas) DrawPathFilled(dst *ebiten.Image, p vector.Path, width float32, clr ge.ColorScale)

func (*Canvas) IsDisposed

func (c *Canvas) IsDisposed() bool

func (*Canvas) RedrawPlot

func (c *Canvas) RedrawPlot(id int, f *exprc.FuncRunner, points []gmath.Vec)

func (*Canvas) RenderWave

func (c *Canvas) RenderWave(clr color.RGBA, lineWidth float64, data []float64)

func (*Canvas) Reset

func (c *Canvas) Reset()

func (*Canvas) SetPlotHidden

func (c *Canvas) SetPlotHidden(id int, hidden bool)

func (*Canvas) Update

func (c *Canvas) Update(delta float64)

type Config

type Config struct {
	Data *gamedata.LevelData

	MaxInstruments int

	Targets []gamedata.Target

	Track gamedata.Track

	Mode gamedata.Mode
}

type Context

type Context struct {
	Scaler *gamedata.PlotScaler
	// contains filtered or unexported fields
}

func NewContext

func NewContext(config Config) *Context

type SampleSet

type SampleSet struct {
	PerSecond int
	Left      []float32
	Right     []float32
}

type SynthProgram

type SynthProgram struct {
	Length      float64
	Instruments []SynthProgramInstrument
}

type SynthProgramInstrument

type SynthProgramInstrument struct {
	ID     int // The channel is identical
	Index  int
	Func   *exprc.FuncRunner
	Period float64
	Kind   gamedata.InstrumentKind
}

type Synthesizer

type Synthesizer struct {
	EventRedrawPlotRequest gsignal.Event[int]
	// contains filtered or unexported fields
}

func NewSynthesizer

func NewSynthesizer(ctx *Context, sf *synthdb.SoundFont) *Synthesizer

func (*Synthesizer) CreatePCM

func (s *Synthesizer) CreatePCM(progress *float64) (*SampleSet, SynthProgram)

func (*Synthesizer) CreateProgram

func (s *Synthesizer) CreateProgram(instrumentSelector int) SynthProgram

func (*Synthesizer) ExportTrack

func (s *Synthesizer) ExportTrack() gamedata.Track

func (*Synthesizer) ForceReload

func (s *Synthesizer) ForceReload()

func (*Synthesizer) GetInstrumentFunction

func (s *Synthesizer) GetInstrumentFunction(id int) *exprc.FuncRunner

func (*Synthesizer) GetInstrumentPeriodPoints

func (s *Synthesizer) GetInstrumentPeriodPoints(id int) []gmath.Vec

func (*Synthesizer) HasChanges

func (s *Synthesizer) HasChanges() bool

func (*Synthesizer) Init

func (s *Synthesizer) Init(scene *ge.Scene)

func (*Synthesizer) IsDisposed

func (s *Synthesizer) IsDisposed() bool

func (*Synthesizer) SetInstrumentEnabled

func (s *Synthesizer) SetInstrumentEnabled(id int, enabled bool)

func (*Synthesizer) SetInstrumentFunction

func (s *Synthesizer) SetInstrumentFunction(id int, fx string)

func (*Synthesizer) SetInstrumentPatch

func (s *Synthesizer) SetInstrumentPatch(id int, index int)

func (*Synthesizer) SetInstrumentPeriod

func (s *Synthesizer) SetInstrumentPeriod(id int, periodFunc string) error

func (*Synthesizer) SetInstrumentVolume

func (s *Synthesizer) SetInstrumentVolume(id int, volume float64)

func (*Synthesizer) Update

func (s *Synthesizer) Update(delta float64)

Jump to

Keyboard shortcuts

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