Skip to content
/ beep Public

synthesizing raw pcm music using go from scratch

License

Notifications You must be signed in to change notification settings

fr3fou/beep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

beep

All Contributors

Synthesizing raw PCM music using Go from scratch.

TODO

  • Refactor to idiomatic go code

  • Rename to a proper name

  • Make examples

  • Make note durations methods on beep.Melody (as they are dependant on the note length and BPM)

  • Implement a simple format - mp3 / wav

  • Define all notes in all octaves a seperate file

  • GUI + keybinds - Will be a separate project

  • 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
    • Note -> SingleNote, add Chord (multiple notes). Both implement new Note interface
    type Note interface {
        Samples(sampleRate float64, generator Generator, adsr ADSR) []float64
    }
  • Support for merging melodies (playing 2 melodies at the same time)

    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

    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)

  • Fix clipping in release of linear ADSR (theoretically negligible)

  • Implement logarithmic / exp ADSR

  • Support for dotted notes

  • Overtones

  • Fix periods for generators that aren't sin (?)

How to play music

ffplay megolovania.bin -autoexit -showmode 1 -f f64le -ar 48000

References

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Simo Aleksandrov

💻 🚇

Viktor Danov

💻 🚇

This project follows the all-contributors specification. Contributions of any kind welcome!