Skip to content

Commit

Permalink
Merge branch 'master' into OSC-support
Browse files Browse the repository at this point in the history
  • Loading branch information
msawired committed Sep 16, 2024
2 parents a4cd726 + 30f3f0a commit b903185
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@

/oscServer/node_modules
/node_modules
.release-it.json
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,23 @@ This is a helper library that allows generative art project to provide a UI to p

OP Configurator communicates with the UI elements via postMessage() in browsers. This also allows configurator to be implemented across frames, making it suitable for use with iframes in code editors. Library can also be overridden to use the same mapping to other interfaces, such as physical buttons, knobs, sliders, etc.

OPC also supports OSC [Open Sound Control](https://en.wikipedia.org/wiki/Open_Sound_Control) protocol and can connect to a websocket server to send/receive OSC data. See [OSC Support](#osc).
OPC also supports OSC [Open Sound Control](https://en.wikipedia.org/wiki/Open_Sound_Control) protocol and can connect to a websocket server to send/receive OSC data. See [OSC Support](#osc-support).

## Installation
On OpenProcessing, just toggle on the "OP Configurator 3000" in the default libraries list. On an HTML project, you can manually load it as below:
```html
<script src="https://cdn.jsdelivr.net/gh/msawired/OPC@latest/opc.min.js"></script>
```
This will automatically enable the OPC interface on OpenProcessing.

If you are creating a project outside of OpenProcessing, you can also use example client files to create a similar basic interface on your HTML document. (Check out [example/index.html](https://github.com/msawired/OPC/blob/master/example/index.html))
```html
<script src="https://cdn.jsdelivr.net/gh/msawired/OPC@latest/opc_client.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/msawired/OPC@latest/opc_client.css">
```

Remember to replace the "latest" in the URLs above with the most recent release version to prevent future updates break your project.


## Example

Expand Down
4 changes: 2 additions & 2 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<head>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/p5.js" type="text/javascript"></script>
<script src="../opc.js" type="text/javascript"></script>
<script src="../opc-client.js" type="text/javascript"></script>
<script src="../opc_client.js" type="text/javascript"></script>
<script src="mySketch.js" type="text/javascript"></script>
</head>
<link rel="stylesheet" href="../opc-client.css">
<link rel="stylesheet" href="../opc_client.css">
<body>
</body>

Expand Down
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "op-configurator",
"version": "0.5.2",
"description": "A parameter controller allowing easy creation of dynamic variables that can be controlled with standard UI (HTML form elements).",
"main": "opc.js",
"directories": {
"example": "example"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/msawired/OPC.git"
},
"keywords": [
"p5js",
"openprocessing",
"generative"
],
"author": "https://github.com/msawired",
"license": "MIT",
"bugs": {
"url": "https://github.com/msawired/OPC/issues"
},
"homepage": "https://github.com/msawired/OPC#readme"
}

0 comments on commit b903185

Please sign in to comment.