An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# beep

[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#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!