#newmediaart #mixedmedia #creativecoding #processing #generative #musicvideo #vj #arduino #diy #mathart #newmediaart #mixedmedia #creativecoding #processing #generative #musicvideo #vj #arduino #diy #mathart

Math porn

an algorithm sequencer and a bunch of demo animations for a flipdigits display, coded in Processing. to be continued.

#flipdigits #processing

download source (pde)

how does it work?

requirements

if you’d like to recreate this project, there are a couple of things that you will need:

  1. a flipdigits display – you can get one at Alfazeta
  2. ethernet-RS485 converter (mine is ETH-UKW485SR140)
  3. power supplies: 24V/1A for the display and 12V/1A for the converter
  4. RJ45 and RJ11 cables
  5. USB network adapter (if you don’t have ethernet input like me)
  6. Processing with all required libraries: processing.net, processing.video, org.openkinect (for kinect), codeanticode.syphon (for Syphon)
Alfa Zeta flipdigits display - all parts connected

connection

the very first thing when you have all the parts connected is to check what the IP address of the converter is. the producer delivers this helpful application and with it you can set any IP you want. sadly it works only on Windows.

when you know the IP, the next step is to set up the display address – you can do it on the back of the display. take the easiest way (0x00):

Alfa Zeta flipdigits display - back

the left 3 switches controls the speed of transmission. set it up to 011, which means the highest 57600 b/s speed. also make sure your converter is set to the same value in WIZ14xSRConfig.

ok, now we can open Processing. download the project file and set your converter IP in SENDDATA tab. also, make sure you switched senddataOn to true in the main tab.

run the project!

sequencer

the major functionality of this project is a sequencer. with it, you can arrange your algorithms to be played in a queue and for specific time.

the main tab has all the algorithms listed and grouped for: math, games, capture, fonts and typing.

if you are interested in making your own demo, here is how i hold, process and send the data:

sending data

changing states of the display digit parts is based on a very exact protocol, using TCP client from processing.net library. following the instructions, you have to send 32 bytes in a right order (called a frame):

  • the first byte 0x80 starts the frame
  • the second byte (command) sets the display – we use 0x83 to tell that we are about to send 28 data bytes and refresh the display right after that
  • the third byte (address) decides which display we are changing – set it to 0x00
  • the next 28 bytes specifies the digit states (column by column!)
  • the last byte 0x83 ends the frame

here is how you figure out a proper byte for a digit:

1 0 0 1 1 1 1 6 5 4 3 2 1 0 6 5 4 3 2 1 0 2⁶ 2⁵ 2⁴ 2⁰

knowing that, you can send this letter ”E” as byte(unbinary("1001111")) or simply 79 (a sum of powers of 2). however, displaying numbers and letters quickly becomes boring.

holding data

if you want to display something more complex, you need to organise the bytes in a smarter way. i prepared few ways of holding bytes to make the animation coding process as easy as possible:



byte DISPLAY[W][H] – this two-dimensional array of bytes holds the final data that is sent to the display

Alfa Zeta flipdigits display - array with bytes

char A[W][H] – an array of characters, automatically converted to bytes – helps with all ”text” animations

Alfa Zeta flipdigits display - array with characters

PImage T – a data thumb (image/movie) – helps with preparing legible representations of digit states (ie. in Photoshop)

Alfa Zeta flipdigits display - thumb

boolean BX[W][3*H], BY[2*W][2*H] – two true/false arrays for states of vertical and horizontal lines – helps with abstract animations (ie. noise)

Alfa Zeta flipdigits display - array with lines

boolean CX[2*W][3*H], CY[2*W][3*H] – similar idea to the previous one, but these two arrays are the same size, holding information about corner points (and also the ”gaps” between digits) – helps with drawing animations

Alfa Zeta flipdigits display - array with lines 2

Movie D[W][H] – a movie with every frame being an array of greyscale pixels (brightness of a pixel is a byte state) – with it you can read data states recorded or transmitted (through Syphon) by another project

Alfa Zeta flipdigits display - movie with data states

Movie M – a regular movie that is resized and converted to bytes using Threshold or Dithering algorithm

Alfa Zeta flipdigits display - regular movie

Of course, Movie M would look much better on a bigger scale and density:

Alfa Zeta flipdigits display - regular movie on big scale

processing data

i developed few methods to operate on this formats. despite obvious for() loops to operate on the arrays, you can use clr() for all of the formats to clear the screen, full() to make it all white and functions that converts one format to another.

the easiest way to show something complex on the display is to use algorithm movie – it plays any video on format M.

also, there is a very useful function drawLine(x1, y1, x2, y2) for format C – with it you can draw any shape you want.

there is also a function draw3d(), which takes 3d points and converts them to a loop of drawLine() functions:

Alfa Zeta flipdigits display - 3d wireframe

you can also use a float progress variable to let the animation develop over time:

Alfa Zeta flipdigits display - progress

results

finally – here are some examples of how the demo set list works in real:

counters / noise / sin / grid / bacteria / cell / rain / worm / terrain

playing snake

typefaces

Show comments 💬