Versions in this module Expand all Collapse all v1 v1.0.3 Mar 21, 2023 Changes in this version type Sheet + URL string v1.0.2 Mar 21, 2023 Changes in this version + const MidiEventSystemExclusive1 + const MidiEventSystemExclusive2 + const MidiEventTrack + const MidiEventTypeChanPrefix + const MidiEventTypeCopyright + const MidiEventTypeCuePoint + const MidiEventTypeEndOfTrack + const MidiEventTypeInstName + const MidiEventTypeKeySig + const MidiEventTypeLyricText + const MidiEventTypeMarkerText + const MidiEventTypeSMPTEOffset + const MidiEventTypeSeqNum + const MidiEventTypeSeqOrTrackName + const MidiEventTypeSeqSpecEvent + const MidiEventTypeTempo + const MidiEventTypeText + const MidiEventTypeTimeSig + func BatteryLevel() (int, error) — linux/amd64, windows/amd64 + func VariableLengthValue(data []byte) (value int32, byteSize int) v1.0.1 Jun 20, 2017 Changes in this version + const BeepNotation + const MidiEventMeta + const MidiEventMidi + const MidiEventSysEx + const SampleAmp16bit + const SampleRate + const SampleRate64 + var BuiltinMusic = []*Sheet + var DemoMusic = BuiltinMusic[0].Notation + var PrintNotes bool + var PrintSheet bool + func CloseSoundDevice() — linux/amd64, windows/amd64 + func DownloadVoiceFiles(music *Music, writer io.Writer, names []string) + func FlushSoundBuffer() — linux/amd64, windows/amd64 + func HertzToFreq(hertz float64) float64 + func HomeDir() string — linux/amd64, windows/amd64 + func InitSoundDevice() error — linux/amd64, windows/amd64 + func OpenSoundDevice(device string) error — linux/amd64, windows/amd64 + func SendBell() — linux/amd64, windows/amd64 + func StartWebServer(music *Music, address string) + func StopPlayBack() — linux/amd64, windows/amd64 + type Chord struct + func (c *Chord) Reset() + type Midi struct + Chunks []*MidiChunk + Format int + Ntracks int + OutputBuf []int16 + OutputFile *os.File + Playing bool + TickDiv int + Tracks []*MidiChunk + func ParseMidi(music *Music, filename string, printKeyboard bool) (*Midi, error) + func (midi *Midi) Play() + type MidiChunk struct + Data []byte + Size int + Type string + type MidiEvent struct + Delta int + Note *Note + NoteNumber byte + Start int + Type int + func (m *MidiEvent) CalcDuration(duration int, tickDiv int) + type Music struct + func NewMusic(output string) *Music + func (m *Music) Play(reader *bufio.Reader, volume100 int) + func (m *Music) Playback(buf1, buf2 []int16) + func (m *Music) Wait() + func (m *Music) WaitLine() + type Note struct + type Piano struct + func NewPiano() *Piano + func (p *Piano) ComputerVoice(enable bool) + func (p *Piano) GetNote(note *Note, sustain *Sustain) (found bool) + func (p *Piano) NaturalVoice() bool + func (p *Piano) NaturalVoiceFound() bool + func (p *Piano) Sustain() bool + func (p *Piano) SustainNote(note *Note, sustain *Sustain) + type Sheet struct + Dir string + ID int + Name string + Notation string + func NewSheet(name, dir, notation string) *Sheet + func (s *Sheet) Delete() error + func (s *Sheet) Exists() bool + func (s *Sheet) Load() error + func (s *Sheet) Path() string + func (s *Sheet) Save() error + type Sustain struct + func (s *Sustain) Ratio() float64 + type Violin struct + func NewViolin() *Violin + func (v *Violin) ComputerVoice(enable bool) + func (v *Violin) GetNote(note *Note, sustain *Sustain) (found bool) + func (v *Violin) NaturalVoice() bool + func (v *Violin) NaturalVoiceFound() bool + func (v *Violin) Sustain() bool + func (v *Violin) SustainNote(note *Note, sustain *Sustain) + type Voice interface + ComputerVoice func(enable bool) + GetNote func(note *Note, sustain *Sustain) bool + NaturalVoice func() bool + NaturalVoiceFound func() bool + Sustain func() bool + SustainNote func(note *Note, sustain *Sustain) + type WaveHeader struct + AudioFormat int + BitsPerSample int + BlockAlign int + ByteRate int + ChunkID string + ChunkSize int + Format string + NumChannels int + SampleRate int + Subchunk1ID string + Subchunk1Size int + Subchunk2ID string + Subchunk2Size int + func NewWaveHeader(channels, sampleRate, bitsPerSample, dataSize int) *WaveHeader + func (w *WaveHeader) ReadHeader(reader io.Reader) (int, error) + func (w *WaveHeader) String() string + func (w *WaveHeader) WriteHeader(writer io.Writer) (int, error) + type Web struct + func NewWeb(music *Music) *Web + func (w *Web) ServeHTTP(res http.ResponseWriter, req *http.Request)