Skip to content

Commit

Permalink
Installation hints (#165).
Browse files Browse the repository at this point in the history
  • Loading branch information
gogins committed Jul 6, 2021
1 parent 18ddfbd commit d653905
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 12 deletions.
41 changes: 37 additions & 4 deletions playpen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ http://michaelgogins.tumblr.com
This computer music playpen is an integrated development environment for
algorithmic music composition.

The objective is provide the simplest possible system with the maximum
The playpen is designed to provide the simplest possible system with the greatest
possible power, and to minimize the time involved in moving through the "edit,
render, listen; edit, render, listen;..." cycle of this style of composition
without, however, compromising the musical possibilities of the software.
without, however, compromising in _any_ way the musical possibilities of the
software.

Python and the GTK framework are "glue" that binds everything together. The
playpen provides a simple code editor, an interactive form builder for
creating graphical user interfaces to control pieces, an HTML window for
creating graphical user interfaces to control performances, an HTML window for
presenting visual music, and online help.

It is possible to write a piece in Python using algorithmic composition
libraries such as Rick Taube's musx or my CsoundAC; to write a Csound
libraries such as Rick Taube's [musx](https://github.com/musx-admin/musx)
or my [CsoundAC](https://github.com/gogins/csound-extended); to write a Csound
orchestra to render the piece; to write JavaScript for creating visual music
in HTML5; to interactively build a fully-featured graphical user interface for
controlling the audio and video of the piece using Glade; to instantly preview
Expand All @@ -34,8 +36,39 @@ an external score-generating program directly from Csound using the <CsScore>
other composition software is needed to generate a score that is then sent to
Csound or some other synthesizer for rendering.

The playpen can edit and automatically render pieces written in Python, Csound,
HTML5, or Javascript. By writing a little extra Python code, pieces can be
written in any programming language.

## Getting Started

Install the following software requirements, each according to its own
instructions. Below are links to installation instructions for each
package. Note that the instructions are often different for different
operating systems.

1. [Python 3.9](https://www.python.org/downloads/) or, for Ubuntu Linux,
follow [these instructions](https://linuxize.com/post/how-to-install-python-3-9-on-ubuntu-20-04/).
3. [GTK 3](https://www.gtk.org/docs/installations/), note that GTK 4 is now
the current version but it is the previous version, GTK 3, that is used here.
4. [GStreamer 3](https://gstreamer.freedesktop.org/documentation/installing/index.html?gi-language=c).
5. [WebKit2 4.0 development libraries]; on Ubuntu Linux this is done by
executing `sudo apt install libwebkit2gtk-4.0-37` or a compatible version.
6. [WebKit2 GNU introspection libraries]; on Ubuntu Linux this
is done by executing `sudo apt install gir1.2-webkit2-4.0`.
6. [Glade](https://wiki.gnome.org/Apps/Glade); on Ubuntu Linux it may be
better to execute `sudo apt install glade`.
2. [PyGObject](https://pygobject.readthedocs.io/en/latest/getting_started.html)
which automatically generates Python bindings for GTK, GStreamer, and WebKit
based on their introspection libraries.
7. [Csound](https://csound.com/download.html), on Linux it is best to build
from source code.
8. The playpen itself is part of csound-extended. Clone the
[csound-extended](https://github.com/gogins/csound-extended) repository to
your local filesystem. Change to the `csound-extended/playpen` directory.
Execute `python3 playpen.py` and then open and run the `drone.py` example
to check that everything is working.

## User's Guide

## A Few Examples
15 changes: 14 additions & 1 deletion playpen/playpen.glade
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,24 @@
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="open_button">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Open a file</property>
<property name="label" translatable="yes">Open,,,</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="save_as_button">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Save as...</property>
<property name="tooltip_text" translatable="yes">Save the file under a new name</property>
<property name="label" translatable="yes">Save as...</property>
<property name="use_underline">True</property>
</object>
Expand Down
12 changes: 5 additions & 7 deletions playpen/playpen.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,23 @@

Gst.init(sys.argv)

title = sys.argv[0].split(".")[0]
title = "Playpen"
print("title:", title)
glade_file = title + ".glade"

builder = Gtk.Builder()
builder.add_from_file(glade_file)


builder.add_from_file("playpen.glade")

main_window = builder.get_object("main_window")
main_window.connect("destroy", Gtk.main_quit)
html_window = builder.get_object("html_window")
webview = WebKit2.WebView()
webview.load_uri("http://csound.com/")
webview.load_uri("http://csound.com")
html_window.add(webview);
help_window = builder.get_object("help_window")
helpview = WebKit2.WebView()
helpview.load_uri("https://github.com/gogins/csound-extended/tree/develop/playpen")
help_window.add(helpview);
help_window.add(helpview)
main_window.resize(1200, 800)
main_window.show_all()

Gtk.main()

0 comments on commit d653905

Please sign in to comment.