Skip to content

moyiz/sogol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Sound of Game of Life. Synthesizes every generation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages