Giter VIP home page Giter VIP logo

vvvv.js's Introduction

** NOTICE: THIS IS THE INSTABLE MASTER. Existing documentation on http://vvvvjs.com is refering to the v1.0 tag, and might differ from this version.**

VVVV.js - Visual Web Client Programming

www.vvvvjs.com

The visual programming language VVVV brought to your web browser.

VVVV.js allows you to use the world's greatest visual programming language VVVV to enhance your web projects. You can create 2D Canvas and 3D WebGL graphics without writing a single line of code. It comes with a built in, browser based patch editor, you don't need any additional software.

Main Features

  • Run VVVV Patches seemlessly embedded in your web project
  • Real-time patching using the built in browser based patch editor
  • Supports subpatches so you can better structure your patches
  • 2D Canvas graphics and 3D WebGL graphics with built in shader code editor
  • Access and manipulate the DOM of the surrounding page from your VVVV.js patch
  • VVVV compatible data format, so you can exchange patch snippets with classic VVVV

Licence

VVVV.js is freely distributable under the MIT license (see details in LICENCE file). Concepts (e.g. nodes, pins, spreads) taken from VVVV (http://www.vvvv.org).

This software uses jQuery, underscore.js, d3.js and glMatrix.js. See the corrensponding licence files in the lib folder for details.

Getting Started

The best way to dive straight into VVVV.js is to head over to the VVVV.js Lab and try it out. There, you can try patching VVVV.js without the need of installing anything. Read on to find out how you can use VVVV.js in your own project.

Loading VVVV.js and running patches

However, here are the single steps:

  1. Download and install Node.js 6.x

  2. Download or clone VVVV.js into /your/project/directory/vvvv_js

  3. In your console/terminal change to the vvvv.js directory and run npm install

  4. At this point you can download/clone the VVVV.js template into /your/project/directory/vvvvjs-template. If you decide to go with the template, you can skip over to 7.

  5. In your project directoy create an empty VVVV patch. Just do so by creating an empty .v4p patch. In ths example it is /your/project/directory/main.v4p

  6. Prepare your frontend HTML, so it includes and loads VVVV.js, like this:

/your/project/directory/index.html:

<head>
...
<script language="JavaScript" src="/vvvvjs/lib/require.js"></script>
<script language="JavaScript" src="/vvvvjs/vvvv.js"></script>
<link rel="VVVV" href="main.v4p"/>
<script language="JavaScript">
  VVVVContext.init("/vvvv_js/", 'full', function() {
    console.log('VVVV.js initialized');
  });
</script>
...
</head>

This code initializes VVVV.js on the frontend and loads and runs main.v4p.

  1. In /your/project/directory run

    $ node vvvv_js/server.js . -e

This will run the VVVV.js webserver and serve the current directory (. in the first argument). The -e option will enable patch editing.

http://localhost:5000

This will just show index.html, since your mypatch.v4p is still empty, nothing more will happen. Read on to launch the patch editor

Launching the patch editor

  1. Launch the editor by appending #edit/main.v4p to the URL in the address bar. This will launch the editor in a popup, make sure your browser allows it.

  2. To save, hit CTRL+S in the editor.

Manually loading patches

If the <link> tag method above doesn't suit your needs (e.g. because you don't want to run the patch immeditely), you can create the VVVV.Core.Patch object yourself like so:

<head>
...
<script language="JavaScript" src="/vvvv_js/lib/require.js"></script>
<script language="JavaScript" src="/vvvv_js/vvvv.js"></script>
<script language="JavaScript">
  VVVVContext.init("javascripts/vvvv_js/", 'full', function(VVVV) {
    console.log('VVVV.js initialized');

    var patch = new VVVV.Core.Patch("mypatch.v4p", function() {
      var mainloop = new VVVV.MainLoop(p);
      console.log('patch loaded and started');
    });
  });
</script>
...
</head>

Rendering Patches with the VVVViewer

You can load and render a patch embedded in a web site by first creating a Patch object as shown above, and then pass it to a newly created VVVViewer object:

var myvvvviewer;
var mypatch = new VVVV.Core.Patch("mypatch.v4p", function() {
  myvvvviewer = new VVVV.VVVViewer(this, '#patch');
});

This is the corresponding HTML code:

<div id='patch'>Your browser does not support the VVVViewer</div>

While in the example above the Patch constructor new VVVV.Core.Patch("mypatch.v4p", ...) loads a VVVV patch file from the remote server, it is also possible to just pass actual VVVV XML Code to the constructor instead of a filename. This might be the case, when you display VVVV Code which comes from a forum post or a blog entry.

More Information

Find more information and guides on www.vvvvjs.com.

vvvv.js's People

Contributors

zauner avatar geloescht avatar woeishi avatar mrvux avatar sebllll avatar ccoenen avatar tekcor avatar

Stargazers

