From 4f81f2a55472d2c6701e953600607811ca0502c1 Mon Sep 17 00:00:00 2001 From: Vincent Sijben Date: Thu, 14 Mar 2024 21:51:45 +0100 Subject: [PATCH] new basic example code --- README.md | 29 +++++-------------- .../BPM_Timings/basic/BeatsPerMinute.java | 1 + examples/BPM_Timings/basic/InfoPanel.java | 1 + examples/BPM_Timings/basic/basic.pde | 20 +++++++++++++ resources/build.properties | 4 +-- 5 files changed, 31 insertions(+), 24 deletions(-) create mode 120000 examples/BPM_Timings/basic/BeatsPerMinute.java create mode 120000 examples/BPM_Timings/basic/InfoPanel.java create mode 100644 examples/BPM_Timings/basic/basic.pde diff --git a/README.md b/README.md index 43aa005..02aa8ed 100644 --- a/README.md +++ b/README.md @@ -23,33 +23,18 @@ Install the library by downloading the latest release through the Processing con ## Usage ``` -// Import the library to your sketch import bpm.library.beatsperminute.*; - -// Create the bpm object BeatsPerMinute bpm; -void setup(){ - size(500,500); - - // Initialize the bpm object - bpm = new BeatsPerMinute(this) - //.setBPM(120) // set the starting bpm to 120 - .showInfoPanel() // show the infopanel at the start - //.setInfoPanelY(200) // set the y location of the infopanel to 200 - //.setInfoPanelKey('o') // set the hotkey for toggling the infopanel to 'o' - //.disableKeyPress() // disable listening to keypresses - ; +void setup() { + size(500, 500); + bpm = new BeatsPerMinute(this); + bpm.setBPM(30); } -void draw(){ - background(100); - - // Use a timing function from the bpm object - float radius = 20 + bpm.linear() * 50; - // or: float radius = map(bpm.linear(), 0, 1, 20, 70); - // or: float radius = lerp(20, 70, bpm.linear()); - circle(width/2, height/2, radius); +void draw() { + background(50); + circle(width/2, height/2, bpm.easeBounce()*500); } ``` diff --git a/examples/BPM_Timings/basic/BeatsPerMinute.java b/examples/BPM_Timings/basic/BeatsPerMinute.java new file mode 120000 index 0000000..bbbe22d --- /dev/null +++ b/examples/BPM_Timings/basic/BeatsPerMinute.java @@ -0,0 +1 @@ +../../../src/bpm/library/beatsperminute/BeatsPerMinute.java \ No newline at end of file diff --git a/examples/BPM_Timings/basic/InfoPanel.java b/examples/BPM_Timings/basic/InfoPanel.java new file mode 120000 index 0000000..f45b6ef --- /dev/null +++ b/examples/BPM_Timings/basic/InfoPanel.java @@ -0,0 +1 @@ +../../../src/bpm/library/InfoPanel.java \ No newline at end of file diff --git a/examples/BPM_Timings/basic/basic.pde b/examples/BPM_Timings/basic/basic.pde new file mode 100644 index 0000000..7f07ef0 --- /dev/null +++ b/examples/BPM_Timings/basic/basic.pde @@ -0,0 +1,20 @@ +/** + * basic + * https://github.com/vincentsijben/bpm-timings-for-processing + * + * Animate a circle on each beat. + */ + +import bpm.library.beatsperminute.*; +BeatsPerMinute bpm; + +void setup() { + size(500, 500); + bpm = new BeatsPerMinute(this); + bpm.setBPM(30); +} + +void draw() { + background(50); + circle(width/2, height/2, bpm.easeBounce()*500); +} diff --git a/resources/build.properties b/resources/build.properties index ca377f6..6011d99 100644 --- a/resources/build.properties +++ b/resources/build.properties @@ -132,12 +132,12 @@ source.repository=https://github.com/vincentsijben/bpm-tmings-for-processing.git # This is used to compare different versions of the same Library, and check if # an update is available. -library.version=9 +library.version=10 # The version as the user will see it. -library.prettyVersion=1.1.4 +library.prettyVersion=1.1.5 # The min and max revision of Processing compatible with your Library.