Skip to content
A live coding environment based on Lua, Lisp, Forth and Io
C C++ Lua HTML Forth Scheme Other
Find file
Latest commit b18561a @createuniverses RenderChars
Failed to load latest commit information.
MathLib Playing around with changing the coordinate system.
Neural Initial commit
OpenGlut Added basic OpenGL shader support
Voxel Initial commit
ficl-4.1.0 Corrected FiCL Forth bug in ficlPrimitiveEmit
fmodapi375win Initial commit
freetype-2.3.5 Initial commit
glew Added basic OpenGL shader support
glm Added GLM
io User break added to Io for Linux build as well.
lpeg-0.12 Initial commit
lpeg-1.0.0 Upgraded to Lua 5.2
lua-5.1.4 Initial commit
lua-5.2.4 Upgraded to Lua 5.2
pforth Begun adding Forth callbacks
prods RenderChars
s7 Upgraded s7 to 4.5
utils Added utils folder
.gitattributes Update .gitattributes
.gitignore Ignore putty logs
CMakeLists.txt Minor cmake related changes
GLEditor.cpp RenderChars
GLEditor.h Added a script for low spec machines
LICENCE Create LICENCE
PolyGlyph.cpp Editor
PolyGlyph.h Added new editor render mode choices
PraxisLog.cpp Io terminal server
PraxisLog.h Io terminal server
PraxisServer.cpp Attempting to fix occasional "connection refused" in linux.
PraxisServer.h Separated socket server functions so they become accessible to all em…
PraxisTexture.cpp Texture for editor resizeable
PraxisTexture.h Texture for editor resizeable
README.md Updated the readme
RtError.h Initial commit
RtMidi.cpp Initial commit
RtMidi.h Initial commit
SingleWorldConfiguration.cpp Moved an init function to a more appropriate place
SingleWorldConfiguration.h Initial commit
World.cpp Added separate onerrorgl error hook
World.h Added transform callbacks and callbacks for setting the clear color
audioMidi.cpp Cross platform features
audioWave.cpp Initial commit
forthCallbacks.cpp Begun adding Forth callbacks
forthCallbacks.h Initial commit
forthInterface.cpp Begun adding Forth callbacks
forthInterface.h User break added to Io
ioCallbacks.cpp User break added to Io
ioCallbacks.h Added Io language.
ioInterface.cpp Io language related changes
ioInterface.h Io language related changes
lispCallbacks.cpp Begun adding Forth callbacks
lispCallbacks.h Added GLM
lispInterface.cpp Added basic OpenGL shader support
lispInterface.h Initial commit
luaCB.h Clarified linux clipboard code
luaCBClipboard.cpp Linux clipboard code cleanup
luaCBEditor.cpp Upgraded to Lua 5.2
luaCBJoystick.cpp Finished with splitting luaCallbacks.cpp
luaCBLang.cpp Finished with splitting luaCallbacks.cpp
luaCBMidi.cpp Cross platform features
luaCBMp3.cpp Added a script for low spec machines
luaCBOpenGL.cpp Making OpenGL functions look like C API
luaCBServer.cpp Splitting up Lua callbacks into separate files
luaCBSynth.cpp Finished with splitting luaCallbacks.cpp
luaCBSystem.cpp Added separate onerrorgl error hook
luaCBTexture.cpp Upgraded to Lua 5.2
luaCBTransform.cpp Upgraded to Lua 5.2
luaCBVoxel.cpp Finished with splitting luaCallbacks.cpp
luaCBWindow.cpp Praxis instances are nameable
luaCBWorld.cpp Added separate onerrorgl error hook
luaCallbacks.cpp Praxis instances are nameable
luaCallbacks.h Initial commit
luaInterface.cpp Added separate onerrorgl error hook
luaInterface.h Lua error hook for render() needs to be different to error hook in ot…
main.cpp Added edRenderChar so text effects can be implemented in Lua.
praxis.pro Begun adding Forth callbacks

README.md

praxis

A live coding environment featuring a menagerie of beautiful languages consisting of Lua, Lisp, Forth and Io.

The Lisp comes from s7 scheme: https://ccrma.stanford.edu/software/snd/snd/s7.html

The Forth comes from pForth: http://www.softsynth.com/pforth/

Io: http://iolanguage.org/

Lua: http://www.lua.org/

These implementations were chosen because they are all well written, well tested and embeddable.

Videos

Introduction: https://www.youtube.com/watch?v=1VRtRazMYSA

Running the examples: https://www.youtube.com/watch?v=6rB39AXPmQQ

Midi recording: https://www.youtube.com/watch?v=0ftGZW-QnHY

Camera control: https://www.youtube.com/watch?v=ezWaNu-FMPk

Lua and audio demo: https://www.youtube.com/watch?v=0uEBs98PKQE

Lisp demo: https://www.youtube.com/watch?v=PGNEuq3XL7c

Compiling and running praxis in Linux

Prerequisites:

  • Qt (strictly speaking, only qmake is required, praxis is not dependent on Qt libraries)
  • The sdl library (at the time of writing I'm using version 1.2.15)
  • The freetype library (at the time of writing I'm using version 17.1.11)

Once you have these, you can compile praxis the usual way you would for a qmake based project, either from the command line with qmake then make, or by loading the project in Qt Creator.

When running praxis, praxis expects to see the following files in the current folder:

  • Bitstream-Vera-Sans-Mono.ttf
  • prod.lua

See the prods folder for runnable examples.

To use the midi commands you need a midi server running. I've been using timidity for this by invoking the following command in a terminal:

timidity -iA -B2,8 -Os1l -s 44100

Compiling and running praxis in Windows

Prerequisites:

  • Qt (strictly speaking, only qmake is required, praxis is not dependent on Qt libraries)

You can compile praxis the usual way you would for a qmake based project, either from the command line with qmake then make, or by loading the project in Qt Creator. The static libraries for fmod and freetype are included in the source tree and will be linked against when building.

When running praxis, praxis expects to see the following files in the current folder:

  • Bitstream-Vera-Sans-Mono.ttf
  • fmod.dll
  • music.mp3
  • prod.lua

See the prods folder for runnable examples.

Features

Praxis features a mish-mash of features I've added over a long period of time.

  • OpenGL
  • Real-time audio generation
  • Midi
  • A voxel engine
  • A programmable text editor
  • lots more

See the end of luaCallbacks.cpp for available lua commands, and the folders in /prods for examples.

Usage guide

  • Ctrl-Enter runs the Lua block which the cursor is in. If the cursor is in a multi-line block, this will be indicated by faint highlighting. If there is no highlighting, the Lua block is the code on the current line.
  • The Lua block will be the function or do-end block surrounding the cursor
  • Shift-Enter runs the Lua block, but first moves to the end of the block and inserts a line. This is useful for code which inserts text into the buffer.
  • F1 runs the entire buffer
  • The function print writes text to the trace output. This appears on the right and in 3D in the world.
  • When an error message appears, you can use clearError() to clear it
  • The function print2 writes text to the buffer at the current cursor position. Use Shift-Enter when issuing this command, or else the text that gets printed will be inserted wherever your cursor is, which may be inside your code.
  • To load a file into the edit buffer, the command is loadBuffer()
  • Every frame, the Lua functions render() and update() are called
  • To bring up a function definition, use print2(getFunction()) then Shift-Enter
  • For example, to bring up the definition of getFunction, type print2(getFunction("getFunction"))
  • getFunction returns 2 items - the function text and the debug info.
  • Inspect the 2nd parameter like this: s,t = getFunction("update") print2(inspect(t))
  • The function keys can be redefined. f1Pressed() to f12Pressed() are the functions that get called when you press a function key. These can be freely inspected (using the tip above) and redefined.

Editing

  • F2 opens a new buffer
  • Use the function setBufferName() to set the name of the current buffer being edited
  • Ctrl-S saves the buffer
  • getSelectedText() returns selected text

Blog

http://createuniverses.wordpress.com/

Something went wrong with that request. Please try again.