Scorewriter for Gregorian chorales / Gregorian chant

I just wanted to share my biggest project yet! It is a scorewriter for gregorianic chorals and old form of music.
I’ve written that software for my school wich is in Germany so in the source code a few parts have a German name. However for sharing it I translated the options in the window however the settings of it are still in German so I will provide a translation as a reply.
The sourcecode is at:
choralprogramm-website-v1.0/ at main · NumericPrime/choralprogramm-website-v1.0 (

An example for a file the program can read can also be found at github.
choralprogramm-website-v1.0/Communio.choral at main · NumericPrime/choralprogramm-website-v1.0 (

The notes are entered through code that is put to the left. This code can be saved and edited. I have aso written an “guide” on how to use that program but it also has the Problem that it is written in german however the examples can be read regardles.
You can find the guide here:
Die Bedienung (

If you have any technical questions about my programm please ask! It took quite a long time to figure a few things out and I’ll gladly share how to do it!


Here are the Translations of the most importent settings
SchriftgroeseUeberschrift = fontsize of the header
Text-Verschiebung = text offset (offset of the text under the notes)
Liedtext-Groese = fonsize of the text of the song
Notenabstand = distance between the notes (vertically)
Zeilenabstand = distance between the individual lines
Notengroese = size of the notes
UeberschriftVerschiebung = Offset of the header to the lines

1 Like

On an unrelated note:
Does anyone know where I can post guides in this forum?

1 Like

Very impressive! Thank you for sharing!

I tried but the Audio is distorted when playing:

Sound library warning: an amplitude of 0 means this sound is not audible now
Sound library warning: an amplitude of 0 means this sound is not audible now
Sound library warning: an amplitude of 0 means this sound is not audible now
Sound library warning: an amplitude of 0 means this sound is not audible now

  • Gregorian chant
1 Like

It’s a general problem with my program is that I used an approach based on Oscilators. I stack a few Oscillators to make it sound less… terrible.
I gave my sound a few overtones to make it sound better, successfully so but it still doesn’t sound good.
If you want to play around with the overtones you can edit the following array at the beginning of my main file (line 35)

float amps[]={1, 0.7, 0.5, 0.5, 1/5, 1/6, 1/7, 1/8, 1/9, 1/10};

The first entry is the original tone (1x frequency)
the second is the first overtone (2x frequency)
the third is the second overtone (3x frequency)
and so on.

I could maybe try to tweak these values myself maybe I can get a few good values by hooking a sample file to an FFT…

Another more likely possibility is the following:
To properly contruct a tone you need the sin waves to perfectly sync up with the wave of the original tone. However I have different Oscilators going of. Additionally as far as I interpret the warning of the library correctly it inserts a delay of 80ms for each oscilator to go off.

So the problem with the bad audio can only be solved if I can manage to bundle up all Oscilators and have them put into a single SoundObject so they can all go off at once.

1 Like

I looked into JSyn wich is the library processing.sound is based on and luckily also comes shipped with the sound-library. I made this class that uses a Function-Oscillator wich sounds a better than what I set up for my scorewirter… I think. Here is the class:

import com.jsyn.*;
import com.jsyn.unitgen.*;
class PSynthesizer{
  float[] freqs;
  FunctionOscillator fo;
  double[] data=new double[(int)(300*PI)];
  Synthesizer c=JSyn.createSynthesizer();
  LineOut l=new LineOut();
  FilterLowPass fhp=new FilterLowPass();
  PSynthesizer(float... freqs) {
    fo=new FunctionOscillator();
    fhp.output.connect(0, l.input, 1);
    fhp.output.connect(0, l.input, 1);
    c.add(new Add());
  void start() {
  void addNoise(float a) {
    PinkNoise wn=new PinkNoise();
    /*FilterLowPass flp=new FilterLowPass();
    wn.output.connect(0, l.input, 0);
    wn.output.connect(0, l.input, 1);
  void freq(final float frequence) {
    fo.function.set(new Function() {
      public double evaluate(double input) {
        double sum=0;
        double ham=0;
        for (double j=0; j<freqs.length; j++) sum+=freqs[(int)j]*Math.sin(input*(j+1)*Math.PI*2);
        for (double j=1; j<freqs.length-1; j++) sum+=(freqs[(int)j]+freqs[(int)j+1])/3*Math.sin(input*(j+1/2)*Math.PI*2);
        for (double j=1; j<freqs.length-1; j++) sum+=
        for (double j=1; j<freqs.length-1; j++) sum+=
        for (double j=0; j<freqs.length; j++) ham+=freqs[(int)j];
        return sum*sum*sum;
  void stop() {

And this is the rest of the sketch to test it:

PSynthesizer c=new PSynthesizer (1,0.5,0.33,0.25,0.2,0.1666666,0.1417,0.125);
void setup() {
void draw(){
if(frameCount>200) c.stop();
1 Like

I improved the audio a bit by using vanilla jsyn. I updated the version with the english interface. Another thing you can tweak is removing line 52/53


to basicly “glue” the notes together wich might sound better.

1 Like

Please give the answer to this question too. I am looking for this one.

1 Like

What do you mean? The section?
For example Gallery?

Yes I posted one in just under Processing and it got moved to Coding Questions where it didn’t really belong I posted a guide or 4 seperate ones on Gallary where it didn’t get moved so I think Gallary might be the best place.

1 Like