meltysynth

package
v0.0.0-...-05d3113 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2023 License: MIT Imports: 6 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instrument

type Instrument struct {
	Name    string
	Regions []*InstrumentRegion
}

type InstrumentRegion

type InstrumentRegion struct {
	Sample *SampleHeader
	// contains filtered or unexported fields
}

func (*InstrumentRegion) GetAttackModulationEnvelope

func (region *InstrumentRegion) GetAttackModulationEnvelope() float32

func (*InstrumentRegion) GetAttackVolumeEnvelope

func (region *InstrumentRegion) GetAttackVolumeEnvelope() float32

func (*InstrumentRegion) GetChorusEffectsSend

func (region *InstrumentRegion) GetChorusEffectsSend() float32

func (*InstrumentRegion) GetCoarseTune

func (region *InstrumentRegion) GetCoarseTune() int32

func (*InstrumentRegion) GetDecayModulationEnvelope

func (region *InstrumentRegion) GetDecayModulationEnvelope() float32

func (*InstrumentRegion) GetDecayVolumeEnvelope

func (region *InstrumentRegion) GetDecayVolumeEnvelope() float32

func (*InstrumentRegion) GetDelayModulationEnvelope

func (region *InstrumentRegion) GetDelayModulationEnvelope() float32

func (*InstrumentRegion) GetDelayModulationLfo

func (region *InstrumentRegion) GetDelayModulationLfo() float32

func (*InstrumentRegion) GetDelayVibratoLfo

func (region *InstrumentRegion) GetDelayVibratoLfo() float32

func (*InstrumentRegion) GetDelayVolumeEnvelope

func (region *InstrumentRegion) GetDelayVolumeEnvelope() float32

func (*InstrumentRegion) GetEndAddressOffset

func (region *InstrumentRegion) GetEndAddressOffset() int32

func (*InstrumentRegion) GetEndLoopAddressOffset

func (region *InstrumentRegion) GetEndLoopAddressOffset() int32

func (*InstrumentRegion) GetExclusiveClass

func (region *InstrumentRegion) GetExclusiveClass() int32

func (*InstrumentRegion) GetFineTune

func (region *InstrumentRegion) GetFineTune() int32

func (*InstrumentRegion) GetFrequencyModulationLfo

func (region *InstrumentRegion) GetFrequencyModulationLfo() float32

func (*InstrumentRegion) GetFrequencyVibratoLfo

func (region *InstrumentRegion) GetFrequencyVibratoLfo() float32

func (*InstrumentRegion) GetHoldModulationEnvelope

func (region *InstrumentRegion) GetHoldModulationEnvelope() float32

func (*InstrumentRegion) GetHoldVolumeEnvelope

func (region *InstrumentRegion) GetHoldVolumeEnvelope() float32

func (*InstrumentRegion) GetInitialAttenuation

func (region *InstrumentRegion) GetInitialAttenuation() float32

func (*InstrumentRegion) GetInitialFilterCutoffFrequency

func (region *InstrumentRegion) GetInitialFilterCutoffFrequency() float32

func (*InstrumentRegion) GetInitialFilterQ

func (region *InstrumentRegion) GetInitialFilterQ() float32

func (*InstrumentRegion) GetKeyNumberToModulationEnvelopeDecay

func (region *InstrumentRegion) GetKeyNumberToModulationEnvelopeDecay() int32

func (*InstrumentRegion) GetKeyNumberToModulationEnvelopeHold

func (region *InstrumentRegion) GetKeyNumberToModulationEnvelopeHold() int32

func (*InstrumentRegion) GetKeyNumberToVolumeEnvelopeDecay

func (region *InstrumentRegion) GetKeyNumberToVolumeEnvelopeDecay() int32

func (*InstrumentRegion) GetKeyNumberToVolumeEnvelopeHold

func (region *InstrumentRegion) GetKeyNumberToVolumeEnvelopeHold() int32

func (*InstrumentRegion) GetKeyRangeEnd

func (region *InstrumentRegion) GetKeyRangeEnd() int32

func (*InstrumentRegion) GetKeyRangeStart

