Documentation
¶
Index ¶
- Variables
- func IsBusy() bool
- func SetMetadata(fname string, metadata Metadata) (err error)
- type File
- func (f *File) Load() (err error)
- func (f File) Regenerate()
- func (f File) Save() (err error)
- func (f File) SaveNoDebounce() (err error)
- func (f *File) SetBPM(bpm int)
- func (f *File) SetChannels(channels int)
- func (f *File) SetOneshot(oneshot bool)
- func (f *File) SetOversampling(oversampling int)
- func (f *File) SetSlices(sliceStart []float64, sliceEnd []float64) (sliceType []int)
- func (f *File) SetSplicePlayback(playback int)
- func (f *File) SetSpliceTrigger(spliceTrigger int)
- func (f *File) SetSpliceVariable(spliceVariable bool)
- func (f *File) SetTempoMatch(TempoMatch bool)
- func (f *File) SetTransient(i int, j int, value int)
- func (f *File) UpdateSliceTypes()
- type Metadata
- type SampleInfo
- type SampleInfoPack
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoMetadata = fmt.Errorf("no metadata present")
define error for no metadata present
Functions ¶
func SetMetadata ¶
Types ¶
type File ¶
type File struct { Filename string Duration float64 PathToFile string PathToAudio string BPM int SliceStart []float64 // fractional (0-1) SliceStop []float64 // fractional (0-1) SliceType []int // 0 = normal, 1 = kick Transients [][]int // kick, snare, other TempoMatch bool OneShot bool Channels int // 0 if mono, 1 if stereo Oversampling int // 1, 2, or 4 SpliceTrigger int // 0, 16, 32, 48, 64, 80, 96, 112, 128 SpliceVariable bool // 0,1 (off/on) // from audio_callaback.h: // // starts at splice start and ends at splice stop // #define PLAY_SPLICE_STOP 0 // // starts at splice start, and returns to start when reaching splice boundary // #define PLAY_SPLICE_LOOP 1 // // starts at splice start and ends at sample boundary // #define PLAY_SAMPLE_STOP 2 // // starts at splice start and returns to start when reaching sample boundary // #define PLAY_SAMPLE_LOOP 3 SplicePlayback int // contains filtered or unexported fields }
func (File) Regenerate ¶
func (f File) Regenerate()
func (File) SaveNoDebounce ¶
func (*File) SetChannels ¶
func (*File) SetOneshot ¶
func (*File) SetOversampling ¶
func (*File) SetSplicePlayback ¶
func (*File) SetSpliceTrigger ¶
func (*File) SetSpliceVariable ¶
func (*File) SetTempoMatch ¶
func (*File) UpdateSliceTypes ¶
func (f *File) UpdateSliceTypes()
type Metadata ¶
func GetMetadata ¶
type SampleInfo ¶
type SampleInfo struct { Size uint32 Bpm uint16 // 0-511 PlayMode uint16 // 0-7 OneShot uint16 // 0-1 (off/on) TempoMatch uint16 // 0-1 (off/on) Oversampling uint16 // 0-1 (1x or 2x) NumChannels uint16 // 0-1 (mono or stereo) Version uint16 // 0-127 SpliceTrigger uint16 SpliceVariable uint16 // 0-1 (off/on) SliceNum uint8 // 0-255 SliceStart []int32 SliceStop []int32 SliceType []int8 Transients [][]int32 }
type SampleInfoPack ¶
type SampleInfoPack struct { Size uint32 Flags uint32 // Holds bpm, slice_num, slice_current, play_mode, one_shot, tempo_match, oversampling, and num_channels SpliceInfo uint16 // Holds splice_trigger and splice_variable SliceNum uint8 // 0-255 SliceStart []int32 SliceStop []int32 SliceType []int8 Transients [][]int32 }
func SampleInfoMarshal ¶
func SampleInfoMarshal(si *SampleInfo) *SampleInfoPack
func (*SampleInfoPack) WriteToFile ¶
func (sip *SampleInfoPack) WriteToFile(filename string) error
Click to show internal directories.
Click to hide internal directories.