Skip to content

Instantly share code, notes, and snippets.

@reccanti
Last active May 18, 2016 01:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reccanti/92f36b090ecd73c8d46053592325d385 to your computer and use it in GitHub Desktop.
Save reccanti/92f36b090ecd73c8d46053592325d385 to your computer and use it in GitHub Desktop.
Installs the Inspire project
#!/bin/bash
# Make a directory to store the project
mkdir inspire
cd ./inspire
# install openFrameworks
git clone https://github.com/Team-Tentickles/openFrameworks.git
cd ./openFrameworks
git submodule init
git submodule update
cd ./apps/myapps/DrawingWrapper
git checkout master
git submodule init
git submodule update
cd ./DrawingImages
git checkout master
cd ../../../../../
# install the server
git clone https://github.com/Team-Tentickles/inspire.git
cd ./inspire
npm install
npm start

#Overview Inspire consists of two main modules: A Node Express server and an OpenFramworks client.

The Node Express server is responsible for the following things: rendering the client input screen, fetching and bundling assets from various APIs, distributing assets, and playing audio files.

The OpenFrameworks client is responsible for handling the assets received from the server, generating a display, and broadcasting that display for use by MadMapper.

In addition to these components, several other repos that we worked on can be found at the Team Tentickles Organization on GitHub

#Requirements To run the program, the following programs must be intalled:

  • OSX: Many of the programs this program uses are exclusive to OSX. You must have a Mac with OSX installed.
  • Node.js to run the server
  • XCode to build the openFrameworks project (requires Mac with OSX)
  • MadMapper to create the projection-mapping display

#Installation

##Prebuilt A prebuilt version of the project was provided in the file inspire.zip. You can download and unzip that file, then follow the startup instructions

##Automatic To make installation easy, the bash script install.sh is provided. To run it, open your terminal and go to the directory that contains the file install.sh. Then, run the script with the command:

bash install.sh

##Manual

To install OpenFrameworks

The openFrameworks project is intended to be run on a Mac with OSX. XCode is required to build.

  1. The client needs to be run from within openFrameworks, so we need to install the openFrameworks repository. We created a fork of this repository containing our program and all of the addons we're using. Clone the openFrameworks repository:

    git clone https://github.com/Team-Tentickles/openFrameworks.git
    
  2. After it has finished cloning the repository, go into the directory that was created:

    cd ./openFrameworks
    
  3. The program makes use of several addons and contains references to the project we're using. These are stored as git submodules to install them, use the following command:

    git submodule init && git submodule update
    
  4. Go into the apps directory and enter the DrawingWrapper folder:

    cd ./apps/myapps/DrawingWrapper
    
  5. Checkout the master branch of DrawingWrapper:

    git checkout master
    
  6. Go to the DrawingImages folder:

    cd ./DrawingImages
    
  7. Checkout the master branch of DrawingImages:

    git checkout master
    
  8. Finally open XCode and build the project according to the WrapperSketch Debug build setting

To install the server

The Server uses NodeJS and NPM.

  1. Clone the server repository:

    git clone https://github.com/Team-Tentickles/inspire.git
    
  2. Go into the directory that was created:

    cd ./inspire
    
  3. This project makes use of several dependencies. To install them, run the following command:

    npm install
    
#Startup

##OpenFrameworks

###Building the Project If you installed openFrameworks manually or using the bash script, you may not have the compiled program installed. To build the project, perform the following steps:

  1. Go to the directory where you installed openFrameworks. From there, go to apps/myapps/DrawingWrapper. In there, you should see the file WrapperSketch.xcodeproj. Click on it.

XCode 2. This should open up XCode. To build the project, click on the play button in the upper-left corner. Make sure that the active scheme next to it is set to WrapperSketch Debug or else the build will fail. This step may take a while. When it is finished, the window will open.

###Running the built program The program is built into the file WrapperSketchDebug.app. You can run this file directly by double-clicking it. You can access it by going to the openFrameworks directory and then going to apps/myapps/DrawingWrapper/bin

Alternatively, you can continue to run it in XCode by clicking on the play button.

##Server

The server needs to be started from the terminal.

  1. In the terminal, go to the directory where you installed the server.

  2. To start the server, run the following command:

    npm start
    
  3. After the server is started, you should see the following message:

    $ npm start
    
    > inspire@0.0.0 start /Users/benjaminwilcox/Projects/test/inspire/inspire
    > node ./bin/www
    
    
  4. From there, you can access the display. To do that, open your browser and go to the following URL:

    localhost:3000/select
    

Technology Used

The server uses NodeJS. The frameworks Express is used to make working with the server easier. The server uses a variety of APIs to fetch assets. The similar artist is found using Echo Nest. The image assets come from the Discogs API. Song data comes from the Spotify API. We didn't have this working at the time of Imagine, but we came up with a plan to use the Rovi API to find influences.

The Selection Display was rendered using the HTML <canvas>. SocketIO was used to send messages and assets to the server.

The display for the spire is rendered using openFrameworks. In addition, the following addons are used: ofxSyphon to broadcast the screen, ofxSocketIO to communicate with the server, and ofxSimpleHttp to download image assets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment