Git Product home page Git Product logo

praxis's Introduction

praxis

A live coding environment based on Lua, Lisp and Forth.

Although mainly Lua at the moment.

Videos

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

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

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)

Praxis links against the following static libraries:

  • fmodvc.lib (found in fmodapi375win/lib)
  • freetype235.lib (found in freetype-2.3.5/objs)

These files need to be copied to a folder called "libs" under the parent of the build folder. For example, if your build folder is in C:\builds\build-praxis-Qt_5_3-Release, the path of the libs folder will be C:\builds\libs.

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
  • 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/

praxis's People

Contributors

createuniverses avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.