All Projects → mganss → pdjs

mganss / pdjs

Licence: BSD-3-Clause license
JavaScript External for Pure Data based on V8

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to pdjs

PdWebParty
An app that allows Pd users to run patches in a web browser and share them with a web link
Stars: ✭ 37 (-17.78%)
Mutual labels:  puredata, pd, puredata-external
mdeGranular
granular synthesis external for MaxMSP and PD
Stars: ✭ 16 (-64.44%)
Mutual labels:  puredata, pd
docker-v8
Docker V8 Image
Stars: ✭ 26 (-42.22%)
Mutual labels:  v8
pd-autotuned
an autotuner for Puredata ported from the autotalented LADSPA plugin
Stars: ✭ 16 (-64.44%)
Mutual labels:  puredata
raw-nodejs-api
An users NodeJS API without packages libs or frameworks!
Stars: ✭ 31 (-31.11%)
Mutual labels:  v8
OldCEF4Delphi
OldCEF4Delphi is an open source project to embed Chromium-based browsers in applications made with Delphi.
Stars: ✭ 55 (+22.22%)
Mutual labels:  v8
pd-aubio
aubio external for PureData
Stars: ✭ 20 (-55.56%)
Mutual labels:  puredata
abclib
Faust code for ambisonic and multi-channel mixed music
Stars: ✭ 34 (-24.44%)
Mutual labels:  puredata
Framework
Advanced modding framework for multiplayer modifications
Stars: ✭ 21 (-53.33%)
Mutual labels:  v8
coverage-node
A simple CLI to run Node.js and report code coverage.
Stars: ✭ 39 (-13.33%)
Mutual labels:  v8
browser-exploitation
A collection of curated resources and CVEs I use for research.
Stars: ✭ 71 (+57.78%)
Mutual labels:  v8
openrasp-v8
Google V8 with OpenRASP builtins
Stars: ✭ 42 (-6.67%)
Mutual labels:  v8
v8-android-buildscripts
V8 build scripts for React Native Android
Stars: ✭ 63 (+40%)
Mutual labels:  v8
Javet
Javet is Java + V8 (JAVa + V + EighT). It is an awesome way of embedding Node.js and V8 in Java.
Stars: ✭ 218 (+384.44%)
Mutual labels:  v8
node-mini
Mini Node.js runtime built on V8
Stars: ✭ 24 (-46.67%)
Mutual labels:  v8
all-about-node
All about Node.js
Stars: ✭ 16 (-64.44%)
Mutual labels:  v8
react-native-js-benchmark
JavaScript Engine Benchmark for React Native
Stars: ✭ 100 (+122.22%)
Mutual labels:  v8
python-react-v8
⭐ Render React.js views server-side
Stars: ✭ 79 (+75.56%)
Mutual labels:  v8
V8Android
A demo APP for embedding V8 engine in Android APP
Stars: ✭ 45 (+0%)
Mutual labels:  v8
upp
Universal Polyphonic Player (UPP) for Pure Data
Stars: ✭ 14 (-68.89%)
Mutual labels:  puredata

pdjs

GitHub Actions codecov

A JavaScript external for Pure Data based on V8.

pdjs tries to emulate Max's js object. Many JavaScript source files written for Max js should work unchanged with pdjs.

While the Max js object uses a version of Mozilla's SpiderMonkey JavaScript engine that was released in 2011 with Firefox 4.0 and thus lacks many newer language features (such as let), pdjs uses Google's V8 JavaScript engine which supports the latest ECMAScript standards and provides much better performance.

Supported platforms

  • Windows x64
  • Linux x64
  • Linux arm64
  • Linux arm
  • macOS x64

Usage

You can install through deken or grab a zip from releases. Then create a js object giving it the name of a JavaScript file, e.g. js src.js, relative to your patch or absolute. You might also have to add a declare -path pdjs object so that PD can find the external. For more usage information you can consult the Max JavaScript documentation which applies to pdjs as well.

Feature support

General

There is no built-in editor like in Max, source files have to be created and edited outside of Pure Data.

Arguments

  • filename
  • inlets-outlets
  • jsarguments

Messages

  • bang
  • int (there are no ints in PD)
  • float
  • list
  • anything
  • autowatch
  • compile
  • delprop
  • editfontsize
  • getprop
  • loadbang
  • open (Windows only)
  • setprop
  • statemessage
  • wclose

Special function names

  • msg_int
  • msg_float
  • list
  • anything
  • loadbang
  • getvalueof
  • setvalueof
  • save
  • notifydeleted

Private functions are supported.

Global functions

  • cpost
  • error
  • include
  • messnamed
  • post
  • require
  • arrayfromargs (use Array.from(arguments) or [...arguments] instead)
  • assist
  • declareattribute
  • embedmessage
  • notifyclients
  • outlet
  • setinletassist
  • setoutletassist

Global properties

  • autowatch
  • editfontsize
  • inlet
  • inlets
  • inspector
  • jsarguments (no support for jsargs message)
  • Max
  • maxclass
  • messagename
  • patcher
  • outlets

Other Objects

There is no support currently for other objects such as Buffer, Dict, File, etc.

Sharing JavaScript objects across js object instances

You can pass references to JavaScript objects across js object instances using the jsobject mechanism.

There is also a special global variable called __global__ that references the same object from every js object instance. It's similar to the Global object in Max. Unlike in Max, you can also call functions contained in the __global__ object.

Building

pdjs uses CMake to build. Prebuilt V8 binaries can be downloaded from my V8 fork and pd.build is used to build the external library.

Prerequisites

V8 libraries

The build process expects the V8 library v8_monolith library in v8/lib/[platform], e.g. v8/lib/x64-linux. You can either download prebuilt binaries from https://github.com/mganss/v8/releases/latest or build your own. This repo contains the GN configuration files that were used to build V8 in the v8 directory.

Building

Also check out the GitHub Actions workflow definition for more details on the build process.

Windows

Open the top-level directory of the repo in VS and hit F6. The CMakeSettings.json contains 4 configurations: x64-Debug and x64-Release for Windows builds and WSL-GCC-Debug and WSL-GCC-Release for x64 Linux builds through WSL.

Linux

mkdir -p out/build/x64-linux-Debug
cmake -G Ninja \
  -DVERSION=1.0 \
  -DCMAKE_BUILD_TYPE=Debug \
  -B out/build/x64-linux-Debug -S .
cmake --build out/build/x64-linux-Debug -- -v
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].