Take back control of your electronic setup with our small, smart music tools: The RK002 Smart MIDI Processor cable, RK006 all-connecting music hub and RK008 Realtime MIDI Recorder!

Retrokits / RK-002 MIDI Processing? Just DUY it!

RKVideo - CVBS Video Out

The RKvideo library is a software component which can be used to create a simple 96×64 parallel video output on the outer pins of the RK002 DIN5 output, parallel to your MIDI stream.
NOTE: This reference might change later on, we’re finetuning the command parameters.

Hardware

Two resistors are needed to compose the CVBS signal:

DIN5 female connector for plugging on the RK002 output, viewed at solder side:

       o
    o  G  o
   o   |   o
   |   |   |
  270R S  560R
   |       |
   \---+---/
       T

  S = CVBS SLEEVE
  T = CVBS TIP

To program video in the RK002, enable the ‘video out’ in the online coder dropdown panel and initialize a video frame object:

RK002Video vid;

You can make a bitmap array with our bitmap converter tool. It can handle .png, and .piskel files (a cool online pixel editing website). You can make stitchmaps but make sure the bitmap does not exceed 255 pixels width

If the array is created, you can convert it to a RK002 bitmap object and put it on screen. We prepared a small 8×8 smiley in the code below.

RK002Video vid;

//bitmap data 8x8 :
const unsigned char smiley[] = {0x3c,0x42,0xa5,0x81,0xa5,0x99,0x42,0x3c};

RK002BitMap bm(smiley, 8, 8); // make into bitmap
void setup()
{
  vid.setDrawMode(RK002VIDEO_DRAWMODE_WHITE); // set drawmode to white color
  vid.drawBitMap(bm, 0,0,8,8,20,10); // place 8x8 smiley on pos x=20,y=10
}
void loop()
{
}

That’s the basics, you can manipulate the bitmap with different color drawing methods and add lines and characters for example with different commands

System variables

 RK002VIDEO_NX

Contains width of RK002 video screen buffer (96)

 RK002VIDEO_NY

Contains height of RK002 video screen buffer (64)

RK002VIDEO_DRAWMODE_BLACK

Sets drawing mode to black pixels (defined value=0)

RK002VIDEO_DRAWMODE_WHITE

Sets drawing mode to white pixels (defined value=1)

RK002VIDEO_DRAWMODE_INVERT

Sets drawing mode to invert pixels (defined value=2). You can use the invert draw mode to remove prior drawn objects: Overlay the same drawing object with inverse color and the color will be negated (=gone 🙂 )

Commands

void setDrawMode(unsigned m);

Sets drawing mode for next graphic commands to mode m

void setDrawMode(unsigned m);

Sets drawing mode for next graphic commands to mode m

void drawPixel(unsigned x, unsigned y,[unsigned drawmode]);

Draw a pixel on location x y Left top of the screen is the origin point. You can set a new drawmode using the optional drawmode parameter

void drawLine(unsigned x0, unsigned y0, unsigned x1, unsigned y1,[unsigned drawmode]);

Draw a line from position x0,y0 to x1,y1

void drawRect(unsigned x, unsigned y, unsigned w, unsigned h,[unsigned drawmode]);

Draw a rectangle outline from position x0,y0 with the given width[w] and height[h]

void drawFilledRect(unsigned x, unsigned y, unsigned w, unsigned h,[unsigned drawmode]);

Draw a filled rectangle from position x0,y0 with the given width[w] and height[h]

void drawChar(unsigned x, unsigned y, char c, unsigned drawmode);

Draw a single character (minimal ASCII set) with the built-in fontset on position x,y

void drawStr(unsigned x, unsigned y, const char *str, unsigned drawmode);

Draw a character string with the built-in fontset on position x,y. Example:

vid.drawStr(10,15, "HELLO RK002");

Draws ‘HELLO RK002’ to position x=10,y=15 with the currently set drawmode.

void drawBitMap(RK002BitMap bm, unsigned src_x, unsigned src_y, unsigned w, unsigned h, unsigned des_x, unsigned des_y, unsigned drawmode);

Allows you to draw parts of a defined bitmap object on screen. By using different source/destination coordinates you can reuse objects in the bitmap source to fill the screen. A powerful way to make the most with minimal memory. Example:

// draw a 4x8 partial from a bitmap object from position 2,0,to screen on destination 10,20
vid.drawBitMap(RK002BitMap bm, 2,0, 4,8, 10,20);

You can open an example DUY in the coder which uses the video object MIDI Monitor DUY

Shopping cart0
There are no products in the cart!
Continue shopping
0