Skip to content

A short course in p5.js for students on the Untangled creative coding course

Notifications You must be signed in to change notification settings

neontribe/untangled-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Untangled P5 Template Project

For the Untangled 'step by step task' guide please go here

To run the Project

In your terminal window type:

git clone git@github.com:neontribe/untangled-template.git
cd untangled-template
npm install
npm run dev

The last command will start browser-sync which will allow you to run the project in your browser. Your terminal will tell you the address of your sketch, it will look something like this:

[Browsersync] Access URLs:
 ---------------------------------------
       Local: http://localhost:3000

Your browser should open your sketch in a new tab automatically. If for any reason the window closes, copy and paste this address into your browser and you should see your sketch.

If a window opens, but you don't see your sketch, hit f12 or right-click and select 'inspect' in your browser window and look for error messages in your console.


To add a library

You can find libraries that work with p5.js here

Of course you can install any other library you like like Tone.js or Matter

You can do this either by importing the library files directly into your project or by installing via NPM

Working with audio

If you are using audio, you might get a message in your dev tools console (f12) that looks something like this:

Context.js:15 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu

A simple way around this is to install unmute using

npm install unmute

Add a mute button to your sketch by including the following lines of code at the top of your sketch js file:

import UnmuteButton from 'unmute'

UnmuteButton()

About

A short course in p5.js for students on the Untangled creative coding course

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published