Getting Started With propane

If you love to code because it is a creative process, then you should give propane a try because it can be used to create music, art, animations, videos and much more. Also since it is based on the latest Processing you can access a vast range of libraries to make the difficult things easier. Wanted tester for propane on MacOSBigSur, please report any problems, there are known issues with vanilla processing. Things will not work as well since Mavericks release and possibly not at all on Mac Silica, please report any success or solutions. Currently there is no support for any Apple product (no interest or commitment == no support).

Why propane?

You can dabble with the latest processing framework (in ruby) without even needing to install vanilla processing (and its embded jdk).

Additionally, you don’t have to declare types, voids, or understand the differences between floats and ints to get started, as you do in pure Processing.

Although there are some drawbacks to using the Ruby version Processing (slower start up time, and sometimes performance), having Ruby’s API available to translate your ideas into sketches more than makes up for them.

Java

We currently recommending installing AdoptOpenJDK fortunately there is a [homebrew][brew] script for this. You also need wget to download samples and libraries, but there is [homebrew][brew] script for this as well.

brew install wget
brew cask install [Eclipse Temurin][adopt]

JRuby

Like JRubyArt you do not need rvm or rbenv to install jruby because we expect you to run propane sketches using the jruby command but unlike JRubyArt you must install jruby, preferably jruby-9.3.2.0+. In fact you should use jgem or jruby -S gem to install propane and some other gems. See also [JRuby downloads][downloads] for latest releases.

brew install jruby # installs latest jruby

propane

jgem install propane # or `jruby -S gem`, use rvm at your own risk...

Install Samples

propane --install Samples

Install Sound library

propane --install Sound

Install Video library the past but stable?

propane --install Video

Running examples

To run a bunch of the samples as a demo:-

cd ~/propane_samples
rake # autoruns a bunch of files as a demo
cd ~/propane_samples/contributed # for example
rake # autoruns files in contributed folder
jruby jwishy.rb # run the JWishy sketch, using an installed jruby
cd ~/propane_samples/processing_app/topics/shaders
rake # autoruns shader sketches
jruby monjori.rb # run single shader sketch, since propane-1.0

Creating your own sketch

All we ask is that you obey the ruby filename convention (ie snakecase) and we can create a template sketch for you as follows:-

propane --create fred_sketch 200 200 # creates a propane sketch fred_sketch.rb (see below)
vim fred_sketch.rb
:!jruby % # from vim runs the sketch

other editors are available

# frozen_string_literal: true
require 'propane'

class FredSketch
  def setup
  sketch_title 'Fred Sketch'
  end

  def draw

  end

  def settings
  size 200, 200
  # smooth # here
  end
end

FredSketch.new

Running examples

To explore the installed examples:-

cd ~/propane_samples
rake # to run examples randomly as a demo
# or check available tasks with
rake --tasks
# use a task to randomly run a group of sketches eg
rake shaders # runs the shader examples

To create a simple sketch:-

propane -c fred 200 200 # sketch name=Fred width=200 height=200 mode=default
propane -c my_sketch 300 300 p2d # sketch name=MySketch width=300 height=300 mode=P2D

Edit fred.rb or my_sketch.rb with your favourite editor preferably vim, emacs or atom.

To run sketch using the command line

jruby fred.rb

To run a sketch from editor see editors