func (region *InstrumentRegion) GetKeyRangeStart() int32

func (*InstrumentRegion) GetModulationEnvelopeToFilterCutoffFrequency

func (region *InstrumentRegion) GetModulationEnvelopeToFilterCutoffFrequency() int32

func (*InstrumentRegion) GetModulationEnvelopeToPitch

func (region *InstrumentRegion) GetModulationEnvelopeToPitch() int32

func (*InstrumentRegion) GetModulationLfoToFilterCutoffFrequency

func (region *InstrumentRegion) GetModulationLfoToFilterCutoffFrequency() int32

func (*InstrumentRegion) GetModulationLfoToPitch

func (region *InstrumentRegion) GetModulationLfoToPitch() int32

func (*InstrumentRegion) GetModulationLfoToVolume

func (region *InstrumentRegion) GetModulationLfoToVolume() float32

func (*InstrumentRegion) GetPan

func (region *InstrumentRegion) GetPan() float32

func (*InstrumentRegion) GetReleaseModulationEnvelope

func (region *InstrumentRegion) GetReleaseModulationEnvelope() float32

func (*InstrumentRegion) GetReleaseVolumeEnvelope

func (region *InstrumentRegion) GetReleaseVolumeEnvelope() float32

func (*InstrumentRegion) GetReverbEffectsSend

func (region *InstrumentRegion) GetReverbEffectsSend() float32

func (*InstrumentRegion) GetRootKey

func (region *InstrumentRegion) GetRootKey() int32

func (*InstrumentRegion) GetSampleEnd

func (region *InstrumentRegion) GetSampleEnd() int32

func (*InstrumentRegion) GetSampleEndLoop

func (region *InstrumentRegion) GetSampleEndLoop() int32

func (*InstrumentRegion) GetSampleModes

func (region *InstrumentRegion) GetSampleModes() int32

func (*InstrumentRegion) GetSampleStart

func (region *InstrumentRegion) GetSampleStart() int32

func (*InstrumentRegion) GetSampleStartLoop

func (region *InstrumentRegion) GetSampleStartLoop() int32

func (*InstrumentRegion) GetScaleTuning

func (region *InstrumentRegion) GetScaleTuning() int32

func (*InstrumentRegion) GetStartAddressOffset

func (region *InstrumentRegion) GetStartAddressOffset() int32

func (*InstrumentRegion) GetStartLoopAddressOffset

func (region *InstrumentRegion) GetStartLoopAddressOffset() int32

func (*InstrumentRegion) GetSustainModulationEnvelope

func (region *InstrumentRegion) GetSustainModulationEnvelope() float32

func (*InstrumentRegion) GetSustainVolumeEnvelope

func (region *InstrumentRegion) GetSustainVolumeEnvelope() float32

func (*InstrumentRegion) GetVelocityRangeEnd

func (region *InstrumentRegion) GetVelocityRangeEnd() int32

func (*InstrumentRegion) GetVelocityRangeStart

func (region *InstrumentRegion) GetVelocityRangeStart() int32

func (*InstrumentRegion) GetVibratoLfoToPitch

func (region *InstrumentRegion) GetVibratoLfoToPitch() int32

type MidiFile

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

func NewMidiFile

func NewMidiFile(r io.Reader) (*MidiFile, error)

func (*MidiFile) GetLength

func (mf *MidiFile) GetLength() time.Duration

type MidiFileSequencer

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

func NewMidiFileSequencer

func NewMidiFileSequencer(s *Synthesizer) *MidiFileSequencer

func (*MidiFileSequencer) Play

func (seq *MidiFileSequencer) Play(midiFile *MidiFile, loop bool)

func (*MidiFileSequencer) Render

func (seq *MidiFileSequencer) Render(left []float32, right []float32)

func (*MidiFileSequencer) Stop

func (seq *MidiFileSequencer) Stop()

type Preset

type Preset struct {
	Name        string
	PatchNumber int32
	BankNumber  int32
	Library     int32
	Genre       int32
	Morphology  int32
	Regions     []*PresetRegion
}

