Musical Notation Symbols?

Hello @bachrock,

Find a suitable font (web search found the ones below) with music notes.

I did a bit of searching for insight on how to display Unicode characters with Processing and Java to achieve this.

This works with Processing 4.3 Java:

PFont myFont;
import java.lang.Character.*;

void setup() 
  {
  size(1100, 1000);
  background(244);
  
  // Uncomment the following two lines to see the available fonts 
  //String[] fontList = PFont.list();
  //printArray(fontList);
  
  //myFont = createFont("Symbola.ttf", 64, true);
  myFont = createFont("Musisync-KVLZ.ttf", 64, true);
  textFont(myFont);
  textAlign(CENTER, BOTTOM);
  
  fill(0);
  //int fontStart = 0x1D100; // Symbola font
  int fontStart = 0x0000;  // Musisync-KVLZ font
  for(int i=0; i<200; i++)
    {
    int u = fontStart+i;
    char [] uc = Character.toChars(u);
    String s = new String (uc);
    //text(s, i%20*50+70, (i/20)*80+100);  // rows and columns
    text(s, random(10, width-10), random(10, height-10)); //random
    } 
  }

References:

Above code also worked with Symbola font for other characters:

:)

1 Like