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

Repository files navigation

gusic

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 gusic.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)
    m := mego.NewMelody(...)
    m.AddNotes(...)
    
    // or
    m.Runs[0].AddNotes(...)
    
    // more runs, i.e. staves 
    m.NewRun(notes...)
  • Support for concatenating melodies / have melodies with differing BPM
    m := mego.NewMelody(...)
    m.AddNotes(...)
    n := mego.NewMelody(...)
    n.AddNotes(...)
    o := m.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

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!