type PresetRegion

type PresetRegion struct {
	Instrument *Instrument
	// contains filtered or unexported fields
}

func (*PresetRegion) GetAttackModulationEnvelope

func (region *PresetRegion) GetAttackModulationEnvelope() float32

func (*PresetRegion) GetAttackVolumeEnvelope

func (region *PresetRegion) GetAttackVolumeEnvelope() float32

func (*PresetRegion) GetChorusEffectsSend

func (region *PresetRegion) GetChorusEffectsSend() float32

func (*PresetRegion) GetCoarseTune

func (region *PresetRegion) GetCoarseTune() int32

func (*PresetRegion) GetDecayModulationEnvelope

func (region *PresetRegion) GetDecayModulationEnvelope() float32

func (*PresetRegion) GetDecayVolumeEnvelope

func (region *PresetRegion) GetDecayVolumeEnvelope() float32

func (*PresetRegion) GetDelayModulationEnvelope

func (region *PresetRegion) GetDelayModulationEnvelope() float32

func (*PresetRegion) GetDelayModulationLfo

func (region *PresetRegion) GetDelayModulationLfo() float32

func (*PresetRegion) GetDelayVibratoLfo

func (region *PresetRegion) GetDelayVibratoLfo() float32

func (*PresetRegion) GetDelayVolumeEnvelope

func (region *PresetRegion) GetDelayVolumeEnvelope() float32

func (*PresetRegion) GetFineTune

func (region *PresetRegion) GetFineTune() int32

func (*PresetRegion) GetFrequencyModulationLfo

func (region *PresetRegion) GetFrequencyModulationLfo() float32

func (*PresetRegion) GetFrequencyVibratoLfo

func (region *PresetRegion) GetFrequencyVibratoLfo() float32

func (*PresetRegion) GetHoldModulationEnvelope

func (region *PresetRegion) GetHoldModulationEnvelope() float32

func (*PresetRegion) GetHoldVolumeEnvelope

func (region *PresetRegion) GetHoldVolumeEnvelope() float32

func (*PresetRegion) GetInitialAttenuation

func (region *PresetRegion) GetInitialAttenuation() float32

func (*PresetRegion) GetInitialFilterCutoffFrequency

func (region *PresetRegion) GetInitialFilterCutoffFrequency() float32

func (*PresetRegion) GetInitialFilterQ

func (region *PresetRegion) GetInitialFilterQ() float32

func (*PresetRegion) GetKeyNumberToModulationEnvelopeDecay

func (region *PresetRegion) GetKeyNumberToModulationEnvelopeDecay() int32

func (*PresetRegion) GetKeyNumberToModulationEnvelopeHold

func (region *PresetRegion) GetKeyNumberToModulationEnvelopeHold() int32

func (*PresetRegion) GetKeyNumberToVolumeEnvelopeDecay

func (region *PresetRegion) GetKeyNumberToVolumeEnvelopeDecay() int32

func (*PresetRegion) GetKeyNumberToVolumeEnvelopeHold

func (region *PresetRegion) GetKeyNumberToVolumeEnvelopeHold() int32

func (*PresetRegion) GetKeyRangeEnd

func (region *PresetRegion) GetKeyRangeEnd() int32

func (*PresetRegion) GetKeyRangeStart

func (region *PresetRegion) GetKeyRangeStart() int32

func (*PresetRegion) GetModulationEnvelopeToFilterCutoffFrequency

func (region *PresetRegion) GetModulationEnvelopeToFilterCutoffFrequency() int32

func (*PresetRegion) GetModulationEnvelopeToPitch

func (region *PresetRegion) GetModulationEnvelopeToPitch() int32

func (*PresetRegion) GetModulationLfoToFilterCutoffFrequency

func (region *PresetRegion) GetModulationLfoToFilterCutoffFrequency() int32

func (*PresetRegion) GetModulationLfoToPitch

func (region *PresetRegion) GetModulationLfoToPitch() int32

func (*PresetRegion) GetModulationLfoToVolume

func (region *PresetRegion) GetModulationLfoToVolume() float32

