{"id":15400860,"url":"https://github.com/agraef/purr-data","last_synced_at":"2025-05-15T04:07:00.126Z","repository":{"id":41570912,"uuid":"84920792","full_name":"agraef/purr-data","owner":"agraef","description":"Purr Data - Jonathan Wilkes' cross-platform Pd-l2ork version","archived":false,"fork":false,"pushed_at":"2025-02-18T09:51:51.000Z","size":122967,"stargazers_count":665,"open_issues_count":8,"forks_count":90,"subscribers_count":45,"default_branch":"master","last_synced_at":"2025-04-14T05:56:50.231Z","etag":null,"topics":["computer-music","dataflow-programming","multimedia","pd-l2ork","pure-data","purr-data"],"latest_commit_sha":null,"homepage":"https://agraef.github.io/purr-data/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agraef.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.html","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-14T07:50:52.000Z","updated_at":"2025-04-03T14:44:50.000Z","dependencies_parsed_at":"2024-08-05T11:14:39.804Z","dependency_job_id":"146564b6-af37-4368-b2a4-d293f47374b2","html_url":"https://github.com/agraef/purr-data","commit_stats":{"total_commits":4645,"total_committers":41,"mean_commits":"113.29268292682927","dds":0.5427341227125941,"last_synced_commit":"95b6259fcc0658ecd1bf3dbc42a8e7cc9ec4aa4b"},"previous_names":[],"tags_count":70,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agraef%2Fpurr-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agraef%2Fpurr-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agraef%2Fpurr-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agraef%2Fpurr-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agraef","download_url":"https://codeload.github.com/agraef/purr-data/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254270646,"owners_count":22042859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-music","dataflow-programming","multimedia","pd-l2ork","pure-data","purr-data"],"created_at":"2024-10-01T15:55:17.164Z","updated_at":"2025-05-15T04:06:55.113Z","avatar_url":"https://github.com/agraef.png","language":"C","readme":"## Purr-Data\n\nMaintainers:\n\n* Ivica Ico Bukvic \u003cico@vt.edu\u003e (Pd-l2ork)\n* Jonathan Wilkes \u003cjancsika@yahoo.com\u003e (Purr Data)\n* Albert Graef \u003caggraef@gmail.com\u003e (GitHub Mirror, JGU Packages)\n\nContact: [DISIS mailing list](http://disis.music.vt.edu/cgi-bin/mailman/listinfo/l2ork-dev)\n\n**GitLab Repository:** \u003chttps://git.purrdata.net/jwilkes/purr-data\u003e\n\nOfficial Purr Data source code in the \"master\" branch.\n\n**GitHub Mirror:** \u003chttps://github.com/agraef/purr-data\u003e\n\nMirrors the GitLab \"master\" branch, and also has \"release\" and \"testing\"\nbranches, binary packages, a website, and a wiki (WIP).\n\nContents:\n\n* [Downloads](#downloads)\n* [One Paragraph Overview](#one-paragraph-overview)\n* [Three Paragraph Overview](#three-paragraph-overview)\n* [Goals](#goals)\n* [User Guide](#user-guide)\n* [Relationship of Purr Data to Pure Data](#relationship-of-purr-data-to-pure-data)\n* [Build Guide](#build-guide)\n  * [Gnu/Linux](#linux)\n  * [OSX](#osx-64-bit-using-homebrew)\n  * [Windows](#windows-64-bit-using-msys2)\n* [Code of Conduct](#code-of-conduct)\n* [Project Governance](#project-governance)\n* [Contributor Guide](#contributor-guide)\n* [Human Interface Guidelines](#human-interface-guidelines)\n* [Core Pd Notes](#core-pd-notes)\n* [GUI Message Spec](#gui-messaging-specification)\n\n### One Paragraph Overview\n\nPure Data (aka Pd) is a visual programming language.  That means you can use it\nto create software graphically by drawing diagrams instead of writing lines of\ncode.  These diagrams show how data flows through the software, displaying on\nthe screen what text-based languages require you to piece together in your mind.\n\n### Three Paragraph Overview\n\nPd has been designed with an emphasis on generating sound, video,\n2D/3D graphics, and connecting through sensors, input devices, and MIDI as well\nas OSC devices.\n\nPd has a special emphasis on generating audio and/or video in real time, with\nlow latency.  Much of its design focuses on receiving, manipulating, and\ndelivering high-quality audio signals.  Specifically, the software addresses\nthe problem of how to do this efficiently and reliably on general purpose\noperating systems like OSX, Windows, Debian, etc.-- i.e., systems designed\nmainly for multi-tasking.\n\nPd can easily work over local and remote networks.  It can be used to integrate\nwearable technology, motor systems, lighting rigs, and other equipment. Pd is\nalso suitable for learning basic multimedia processing and visual programming\nmethods, as well as for realizing complex systems for large-scale projects.\n\n### Goals\n\nPurr-Data has the following goals:\n\n1. Documentation.  We like documentation.  It's like code, except friendly.\n2. Be reliable.  Binary releases must be usable for performances and\n   installations.  The git repo must always be in a workable state that can be\n   compiled.  Regressions must be fixed quickly.\n3. Be discoverable.  Undocumented features are buggy.  Missing help files are\n   bugs.  Patches for new functionality that lack documentation are spam.\n4. Be consistent.  Consistent interfaces are themselves a kind of\n   documentation.  We like documentation, so it follows that we like consistent\n   interfaces.\n\n### User Guide and Weblinks\n\nFor a more in-depth look at Purr Data for new users and developers, see:\n\n\u003chttps://agraef.github.io/purr-data-intro/Purr-Data-Intro.html\u003e\n\nFor more resources see:\n\n\u003chttps://agraef.github.io/purr-data/\u003e\n\nFor Ico Bukvic's original Pd-l2ork website see:\n\n\u003chttp://l2ork.music.vt.edu/main/make-your-own-l2ork/software/\u003e\n\n### Relationship of Purr Data to Pure Data\n\nAt the time of this writing, there are four maintained distributions of Pure\nData, two of which (Purr Data, Pd-l2ork) belong to the Pd-extended lineage.\n\n1. Purr Data. This started out as the 2.0 version of Pd-l2ork. It ships with\n   lots of external libraries and uses a modern GUI written using HTML5.\n2. Pd-l2ork is the version used by Ivica Bukvic for his laptop orchestra.\n   Pd-l2ork 1.0 used tcl/tk (and tkpath) for the GUI. Pd-l2ork 2.x is a fork\n   of an earlier Purr Data version which is developed separately. You can find\n   these [here](http://l2ork.music.vt.edu/main/make-your-own-l2ork/software/).\n3. Pure Data \"Vanilla\".  Miller Puckette's personal version which he hosts on\n   his website and maintains.  It doesn't come with external libraries\n   pre-installed, but it does include an interface you can use to search\n   and install external libraries maintained and packaged by other developers.\n4. Plugdata. A new libpd-based distribution of Pure Data which can be run as a\n   plugin. See \u003chttps://plugdata.org/\u003e.\n\n### Downloads\n\n**Windows, Ubuntu, and Mac OSX:**\n\nReleases are done on Albert Gräf's GitHub mirror, which also provides a\nwebsite, wiki, additional documentation, and an up-to-date mirror of the\nsource code repository.\n\n\u003chttps://github.com/agraef/purr-data/releases\u003e\n\n**More Linux packages:**\n\nPackages for various Linux distributions (including Arch, Debian, Ubuntu, and\nFedora) are available through the JGU package repositories maintained by\nAlbert Gräf on the OBS (Open Build System). Detailed instructions can be found\n[here](https://github.com/agraef/purr-data/wiki/Installation#linux).\n\nYou can also just go to the [OBS Download](https://software.opensuse.org/download/package?package=purr-data\u0026project=home%3Aaggraef%3Apurr-data-jgu), pick your Linux system, and follow\nthe instructions.\n\n### Build Guide\n\nPurr Data is usually built by just running `make` in the toplevel source\ndirectory after checking out the sources from its git repository. This works\nacross all supported platforms (Linux, Mac and Windows at this time).\nThe Makefile also offers the customary targets to clean (`make clean`, or\n`make realclean` to put the sources in pristine state again) and to roll a\nself-contained distribution tarball (`make dist`), as well as some other\nconvenience targets (please check the comments at the beginning of the Makefile\nfor more information).\n\nHowever, to make this work, you will most likely have to install some\nprerequisites first: *build tools* such as a C/C++ compiler and the make\nprogram itself, as well as *dependencies*, the libraries that Purr Data needs.\nDetailed instructions for each of the supported platforms are given below.\n\n#### Linux\n\nTime to build: *10 minutes light install, 45 minutes to 1.5 hours full install*\nHard drive space required: *roughly 2.5 GB*\n\n0. Remember to update your packages:\n\n        sudo apt-get update \u0026\u0026 sudo apt-get upgrade\n\n1. Install the dependencies:\n\n        sudo apt-get install bison flex automake libasound2-dev \\\n             libjack-jackd2-dev libtool libbluetooth-dev libgl1-mesa-dev \\\n             libglu1-mesa-dev libglew-dev libmagick++-dev libftgl-dev \\\n             libgmerlin-dev libgmerlin-avdec-dev libavifile-0.7-dev \\\n             libmpeg3-dev libquicktime-dev libv4l-dev libraw1394-dev \\\n             libdc1394-22-dev libfftw3-dev libvorbis-dev ladspa-sdk \\\n             dssi-dev tap-plugins invada-studio-plugins-ladspa blepvco \\\n             swh-plugins mcp-plugins cmt blop slv2-jack omins rev-plugins \\\n             libslv2-dev dssi-utils vco-plugins wah-plugins fil-plugins \\\n             mda-lv2 libmp3lame-dev libspeex-dev libgsl0-dev \\\n             portaudio19-dev liblua5.3-dev python-dev libsmpeg0 libjpeg62-turbo \\\n             libgsm1-dev libgtk2.0-dev git libstk0-dev \\\n             libfluidsynth-dev fluid-soundfont-gm byacc \\\n             python3-markdown\n\n   **Note:** The given package names are for a generic Debian/Ubuntu system.\n   However, package names and versions vary *a lot* between different Linux\n   distributions and releases, thus it's impossible to give a definitive and\n   up-to-date package list here.  Please consult your distribution's\n   documentation and package manager to find the exact package names for your\n   system.\n\n2. The gui toolkit may require installing the following extra dependencies\n\n        sudo apt-get install gconf2 libnss3\n\n3. Clone the Purr-Data repository *(2 to 10 minutes)*\n\n        git clone https://git.purrdata.net/jwilkes/purr-data.git\n\n4. Compile the code *(5 minutes [light] to 1.5 hours [full])*\n\n   * to build only the core: `make light` *(5 minutes)*\n   * to build the core and all externals: `make all` *(20 minutes to 1.5 hours)*\n   * to build everything *except* Gem: `make incremental` *(10 to 20 minutes)*\n\n5. If you're using an apt-based Linux distribution and you have the necessary\n   Debian packaging tools installed, there should now be an installer file in\n   the main source directory, which can be installed as usual. Otherwise, run\n   `make install` to install the software, and `make uninstall` to remove it\n   again.\n\n#### OSX 64-bit using Homebrew\n\nTime to build: *50 minutes to 1.5 hours*  \nHard drive space required: *roughly 2 GB*\n\n1. Install [Homebrew](https://brew.sh) *(15 minutes)*\n   (asks for password twice-- once for command line tools, once for homebrew)\n\n2. Install the dependencies *(10 minutes)*:\n\n        brew install wget\n        brew install autoconf\n        brew install automake\n        brew install libtool\n        brew install fftw\n        brew install python\n        brew install lua\n        brew install fluidsynth\n        brew install faac\n        brew install jpeg\n        brew install lame\n        brew install libvorbis\n        brew install speex\n        brew install gsl\n        brew install libquicktime\n        brew install sdl2\n        brew install pkg-config\n\n   You'll also need to install the python markdown module to generate the\n   platform-specific release notes (ReadMe.html, Welcome.html):\n\n        pip3 install markdown\n\n   **Note:** Depending on your macOS and Xcode version, the 10 minutes\n   estimate for this step may be a overly optimistic. Some build dependencies\n   may require recompilation which can take a long time (up to several hours,\n   if it includes a complete build of, e.g., gcc and cmake).\n\n3. Clone the Purr-Data repository *(10 minutes)*\n\n        git clone https://git.purrdata.net/jwilkes/purr-data.git\n\n4. Change to the source directory\n\n        cd purr-data\n\n5. Build the OSX app and the installer disk image (.dmg file) *(15 minutes)*\n\n        make\n\n6. There should now be a .dmg file in your current directory, which lets you\ninstall the app in the usual way\n\n#### Windows 64-bit Using msys2\n\nTime to build: *roughly 1.5 hours-- 30 minutes of this is for Gem alone*  \nHard drive space required to build: *rougly 2.5 GB*\n\n**Important note:** We recommend doing the build under your msys2 home\ndirectory (usually /home/username in the msys2 shell). This directory should\nnot have any spaces in it, which would otherwise cause trouble during the\nbuild. Never try using your Windows home directory for this purpose instead,\nsince it will usually contain spaces, making the build fail.\n\n1. In a browser, navigate to: `https://git.purrdata.net/jwilkes/ci-runner-setup/-/raw/master/win64_install_build_deps.ps1`\n2. Select all with `\u003ccontrol-a\u003e`\n3. Right-click and choose \"Copy\"\n4. In the Start menu type `PowerShell ISE` and click the \"Windows Powershell ISE\" app that pops up.\n5. In the Powershell ISE window menu, choose File -\u003e New\n6. In the area with the white background, right-click and choose \"Paste\" \n7. Click the `Run Script` arrow in the toolbar *(20 minutes)*\n8. If there were no errors in the script, msys2 and Inno Setup are now installed.\n9. Open the directory \"C:\\msys64\" and click `mingw64.exe`\n10. Download the source code *(3-6 minutes)*  \nIn the msys terminal window, issue the following command to create a new directory \"purr-data\" and clone the repository to it:\n\n        git clone https://git.purrdata.net/jwilkes/purr-data.git\n\n6. Enter the source directory *(less than a minute)*\n\n        cd purr-data\n\n7. Finally, build Purr-Data *(45-80 minutes)*\n\n        make\n\n8. Look in the top level source directory and double-click the setup file to\n   start installing Purr Data on your system or run `./\"setup file name\"` in MSYS2 shell.\n\n### Code of Conduct\n\n1. No sarcasm, please.\n2. Don't appear to lack empathy.\n3. You can't live here. If you're spending hours a day writing Purr Data\n   code or-- worse-- spending hours a day *writing emails about* code that \n   has yet to be written, you're doing it wrong.\n4. If working on something for the first time, ask to be mentored.\n5. If no one asked you to mentor them, don't teach.\n6. It is better to let small things go than to risk taking time away from\n   solving bigger problems.\n\nIt is a bad idea to break this Code of Conduct *even if* no one complains\nabout your behaviour.\n\n### Project Governance\n\n* The three maintainers listed at the top of this document are the ones in\n  charge of this project.\n* Unanimous decisions are preferred.\n* 2 out of 3 can break a disagreement.\n* There will only ever be three maintainers of this project at any given time.\n  If you'd like to temporarily step in as one of the three,\n  send an inquiry to the list and we can discuss it.\n\n### Contributor Guide\n\nContributing is easy:\n\n1. Join the development list:\n   http://disis.music.vt.edu/cgi-bin/mailman/listinfo/l2ork-dev\n2. Fork Purr Data using the gitlab UI and then try to build it from source\n   for your own platform using the [Build Guide](#build-guide) above. \n   If you run into problems ask on the development list for help.\n3. Once you have successfully built Purr Data, install it and make sure it\n   runs correctly.\n4. Start making changes to the code with brief, clear commit messages. If you\n   want some practice you can try fixing one of the bugs on the issue tracker\n   labeled\n   [\"good-first-bug\"](https://git.purrdata.net/jwilkes/purr-data/issues?label_name%5B%5D=good-first-bug)\n5. One you are done fixing the bug or adding your feature, make a merge request\n   in the Gitlab UI so we can merge the fix for the next release.\n\nA few guidelines:\n* There should be a short and clear commit message for each merge request.\n* Short and clear title and description are required for each merge request.\n* There should be a short branch name related to the issue, like \"update-readme\".\n* _No prototypes, please_. Purr Data's biggest strength is that users can\n  turn an idea into working code very quickly. But a prototyping language that \n  is itself a prototype isn't very useful. That means Purr Data's core code\n  and libraries must be stable, consistent, well-documented, and easy to use.\n* Develop incrementally. Small, solid improvements to the software are\n  preferable to large, disruptive ones.\n* Try not to duplicate existing functionality.\n  For backwards compatibility Purr Data ships many legacy\n  libraries which unfortunately duplicate the same functionality. This makes\n  it harder to learn how to use Pd, and makes it burdensome to read patches\n  and keep track of all the disparate implementations.\n* Keep dependencies to a minimum. Cross-platform dependency handling is\n  unfortunately still an open research problem. In the even that you need\n  an external library dependency, please mirror it at git.purrdata.net\n  so that the build system doesn't depend on the availability of external\n  infrastructure.\n\nHere are some of the current tasks:\n\n* Writing small audio/visual Pd games or demos to include in the next release\n  * Skills needed: Ability to write Pd programs\n  * Status: I wrote a little sprite-based game that will ship with the next\n    version of Pd-L2Ork.  In it, the character walks around in an actual\n    Pd diagram shoots at the objects to progress, and to make realtime\n    changes to the music.\n    What I'd like is to include a new, smallish game with each release\n    that has a link in the Pd console.  It can be a little demo or game,\n    just something fun that shows off what can be done using Pure Data.\n* Designing/Implementing regression test template\n  * Skills needed: Knowledge about... regression tests. :)  But also some\n    expertise in using Pd so that the tests themselves can\n    be written in Pure Data.  At the same time, they should\n    be able to be run as part of the automated packaging\n    process (i.e., in -nogui mode).\n  * Status: Some externals have their own testing environments, but they are\n    limited as they require manual intervention to run and read the\n    results inside a graphical window.\n    We currently have a crude test system that at least ensures that each\n    external library instantiates without crashing.\n    Here's an email thread with Katja Vetter's design, which looks to\n    be automatable:\n    http://markmail.org/message/t7yitfc55anus76i#query:+page:1+mid:chb56ve7kea2qumn+state:results\n    And Mathieu Bouchard's \"pure unity\" (not sure if this is the most\n    recent link...):\n    http://sourceforge.net/p/pure-data/svn/HEAD/tree/tags/externals/pureunity/pureunity-0.0/\n* Adding support for double precision to the external libraries that ship with purr-data\n  * Skills needed: Knowledge about data types in C language(specially float and double)\n  * Status: The core classes of purr data and the freeverb~ external library\n    have been changed to support both float and double but still the remaining\n    external libraries only have support for single precision.\n    The task ahead is to add double precision support to these external libraries.\n    As per the current resources we have the merge requests that have been used to add double\n    precision support to the core libraries:\n    https://git.purrdata.net/jwilkes/purr-data/merge_requests?scope=all\u0026utf8=%E2%9C%93\u0026state=merged\u0026author_username=pranay_36\n    And Katja Vetter's double precision patches to the pd-double project which were\n    actually used for adding double precision support to the core libraries of purr-data.\n    https://github.com/pd-projects/pd-double/commit/982ad1aa1a82b9bcd29c5b6a6e6b597675d5f300\n\n### Human Interface Guidelines\n\n#### General Look and Feel\n\nPd is a multi-window application that consists of three parts:\n\n1. A main window, called the \"Pd Window\" or \"Console Window\". This window\n   displays informational and error messages for Pd programs.\n2. One or more \"canvas\" windows-- aka \"patch\" windows, used to display the\n   diagrams that make up a Pd program.\n3. One or more dialog windows used to configure the various parts of Pd.\n\nAll should look simple and uncluttered. Although \"canvas\" windows cannot\n(yet) be traversed and edited using only the keyboard, all three parts of Pd\nshould be designed so that they can be manipulated using only the keyboard.\n\n### Hooks for new users\nIt should also be possible to produce sound and interact when a new user runs\nprogram for the very first time. In every release, there should be a link at\nthe bottom of the Console Window to a short game written in Pd that demonstrates\none or more of the capabilities of the Pd environment. The game should be\ndesigned to be fun outside of its efficacy as a demonstration of Pd.\n\n#### Fonts\nPd ships with \"DejaVu Sans Mono\", which is used for the text in canvas windows.\nFonts are sized to fit the hard-coded constraints in Pd Vanilla. This way box\nsizes will match as closely as possible across distributions and OSes.\n\nThese hard-coded sizes are maximum character widths and heights. No font\nfits these maximums exactly, so it's currently impossible to tell when looking\nat a Pd canvas whether the objects will collide on a system using a different\nfont (or even a different font-rendering engine).\n\nDialogs and console button labels may use variable-width fonts. There is not\nyet a suggested default to use for these.\n\nThe console printout area currently uses \"DejaVu Sans Mono\". Errors are printed\nas a link so that the user can click them to highlight the corresponded canvas\nor object that triggered the error.\n\n#### Colors\n\nNothing set in stone yet.\n\n### Core Pd Notes\n\nThe following is adapted from Pd Vanilla's original source notes.  (Found\nin pd/src/CHANGELOG.txt for some reason...)\n\nSections 2-3 below are quite old.  Someone needs to check whether they even\nhold true for Pd Vanilla anymore.\n\n#### Structure definition roadmap.\n\nFirst, the containment tree of things\nthat can be sent messages (\"pure data\").  (note that t_object and t_text,\nand t_graph and t_canvas, should be unified...)\n\nBEFORE 0.35:\n\n    m_pd.h      t_pd                        anything with a class\n                    t_gobj                  \"graphic object\"\n                        t_text              text object\n    g_canvas.h\n                        t_glist             list of graphic objects\n    g_canvas.c              t_canvas        Pd \"document\"\n\nAFTER 0.35:\n\n    m_pd.h      t_pd                        anything with a class\n                    t_gobj                  \"graphic object\"\n                        t_text              patchable object, AKA t_object\n    g_canvas.h              t_glist         list of graphic objects, AKA t_canvas\n\nOther structures:\n\n    g_canvas.h  t_selection -- linked list of gobjs\n                t_editor -- editor state, allocated for visible glists\n    m_imp.h     t_methodentry -- method handler\n                t_widgetbehavior -- class-dependent editing behavior for gobjs\n                t_parentwidgetbehavior -- objects' behavior on parent window\n                t_class -- method definitions, instance size, flags, etc.\n\n#### 1. Coding Style\n\n1.0  C coding style.  The source should pass most \"warnings\" of C compilers\n(-Wall on Linux, for instance-- see the makefile.)  Some informalities\nare intentional, for instance the loose use of function prototypes (see\nbelow) and uncast conversions from longer to shorter numerical formats.\nThe code doesn't respect \"const\" yet.\n\n1.1.  Prefixes in structure elements.  The names of structure elements always\nhave a K\u0026R-style prefix, as in `((t_atom)x)-\u003ea_type`, where the `a_` prefix\nindicates \"atom.\"  This is intended to enhance readability (although the\nconvention arose from a limitation of early C compilers.)  Common prefixes are:\n  * `w_` (word)\n  * `a_` (atom)\n  * `s_` (symbol)\n  * `ob_` (object)\n  * `te_` (text object)\n  * `g_` (graphical object)\n  * `gl_` (glist, a list of graphical objects).\n\nAlso, global symbols sometimes get prefixes, as in `s_float` (the symbol whose\nstring is \"float\").  Typedefs are prefixed by `t_`.  Most _private_ structures,\ni.e., structures whose definitions appear in a \".c\" file, are prefixed by `x_`.\n\n1.2.   Function arguments.  Many functions take as their first\nargument a pointer named `x`, which is a pointer to a structure suggested\nby the function prefix; e.g., `canvas_dirty(x, n)` where `x` points to a canvas\n`(t_canvas *x)`.\n\n1.3.  Function Prototypes.  Functions which are used in at least two different\nfiles (besides where they originate) are prototyped in the appropriate include\nfile. Functions which are provided in one file and used in one other are\nprototyped right where they are used.  This is just to keep the size of the\n\".h\" files down for readability's sake.\n\n1.4.  Whacko private terminology.  Some terms are lifted from other historically\nrelevant programs, notably \"ugen\" (which is just a tilde object; see d_ugen.c.)\n\n1.5.  Spacing.  Tabs are 8 spaces; indentation is 4 spaces.  Indenting\ncurly brackets are by themselves on their own lines, as in:\n\n```c\nif (x)\n{\n    x = 0;\n}\n```\n\nLines should fit within 80 spaces.\n\n#### 2. Compatibility with Max\n\n2.0.  Max patch-level compatibility.  \"Import\" and \"Export\" functions are\nprovided which aspire to strict compatibility with 0.26 patches (ISPW version),\nbut which don't get anywhere close to that yet.  Where possible, features\nappearing on the Mac will someday also be provided; for instance, the connect\nmessage on the Mac offers segmented patch cords; these will devolve into\nstraight lines in Pd.  Many, many UI objects in Opcode Max will not appear in\nPd, at least at first.\n\n#### 3. Source-level Compatibility with Max\n\n3.0.  Compatibility with Max 0.26 \"externs\"-- source-level compatibility. Pd\nobjects follow the style of 0.26 objects as closely as possible, making\nexceptions in cases where the 0.26 model is clearly deficient.  These are:\n\n3.1.  Anything involving the MacIntosh \"Handle\" data type is changed to use\nchar * or void * instead.\n\n3.2.  Pd passes true single-precision floating-point arguments to methods;\nMax uses double.\nTypedefs are provided:\n\n    t_floatarg, t_intarg for arguments passed by the message system\n    t_float, t_int for the \"word\" union (in atoms, for example.)\n\n3.3.  Badly-named entities got name changes:\n\n    w_long --\u003e w_int (in the \"union word\" structure)\n\n3.4.  Many library functions are renamed and have different arguments;\nI hope to provide an include file to alias them when compiling Max externs.\n\n#### 4. Function name prefixes\n\n4.0.  Function name prefixes.\nMany function names have prefixes which indicate what \"package\" they belong\nto.  The exceptions are:\n\n    typedmess, vmess, getfn, gensym (m_class.c)\n    getbytes, freebytes, resizebytes (m_memory.c)\n    post, error, bug (s_print.c)\nwhich are all frequently called and which don't fit into simple categories.\nImportant packages are:\n\n    (pd-gui:)   pdgui -- everything\n    (pd:)       pd -- functions common to all \"pd\" objects\n                obj -- fuctions common to all \"patchable\" objects ala Max\n                sys -- \"system\" level functions\n                binbuf -- functions manipulating binbufs\n                class -- functions manipulating classes\n                (other) -- functions common to the named Pd class\n\n#### 5. Source file prefixes\n\n5.0. Source file prefixes. \n\nPD:\n\n    s    system interface\n    m    message system\n    g    graphics stuff\n    d    DSP objects\n    x    control objects\n    z    other\n\nPD-GUI:\n\n    gui    GUI front end\n\n#### 6. Javascript style\n1. Brackets on the same line as declaration or expression: `if (a) {`.\n2. Single line comments only: `//`.\n3. Use double-quotes for strings.\n4. Use underscores to separate words of function names and variables.\n\n### GUI Messaging Specification\n#### Public GUI interface\n\nPurpose: a set of functions to communicate with the gui without putting\nlanguage-specific strings (like tcl) into the C code.  The new interface is a\nstep toward separating some (but not all) of the GUI logic out from the C code.\nOf course the GUI can still be designed to parse and evaluate incoming messages\nas commands.  But the idiosyncracies of the GUI toolkit can be limited to\neither the GUI code itself or to a small set of modular wrappers around\nsys_vgui.\n\nThe public interface consists of the following:\n\n```c\ngui_vmess(const char *msg, const char *format, ...);\n```\n\nwhere `const char *format` consists of zero or more of the following:\n\n* f - floating point value (`t_float`)\n* i - integer (`int`)\n* s - c string (`char*\t)\n* x - hexadecimal integer value, with a precision of at least six digits.\n      (hex value is preceded by an 'x', like `x123456`)\n\nFor some of Pd's internals like array visualization, the message length may\nvary. For these _special_ cases, the following functions allow the developer\nto iteratively build up a message to send to the GUI.\n\n```c\ngui_start_vmess(const char *msg, const char *format, ...);\ngui_start_array();      // start an array\ngui_f(t_float float);   // floating point array element (t_float)\ngui_i(int int);         // integer array element (int)\ngui_s(const char *str); // c string array element\ngui_end_array();        // end an array\ngui_end_vmess();        // terminate the message\n```\n\nThe above will send a well-formed message to the GUI, where the number of array\nelements are limited by the amount of memory available to the GUI. Because of\nthe complexity of this approach, it may _only_ be used when it is necessary to\nsend a variable length message to the GUI. (Some of the current code may\nviolate this rule, but that can be viewed as a bug which needs to get fixed.)\n\nThe array element functions gui_f, gui_i, and gui_s may only be used inside an\narray.  Arrays may be nested, but this adds complexity and should be avoided if\npossible.\n\n#### Private Wrapper for Nw.js Port\n\nThe public functions above should fit any sensible message format.\nUnfortunately, Pd's message format (FUDI) is too simplistic to handle arbitrary\nc-strings and arrays, so it cannot be used here. (But if it happens to improve\nin the future it should be trivial to make a wrapper for the public interface\nabove.)\n\nThe current wrapper was made with the assumption that there is a Javascript\nEngine at the other end of the message. Messages consist of a selector,\nfollowed by whitespace, followed by a comman-delimited list of valid Javascript\nprimitives (numbers, strings, and arrays). For the arrays, Javascript's array\nnotation is used. This is a highly idiosyncratic, quick-and-dirty approach.\nBut the point is that the idiosyncracy exists in a single file of the source\ncode, and can be easily made more modular (or replaced entirely by something\nelse) without affecting _any_ of the rest of the C code.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagraef%2Fpurr-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagraef%2Fpurr-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagraef%2Fpurr-data/lists"}