sinshu / go-meltysynth Goto Github PK
View Code? Open in Web Editor NEWA SoundFont MIDI synthesizer written in pure Golang
License: Other
A SoundFont MIDI synthesizer written in pure Golang
License: Other
I want to use this package in my Ebitengine game.
Right now I can't figure out how to adjust the channel/instrument volume level.
Is it possible?
I tried the MasterVolume
option but it doesn't look like it's affecting anything.
There's a typo in loadGM
in testing_test.go
func loadGS(t *testing.T) *SoundFont {
return loadSoundFont(t, envGS, defaultPathGS)
}
func loadGM(t *testing.T) *SoundFont {
return loadSoundFont(t, envGS, defaultPathGM)
}
Should be return loadSoundFont(t, envGM, defaultPathGM)
Overall, the code looks like nice work, however, I can't get the demo app (main.go) to run on MacOS Monterey. It builds with no error but panics while trying process flourish.mid. Seems like the []times slice is coming up empty.
michaels-mbp go-meltysynth % ./go-meltysynth
panic: runtime error: invalid memory address or nil pointer dereference
\[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x1089c0d\]
goroutine 1 \[running\]:
github.com/sinshu/go-meltysynth/meltysynth.(\*MidiFile).GetLength(...)
/Users/mellis/go-meltysynth/meltysynth/midifile.go:368
main.flourish()
/Users/mellis/go-meltysynth/main.go:70 +0x14d
main.main()
/Users/mellis/go-meltysynth/main.go:15 +0x1c
Also, it would make life easier for folks who want to try it out if the main app didn't reference specific .sf2 and .mid files. At the very least, it should check the error return from os.Open().
System:
Model Name: MacBook Pro
Model Identifier: MacBookPro11,4
Processor Name: Quad-Core Intel Core i7
Processor Speed: 2.2 GHz
Memory: 16 GB
OS:
Darwin Kernel Version 21.6.0: Sun Nov 6 23:31:16 PST 2022; root:xnu-8020.240.14~1/RELEASE_X86_64 x86_64
Curious if SFZ support is coming?
Hello,
right now the MidiFileSequencer
object can only play and stop. Also the Render()
method gives no indication of how many non-zero samples were written before reaching the end of the file. I would be interested in the following:
Length()
or Duration()
method that indicates the length of the fileTell()
or Pos()
method that indicates the current position in the fileSeek()
method to seek into the file (block granularity would be OK)To avoid accuracy issues, I would also suggest that these methods handle a number of samples rather than a duration, so that the client application can directly use the data with Render()
.
Also note that seq.LoopIndex
is not updated (and is currently unused).
What do you think? All these changes are fairly easy and I will gladly submit a PR, but Iโd like to get your opinion first.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.