Code Monkey home page Code Monkey logo

gameofsound's Introduction

A game of life with produces sound.

The LIF files come from http://plife.sourceforge.net/

This program uses matplotlib, numpy and scipy. ffmpeg is used during rendering (optional, only if --mov-file is passed on the command line).

Example of use:

$ python3 gameoflife.py --custom data/RPENTO.LIF --exportsound --fmin=25 --fmax=7000 --soundtime=0.1 --grid-size=100 --soundenv=10

Once you are satisfied by the evolution, you can close the matplotlib window. The wav file will be generated after the matplotlib is closed.

Options:

--grid-size=size - the grid size of the game of life: [0 -> N:0 -> N]
--mov-file - export a mov file of the evolution of the game
--interval - time in ms between two frames
--mov-time - duration to save (in s)
--glider - add a glider in the grid
--gosper - add a gosper in the grid
--rectangle=size  - add a square of size [size:size] in the grid
--line=size - add a line of length size in the grid
--custom=filename - use <filename> LIF file to file the grid
--exportsound - export a wav file
--soundfilename=filename - file name of the wav file
--fmin=value - minimum rendered frequency
--fmax=value - maximum rendered frequency
--soundtime=value - one step of the evolution is rendered during <value> time
--soundsr=value - samplerate value (48000 by default)
--soundenv=size - add a ramp envelop of size <size> at the beginning and the end of each evolution sequence
--patternpos=X,Y - place the selected pattern at position X,Y

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.