func (*PresetRegion) GetPan

func (region *PresetRegion) GetPan() float32

func (*PresetRegion) GetReleaseModulationEnvelope

func (region *PresetRegion) GetReleaseModulationEnvelope() float32

func (*PresetRegion) GetReleaseVolumeEnvelope

func (region *PresetRegion) GetReleaseVolumeEnvelope() float32

func (*PresetRegion) GetReverbEffectsSend

func (region *PresetRegion) GetReverbEffectsSend() float32

func (*PresetRegion) GetScaleTuning

func (region *PresetRegion) GetScaleTuning() int32

func (*PresetRegion) GetSustainModulationEnvelope

func (region *PresetRegion) GetSustainModulationEnvelope() float32

func (*PresetRegion) GetSustainVolumeEnvelope

func (region *PresetRegion) GetSustainVolumeEnvelope() float32

func (*PresetRegion) GetVelocityRangeEnd

func (region *PresetRegion) GetVelocityRangeEnd() int32

func (*PresetRegion) GetVelocityRangeStart

func (region *PresetRegion) GetVelocityRangeStart() int32

func (*PresetRegion) GetVibratoLfoToPitch

func (region *PresetRegion) GetVibratoLfoToPitch() int32

type SampleHeader

type SampleHeader struct {
	Name            string
	Start           int32
	End             int32
	StartLoop       int32
	EndLoop         int32
	SampleRate      int32
	OriginalPitch   uint8
	PitchCorrection int8
	Link            uint16
	SampleType      uint16
}

type SoundFont

type SoundFont struct {
	Info          *SoundFontInfo
	BitsPerSample int32
	WaveData      []int16
	SampleHeaders []*SampleHeader
	Presets       []*Preset
	Instruments   []*Instrument
}

func NewSoundFont

func NewSoundFont(r io.Reader) (*SoundFont, error)

type SoundFontInfo

type SoundFontInfo struct {
	Version           SoundFontVersion
	TargetSoundEngine string
	BankName          string
	RomName           string
	RomVersion        SoundFontVersion
	CreationDate      string
	Auther            string
	TargetProduct     string
	Copyright         string
	Comments          string
	Tools             string
}

type SoundFontVersion

type SoundFontVersion struct {
	Major int16
	Minor int16
}

type Synthesizer

type Synthesizer struct {
	SoundFont             *SoundFont
	SampleRate            int32
	BlockSize             int32
	MaximumPolyphony      int32
	EnableReverbAndChorus bool

	MasterVolume float32
	// contains filtered or unexported fields
}

func NewSynthesizer

func NewSynthesizer(sf *SoundFont, settings *SynthesizerSettings) (*Synthesizer, error)

func (*Synthesizer) NoteOff

func (s *Synthesizer) NoteOff(channel int32, key int32)

func (*Synthesizer) NoteOffAll

func (s *Synthesizer) NoteOffAll(immediate bool)

func (*Synthesizer) NoteOffAllChannel

func (s *Synthesizer) NoteOffAllChannel(channel int32, immediate bool)

func (*Synthesizer) NoteOn

func (s *Synthesizer) NoteOn(channel int32, key int32, velocity int32)

func (*Synthesizer) ProcessMidiMessage

func (s *Synthesizer) ProcessMidiMessage(channel int32, command int32, data1 int32, data2 int32)

func (*Synthesizer) Render

func (s *Synthesizer) Render(left []float32, right []float32)

func (*Synthesizer) Reset

func (s *Synthesizer) Reset()

func (*Synthesizer) ResetAllControllers

func (s *Synthesizer) ResetAllControllers()

func (*Synthesizer) ResetAllControllersChannel

func (s *Synthesizer) ResetAllControllersChannel(channel int32)

type SynthesizerSettings

type SynthesizerSettings struct {
	SampleRate            int32
	BlockSize             int32
	MaximumPolyphony      int32
	EnableReverbAndChorus bool
}

func NewSynthesizerSettings

func NewSynthesizerSettings(sampleRate int32) *SynthesizerSettings

Jump to

Keyboard shortcuts

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