GithubHelp home page GithubHelp logo

pd-externals / tclpd Goto Github PK

View Code? Open in Web Editor NEW
2.0 4.0 0.0 500 KB

Tcl objects for Pure Data

License: GNU General Public License v2.0

Makefile 44.10% C 41.03% SWIG 4.62% Tcl 9.42% Shell 0.82%

tclpd's Introduction

 Tcl for Pd
 ==========

This library allows one to write externals for Pd using the Tcl language.
It wraps quite closely the pd API (m_pd.h, plus some private functions)

Also a library of Tcl helper functions is provided. It is not mandatory to use
it (moreover: it requires Tcl 8.5, while the tclpd external alone requires only
Tcl 8.4), but it is a syntactic sugar and can simplify a lot the code.
To use it simply add 'package require TclpdLib' in your Tcl external.

Anyway, disregarding any approach chosen to develop Tcl externals, a general
knowledge of Pd internals (atoms, symbols, symbol table, inlets, objects) is
strongly required. (Pd-External-HOWTO is always a good reading)


 Compiling and installing
 ========================

To compile tclpd, simply type:

  make clean all

To compile it with debug enabled:

  make clean alldebug

Requirements are pd >= 0.39, swig, c compiler.
To install tclpd, simply copy it to /usr/lib/pd/extra (or where you installed
pure-data).


 Writing GUI externals
 =====================

Pd is split into two processes: pd (the core) and pd-gui.
A pd external executes in the core. The same applies for a Tcl external loaded
by tclpd, because tclpd creates a Tcl interpreter for that, running in the
same process as pd.

On the gui side (pd-gui) there is another Tcl interpreter living in a separate
process, which communicates with pd using a network socket.
Communication happens in one way (pd to gui) with the sys_gui function, and in
the other way using ::pdsend. (needs to set up a receiver using pdbind, check
the examples).


 Data conversion between Tcl <=> Pd
 ==================================

In pd objects communicate using messages, and messages are made up of atoms.
An atom could be a float, a symbol, a list, and so on.
Tcl usually doesn't make distinction between strings and numbers. This means
that simply translating a message text into a string could lose information
about the atom type (to pd, symbol 456 is different from float 456, but if we
just convert it as a string "456" the type information is lost).

To maintain atom type infrmation, pd atoms are represented in Tcl as two
element lists, where the first element indicates the atom type.

Some examples of this conversion:

 Pd:  456
 Tcl: {float 456}

 Pd:  symbol foo
 Tcl: {symbol foo}

 Pd:  list cat dog 123 456 weee
 Tcl: {{symbol cat} {symbol dog} {float 123} {float 456} {symbol wee}}


 Examples
 ========

Some examples externals are provided, including their helpfile.


 Authors
 =======

Please refer to AUTHORS file found in tclpd package.


 License
 =======

Please refer to COPYING file found in tclpd package.


tclpd's People

Contributors

katjav avatar umlaeute avatar danomatika avatar

Stargazers

Shakeeb Alireza avatar Yuan-Man avatar

Watchers

Chris McCormick avatar  avatar Roman Haefeli avatar  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.