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/choral_1_3_3_en.zip at main · NumericPrime/choralprogramm-website-v1.0 (github.com)

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 (github.com)

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 (choralprogramm.netlify.app)

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!

2 Likes

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
Autoload
Autoload
Autoload
Autoload
Autoload
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…

(Edit:)
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.*;
import com.jsyn.data.*;
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) {
    this.freqs=freqs;
    fhp.amplitude.set(0.5);
    fhp.frequency.set(1500);
    fhp.updateCoefficients();
    c.add(fhp);
    fo=new FunctionOscillator();
    fo.output.connect(fhp.input);
    fhp.output.connect(0, l.input, 1);
    fhp.output.connect(0, l.input, 1);
    c.add(l);
    c.add(new Add());
    c.add(fo);
  }
  void start() {
    c.start();
    l.start();
  }
  void addNoise(float a) {
    PinkNoise wn=new PinkNoise();
    /*FilterLowPass flp=new FilterLowPass();
     flp.amplitude.set(0.3);
     c.add(flp);*/
    c.add(wn);
    wn.output.connect(0, l.input, 0);
    wn.output.connect(0, l.input, 1);
  }
  void freq(final float frequence) {
    fo.frequency.set(frequence/2);
    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+=
          (freqs[(int)j]+freqs[(int)j+1]+(freqs[(int)j]+freqs[(int)j+1])/3)/3
          /2*Math.sin(input*(j+1/4)*Math.PI*2);
        for (double j=1; j<freqs.length-1; j++) sum+=
          (freqs[(int)j+1]+freqs[(int)j+1]+(freqs[(int)j]+freqs[(int)j+1])/3)/3
          /2*Math.sin(input*(j+1/4)*Math.PI*2);
        for (double j=0; j<freqs.length; j++) ham+=freqs[(int)j];
        return sum*sum*sum;
      }
    }
    );
  }
  void stop() {
    c.stop();
    l.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() {
  c.start();
  c.freq(440);
  c.addNoise(0.1);
}
void draw(){
  if(frameCount>50) 
  c.freq(600);
  if(frameCount>100) 
  c.freq(880);
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

  amp2.add(-1.0);
  del2.add(0.05);

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