https://github.com/fr3fou/beep
synthesizing raw pcm music using go from scratch
https://github.com/fr3fou/beep
bpm chords go golang hacktoberfest melodies music
Last synced: 4 months ago
JSON representation
synthesizing raw pcm music using go from scratch
- Host: GitHub
- URL: https://github.com/fr3fou/beep
- Owner: fr3fou
- License: mit
- Created: 2020-06-09T10:25:22.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-29T16:42:52.000Z (over 4 years ago)
- Last Synced: 2025-04-07T11:38:20.838Z (6 months ago)
- Topics: bpm, chords, go, golang, hacktoberfest, melodies, music
- Language: Go
- Homepage:
- Size: 4.84 MB
- Stars: 11
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# beep
[](#contributors-)
Synthesizing raw PCM music using Go from scratch.
## TODO
- [x] Refactor to idiomatic go code
- [x] Rename to a proper name
- [x] Make examples
- [x] Make note durations methods on `beep.Melody` (as they are dependant on the note length and BPM)
- [ ] Implement a simple format - ~~mp3~~ / wav
- [x] Define all notes in all octaves a seperate file
- [ ] ~~GUI + keybinds~~ - Will be a separate project
- [x] Play multiple notes at once (chords)- `f(x) + g(x)` where `f` and `g` produce different notes, should result in them playing at the same time
- [x] Note -> SingleNote, add Chord (multiple notes). Both implement new Note interface```go
type Note interface {
Samples(sampleRate float64, generator Generator, adsr ADSR) []float64
}```
- [x] Support for merging melodies (playing 2 melodies at the same time)
```go
g := beep.NewMelody(...)
g.AddNotes(...)// or
g.Runs[0].AddNotes(...)// more runs, i.e. staves
g.NewRun(notes...)
```- [ ] Support for concatenating melodies / have melodies with differing BPM
```go
g := beep.NewMelody(...)
g.AddNotes(...)
n := beep.NewMelody(...)
n.AddNotes(...)
o := g.Concat(n) // combines both melodies and makes a longer one
```- [ ] Dual Channel support (left and right ear)
- [x] ~~Fix clipping in release of linear ADSR~~ _(theoretically negligible)_
- [x] Implement logarithmic / exp ADSR
- [x] Support for dotted notes
- [ ] Overtones
- [ ] Fix periods for generators that aren't sin (?)## How to play music
```console
ffplay megolovania.bin -autoexit -showmode 1 -f f64le -ar 48000
```## References
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Simo Aleksandrov
💻 🚇
Viktor Danov
💻 🚇
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!