Coder Social home page Coder Social logo

noiseband's Introduction

Description

noiseband synthesizes audio noise using additive synthesis. It can generate a precise band of noise by adding together an arbitrary number of partials. This serves as a reasonable approximation of band-limited noise when using a large number of partials.

It is implemented using classes from STK 4.3.0 by Perry Cook and Gary Scavone (https://ccrma.stanford.edu/software/stk/).

This program does not work in real time. On my machine, I can create two seconds of noise spanning 10Hz to 22000Hz using 16654 partials in 1 minute, 36 seconds.

Usage

noiseband [OPTIONS]

where the options are:

-l <seconds>, --length <seconds>
    the output file length in seconds
    (default is 2.0 seconds)

-s <freq>, --startfreq <freq>
    the starting (lowest) frequency of the noise band in Hertz
    (default is 10Hz)

-e <freq>, --endfreq <freq>
    the ending (highest) frequency of the noise band in Hertz
    (default is 22000Hz)

-p <number>, --ppo <number>
    the number of partials per octave.  this overrides option -n
    (default is 1500.0)

-n <number>, --number <number>
    the total number of partials for the entire band.  this overrides option -p
    (default is 0)

-w, --white
    use white noise
    (this is the default noise type)

-k, --pink
    use pink noise

-o <file.wav>, --outfile <file.wav>
    the output file name
    (default is outfile.wav)

Remarks

The sampling rate is 44100 Hz, and the output wav files are mono, using 16-bit integers. Internal computations are done in terms of 64-bit floats (doubles).

Compiling

make

For compiling on PowerPC, remove the __LITTLE_ENDIAN__ flag in the Makefile.

Examples

Generate two seconds of noise, with partials between 10Hz and 22000Hz and 1500 partials per octave (the default behaviour):

noiseband

Generate five seconds of pink noise between 440Hz and 880Hz with 1000 partials per octave:

noiseband -l 5 -k -s 440 -e 880 -p 1000

The same, using long arguments:

noiseband --length 5 --pink --startfreq 440 --endfreq 880 --ppo 1000

Generate 10 random partials between 1000Hz and 1100Hz:

noiseband -s 1000 -e 1100 -n 10

Write to file newnoise.wav:

noiseband --outfile newnoise.wav

License

noiseband.cpp is under the GPL, version 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt).

The remaining source files are part of STK, and are under their own license (https://ccrma.stanford.edu/software/stk/information.html), copied here:

License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

Any person wishing to distribute modifications to the Software is asked to send the modifications to the original developer so that they can be incorporated into the canonical version. This is, however, not a binding provision of this license.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Author

noiseband.cpp was written by Mark Zadel. The other source files were written by their respective authors.

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.