Giter VIP home page Giter VIP logo

sogol's Introduction

Code style: black

SOGOL

Sound of Game of Life is a variation of Conway's Game of Life that synthesizes each generation instead of visualizing in any UI.

Contents

Installation

Suggested: poetry

This is currently the recommended way. poetry will create a virtual environment and install the required dependencies and root package.

$ git clone https://github.com/moyiz/sogol.git && cd sogol
$ poetry install
$ poetry run sogol

Local pip

$ git clone https://github.com/moyiz/sogol.git && cd sogol
$ pip install .
$ sogol

Usage

By default, it will randomly generate up to 7 cells within a 3x3 matrix, and play each generation with a delay of 0.5 seconds.

Sound of Game of Life.
Listen to an audio interpretation of each generation.

Usage:
    sogol [--max-column=X] [--max-row=Y] [--cells=N] [-d DELAY] [-w WAVE]
    sogol (--from-lexicon=PATH|--from-json=PATH) [-d DELAY] [-w WAVE]

Options:
    -x NUM, --max-column=NUM  Maximum column of randomly generated cells [default: 3]
    -y NUM, --max-row=NUM     Maximum row of randomly generated cells [default: 3]
    -c CELLS, --cells=CELLS   Maximum number of cells to randomly generate [default: 7]
    --from-json=PATH          Load a JSON file or stdin (-)
    --from-lexicon=PATH       Load a lexicon formatted file or stdin (-)
    -d DELAY, --delay=DELAY   Delay in seconds between each generation [default: 0.5]
    -w (sine|square|sawtooth) Select a wave to generate [default: sine]

Life Lexicon

sogol supports loading patterns in Life Lexicon format. The notations are:

  • . (dot) - empty cell.
  • O (lower or capital) or * (asterik) - living cell.

For example, to load the R2D2 pattern:

sogol --from-lexicon - << EOF
	.....O.....
	....O.O....
	...O.O.O...
	...O.O.O...
	OO.O...O.OO
	OO.O...O.OO
	...O...O...
	...O.O.O...
	....O.O....
	.....O.....
EOF

Or the Sidewalk pattern:

sogol -w sawtooth --from-lexicon - << EOF
	.OO.OO
	..O.O.
	.O..O.
	.O.O..
	OO.OO.
EOF

Motivation

This project was initially written for educational purposes in 2014. I was interested in simple sound synthesis project in python. Since then, it was left unmaintained for almost 7 years. Recently I was curios to play it again and I noticed few things:

  • It was originally written for python2, which has reached EOL during that time.
  • My programming skills and style changed a bit since then.
  • It could have been written better.
  • This is a great opportunity to integrate interesting utilities that I have not tinkered with before.

Contributing

See CONTRIBUTING.md

License

BSD 3-Clause

Version

0.3.0

sogol's People

Contributors

moyiz avatar

Stargazers

 avatar

Watchers

 avatar  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.