top of page

Processing

processing introduction

Processing是一种计算机语言,它的概念是在电子艺术的环境下介绍程序语言,并将电子艺术的概念介绍给程序设计师,简单来说,就是通过编写代码来制作图案和动画,激发人们的编程学习兴趣的计算机语言。

Processing is a computer language that introduces the concept of programming language in the context of electronic art and introduces the concept of electronic art to programmers. Simply put, it is a computer language that stimulates people's interest in learning programming by writing code to create patterns and animations.

Processing可以在 Windows、MAC OS X、MAC OS 9 、Linux 等操作系统上使用。以Processing完成的作品可在个人本机端作用,或以Java Applets的模式外输至网络上发布。

Processing can be used on Windows, MAC OS X, MAC OS 9, Linux and other operating systems. The work done by Processing can be used locally or exported to the web as Java Applets.

Processing为设计师提供了许多简单易学的函数,设计师可以通过简单的编码实现算法动画和即时交互反馈。近年来,processing在交互动画、复杂数据可视化、视觉设计、原型开发和制作方向越发流行。

Processing provides designers with a number of easy-to-learn functions that allow designers to implement algorithmic animations and instant interactive feedback through simple coding. In recent years, processing has become more and more popular in the direction of interactive animation, complex data visualization, visual design, prototype development and production.

Case One  电子琴

CapacitiveSensor.h 介绍

CapacitiveSensor.h introduction

CapacitiveSensor.h 将两个或多个 Arduino 引脚变成一个电容传感器,可以感应人体的电容。传感器设置所需要的只是一个中到高值电阻器和一根电线,最后是一块小(大)铝箔。在最灵敏的情况下,传感器将开始感应距离传感器几英寸远的手或身体。

The capacitive sensor library turns two or more Arduino pins into a capacitive sensor, which can sense the capacitance of the human body. All you need to set up the sensor is a medium to high value resistor and a wire, and finally a small (large) aluminum foil. In the most sensitive case, the sensor will begin to sense a hand or body a few inches away from the sensor.

20200322195325196.png

使用前需要安装 CapacitiveSensor 

You need to install the capacitivesensor library before use.

电容传感器方法将微控制器发送引脚切换到新状态,然后等待接收引脚更改为与发送引脚相同的状态。一个变量在while循环内递增,以计时接收引脚的状态变化。然后该方法报告变量的值,该值以任意单位表示。

The capacitive sensor method switches the sending pin of the microcontroller to the new state, and then waits for the receiving pin to change to the same state as the sending pin. A variable is incremented in the while loop to time the state change of the receiving pin. The method then reports the value of the variable in any unit.

微信图片_20220107031104.png
index.gif

设计方案介绍

Introduction to design scheme

我们将 Arduino 和 Processing ​结合制作了一个电子琴。该项目可通过手指接触引起电路电位变化,不同线路对应不同音调的钢琴音,线路的点位变化作为processing画面的输入指令,可引发动态波纹变化图案。如下是本案例的电路图:

We combined Arduino and Processing to create an electronic piano that controls the notes by pressing the pointer. While playing different melodies, the computer screen will display fluctuating images according to the height of the notes. The following is the circuit diagram of this case.

微信图片_20220107031833.png

其中本案例适用的电阻阻值在 100 千欧 - 50 兆欧

The resistance value applicable to this case is 100 kohm - 50 megohm

Arduino 代码

The Arduino code is as follows

Processing 代码

The processing code is as follows

​展示视频

Laser cutting demonstration video

Case two  鼠标手绘

我们将 Processing ​和鼠标结合,可以利用鼠标进行手绘。根据移动速度,笔画会有所不同。如下是本案例的是示例图:

We have combined Processing and the mouse to allow hand drawing using the mouse. Depending on the speed of movement, the strokes will vary. The following is a sample drawing for this case.

index.html - Google Chrome 2021-12-23 13-28-56.png

Processing 代码

The processing code is as follows

​展示视频

Laser cutting demonstration video

bottom of page