neneong avatar Mohamed Ben Khelifa avatar Erik Slovák avatar  avatar  avatar  avatar Joshua Kleckner avatar yiming avatar Maxim Kernozhitskiy avatar  avatar Alpha-00 avatar Robbie Jacobs avatar  avatar  avatar Cat  avatar MAHADELICA avatar Andrea Frola avatar Joe avatar BenDerPan avatar João Faria avatar  avatar sonopictorial avatar Jon avatar Sagar  avatar rrr avatar Migal Denis avatar XU Cong avatar Sven avatar Tommy Leung avatar k avatar origami dance avatar Sen Zheng 郑越升 avatar Brian Zelip avatar Coder of Salvation / Leon van Kammen avatar Artur Myszkowski avatar Alexey Kachalov avatar Felix Groll avatar  avatar Tobias avatar moritzebeling avatar Saranyan avatar Sam Wray avatar Marin Esnault avatar Yifan Shen avatar Aditya Rachman Putra avatar hiro avatar  avatar minhill avatar  avatar Diego BM avatar undeadinu avatar Sagalatov Nicolai avatar Marcus Weiner avatar mwrote avatar  avatar youske avatar zhangbg avatar  avatar Jiim Knopf avatar Yea Chen avatar  avatar Brainvader avatar Xin avatar Ruud van Buul avatar smosgasbord avatar HiST avatar Adam Menges avatar Daniel Samson avatar Oren Shoham avatar Dirk Rathje avatar Andre Tessmann avatar Giò Diani avatar non-linear avatar Jordan Shaw avatar Max Lawrence avatar Eugene Dyko avatar vico avatar Cristian Ababei avatar Ash Weeks avatar Mert Inan avatar Ajinkya Puar avatar Nathakit Sae-Tan avatar Teo Boley avatar Óscar A. Montiel avatar Leon avatar Milan G avatar  avatar Carsten Heisterkamp avatar lby avatar Scott Wadden avatar GeorgeXu avatar amekusa avatar Sho Kamei avatar Andy Oliver avatar  avatar Aria avatar  avatar Vibert Thio avatar Ulric Wilfred avatar Babak Karimi Asl avatar

Watchers

 avatar Bruce LANE avatar Alvaro Obyrne avatar Roman Timashev avatar Ash Weeks avatar  avatar Stefan Ammon avatar  avatar Daisuke Morita avatar Daniel Huber avatar Misak avatar Jia-Rui Lin avatar Michael Anthony avatar  avatar XU Cong avatar Noel Koutlis avatar Laurent Berry avatar Jay Miles avatar  avatar  avatar LeinadLime avatar

vvvv.js's Issues

black color of subpatch background

When I click the right mouse button on subpatch node opens a window for editing, but it leads very strange ... color of background is black. Is this a bug?

Vaudio

Hello! One might ask? Are there any plans to port Vaudio to vvvv.js? And if not, how i can use some audio js library with vvvv.js? Thank you for your attention)

No links are created when loading a patch with node requirements

Steps to reproduce:

  • create a patch with the BeatDetector node
  • save & reload it
    Result (at least on my computer both on Chrome and Firefox)
  • Patch does not execute

By debugging I suspect the problem lies in the beatdetektor library not loading in time before BeatDetecor.evaluate calls the BeatDetektor constructor, but I am not sure about that. I cannot see any exceptions being thrown, however if I use the debugger to step through the script for a few lines after the BeatDetector constructor has executed, everything works fine.

Timeliner node?

@zauner do you plan to add something on the similarity of Timeliner node? If yes, I have a suggestion - please: add music time units (bar beats) and Snap to Grid (if possible). Thanks.

WebAudio API as DirectShow (Audio) replacement

Hello. Currently i'm thinking about implementing ScopeSpread and stuck at Audio ecosystem. I started to write my own FileStream node, but found your own FileStream (Canvas VVVVjs). Do i need to write my own FileStream (DirectShow), that will output Audio as an Object, that contains audio buffer, or i can somehow modify your node? I'm asking this because i found, that you have implemented VideoTexture node, but can't find any DirectShow object.

would version 0.3.0 still be available?

Hello Mr Zauner!
i've been working on a school project where a direct connection between vvvv and vvvvjs would be monumentally helpful
may i ask whether resorting to version 0.3.0 would be the best option, and whether it is still available?
thanks so much in advance!
(we owe you so much for your fantastic and generous contribution!)

Audio nodes new problems

@geloescht, @zauner I must report) Convolver and Waveshaper nodes not work in mozila when development tools is on, when development tools is off this nodes work but irrational in spread mode (when i increases and decreases slice number of spred i get unexpected results (in chrome work same)). More would like to draw attention to the fact that we need a node on the similarity Add(Value Spectral) to avoid wasting CPU. And delay feedback, we have already talked about)

installation problems

ENOENT: no such file or directory, open '/Users/ferdi/Projekte/vvvvjsapp.json'
HTTP Server listening on 0.0.0.0:5000

after starting the server.js script I get this message. vvvv.js doesn't start in browser.

webAudio feedback?

Still need to think about how to implement delay line and in general feedback.

