Git Product home page Git Product logo

go-sound's Introduction

go-sound

go-sound is a go library for dealing with sound waves. At the fundamental level, the library models each sound as a channel of [-1, 1] samples that represent the Compression Wave that comprises the sound.
To see it it action, check out demo.go or the examples provided by each file in the sounds package.

A tutorial explaining the basics behind sound wave modelling in code, and how it is implemented in go-sound, is available on my blog: http://padsterprogramming.blogspot.ch/2015/11/sounds-good-part-1.html

Features :

  • A Sound interface, with a BaseSound implementation that makes it simpler to write your own.
  • Sound Math (play notes together to make chords, or in serial to form a melody, ...)
  • Utilities for dealing with sounds (repeat sounds, generate from text, ...)
  • Implementations for various inputs (silence, sinusoidal wave, .wav file, ...)
  • Implementations for various outputs (play via pulse audio, draw to screen, .wav file, ...)
  • Realtime input (via MIDI) - with delay though.
  • Sound -> Spectrogram -> Sound conversion using a Constant Q transform

In progress:

  • MashApp, a golang server and polymer web app for manipulating sounds using the library.

Future plans:

  • Inputs and Outputs integrating with Jack Audio
  • Realtime input from microphone, more efficient from MIDI
  • Effects algorithms (digitial processing like reverb, bandpass ...)

Notes:

This library requires pulse audio installed to play the sounds, libflac for reading/writing flac files, and OpenGL 3.3 / GLFW 3.1 for rendering a soundwave to screen.

Some planned additions are included above, and include effects like those available in Audacity (e.g. rewriting Nyquist, LADSPA plugins in Go), or ones explained here or here. Additionally, some more complex instrument synthesizers could be added, and contributions are welcome.

The example piano .wav C note came from: http://freewavesamples.com/ensoniq-sq-1-dyno-keys-c4

Frequencies of notes are all obtained from: http://www.phy.mtu.edu/~suits/notefreqs.html

For MIDI input, a number of things are required for portmidi:

Overall quite a pain and there's still a noticeable delay in the MIDI input, patches to reduce that are welcome!

Credit to cryptix, cocoonlife, moriyoshi and rakyll for their wavFile, pulseAudio and portmidi implementations respectively, used by go-sound.

go-sound's People

Contributors

padster avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.