mouse global

hi the mouse global node gives -infinity for y position output when the canvas is placed below another div. I could'nt find the reason. X works.

multiply (value) not updating pin display

It occured to me that multiply input and ouput pin display 0 when hovered over it but in fact something was connected with not 0 or output should be not 0 but some normal float.

Cheers

Audio Nodes: Audio Params

As follow up to this pull request #20

I am at the moment experimenting with pin compatibility, so a pin type can be compatible to multiple other pin types. In this case: VVVV.PinTypes.AudioParam could receive incoming connections from VVVV.PinTypes.WebAudio and VVVV.PinTypes.Value. (or String input pins could also get values from Value pins, to completely break compatibily with classic VVVV ;) )

The other (much quicker) solution would be an option @artofmus suggested: converter nodes from audio signal to audio param, and value to audio param. Like AsAudioParam (WebAudio) and AsAudioParam (Value). This of course would mean that all params would always need one of those two nodes as input

Libs On Demand

Hi, i checked your libs on demand branch and looks like it's not working. If i understanding right, you want to load only requered js files. If you can deeply explain your implementation, maybe i can help you to realise it.

I think libs on demand is important, because currently when we loading some code with webaudio api, all vvvv js engine stops working during the exeption, that throw browsers like Firefox and IE. So to prevent this, we can just don't use this kind of nodes in crossbrowser projects.

Audio Nodes: Spreadability

As follow up to this pull request #20

I guess the "correct way of spreading" would be to indeed create multiple api nodes in a vvvv.js node, and pass those on as a spread.

Meaning, a Delay with two signals as input, and only one value as time input, should create two Delai api nodes, and output a spread of 2.

The other way around, a Delay node with one input signal, and 2 values as time input, should also create two Delay api nodes. At least in theory, as I don't know if it's possible to connect one signal to multiple other nodes.

At least I think this would be how a user would expect it to work, don't you think @geloescht and @artofmus?

Exception in Firefox when changing IOBox value in browser editor

When I change a value in an IOBox via right-click I get the following exception in Fx 36:
TypeError: win.window.document.exitPointerLock is not a function
Also, the IOBox moves with the cursor until I click somewhere inside the editor window.
The pointer lock API seems kinda unmaintained on Firefox. Maybe this is a prefixing issue?

Node.add(In|Out)putPin() should handle pre-existing pins of the same name

When a patch is loaded from XML, pins are created that are mentioned in links but do not exist on nodes themselves. When pins of the same name are created after the patch is loaded, addInputPin() and addOutputPin() overwrite those pre-existing pins without properly destroying them.
I think addInputPin() and addOutputPin() should handle this case by not creating a new pin. Instead, they should reconfigure the existing pin according to the new pin type and default value and return it.
Code like this already exists in GenericShader (EX9.Effect) and I have written some for the Web Audio nodes, but I really think it should be moved to the mentioned functions in order to avoid code duplication and bugs in the future.

audio nodes crash when changing file on Filestream /

@geloescht @zauner

Hi
I was quite amazed when I realized that I could build an online DJ mixer application already now.
So I did that and it worked even with fake scratching due to the delay node.
In the very end I brought in the database for the tracks switching.
But then I realized that the Filestream node crashes if you switch the file.
It initializes correctly on startup with the file name but can change in runtime.
chrome chrashes the tab after slowly dying into freeze. duration showing NaN as visible on the screenshot.

screenshot 2015-05-19 20 51 09

is this the intended way of using it or did i miss a point?
Or is it realy bugged
Maybe call this.evaluate on fileswitching for the audio buffer or something like that?

web audio nodes in subpatch

Found the problem. Web audio nodes can not be connected with io box (node) and it makes it impossible to work in sub-patches?

size of canvas

Please tell me. What and where exactly I should write to the size of the renderer canvas match with a window size of browser, regardless of that scale?

s+h value does not sample correctly

it losses value again when getting 0.

whats the problem here?

this.evaluate = function() {

var maxSize = this.getMaxInputSliceCount();

if (setIn.pinIsChanged() || inputIn.pinIsChanged()) {
  for (var i=0; i<maxSize; i++) {
    if (outputOut.values[i]==undefined) {
      outputOut.setValue(i, 0.0);
    }
    if (Math.round(setIn.getValue(i))>=1) {
      outputOut.setValue(i, inputIn.getValue(i));
    }
  }
  outputOut.setSliceCount(maxSize);
}

}

RenderState Canvas must been damanged in latest versions

Hi,

Animated colors and spread sizes tend to influence Stroke (Canvas) and Blend (Canvas) in a way that the corresponding canvas elements behaves laggy or even brakes completely...

I updated vvvv.js on the latest version and this bahaviour started. the version from like two months ago did not have that problem.

what i am talking about can be observed here pretty well when you click on the animation, the bezier lines that are supposed to fade in are now laggy
http://000.graphics/

and patching something with the stroke and spreaded color breaks it always.

Cheers,
David.

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.