Currently all Artinfuser Algo servers are in maintenance mode. I did not get enough patrons to continue supporting rendering music in this project.
CF1 music generator generates a melody (cantus firmus) by searching for a combination of notes which has minimum rule violations penalty. Each note in this melody will have the same note length. There will be no pauses inside a melody. Example of generation result:
Cantus firmus ("fixed song") is a pre-existing melody forming the basis of a polyphonic composition. It is also used to write counterpoint exercises by superimposing additional voices above or below it.
The rules that are used for cantus firmus generation can be enabled or disabled by user. For generating and correction of cantus firmus mainly Cantus and Melody rule groups are used. By default the rules are tuned to generating a vocal cantus firmus starting and ending with a tonic note.
Key generator input parameters:
Due to the nature of algorithm and large number of rules used, generating long cantus firmus can take long. Time needed to generate cantus increases with the length of cantus, but it is not a static value, because number of operations to generate cantus of same length differs due to randomization. This means that longer canti can sometimes take less time to generate and sometimes more. If time needed to generate cantus exceeds some limit (1 to 10 minutes, depending on server settings), task will be aborted and melody with some mistakes will be returned. You can see mistakes in PDF files. In our tests, cantus with 250 notes without mistakes could always be generated during 2 minutes.
In expert mode user can also change other parameters in text configuration:
Generating multiple cantus firmus will take more time.
Other parameters in config should be changed only if you know what you are doing.
Generated melody is output in several formats:
When browsing all files, you can notice that there is one file with .MID extension and one or more files with .MIDI extension. Pay attention that file with .MID extension is the main MIDI file, while .MIDI files are all adapted for playback. Usually you will need file with .MID extension to import generated music in other software.
Also, multiple log files are produced as a result of generation process, which can help to understand what happened during generation. They can be viewed on the Info tab.
There are some other technical files (waveform image, waveform csv, adaptation noteinfo), that can be accessed by clicking "Browse all files" on Files tab. They are not important and will not be detailed here.
Problem | Solution |
---|---|
Generation takes long | Try decreasing length of cantus or revert rules to their default settings. If you changed t_cnt in config, reset it to 1. |
Generation fails with error | First try to restart the processing. If this does not help, try to unroll your latest changes, which could result in the error. In Expert mode on the Config tab you will find history of all your changes under the Save button. Pay attention that due to complex generation algorithms, some combinations of rules severities can result in unexpected behaviour. Try to set rules severities back to their default values or create new generation task. If you applied any changes previously, you will find default values in "Rule changes" box under the rules tree on the Settings tab. Also, keep in mind that trying to generate too long cantus can result in error due to timeout. Try decreasing length of cantus. |
If you cannot find solution to your problem, please create support request (menu Support)
See playback section.
Generating cantus firmus currently supports two methods: Strict Appending Scan (SAS) and Sliding Windows Approximation (SWA). Default algorithm is SWA, but in some situations you may want to switch to SAS.
Compare algorithms:
Some combinations of rules can work faster with SAS algorithm, while generally SWA algorithm is recommended and selected by default. You can select algorithm by editing method parameter in config (method=sas or method=swa)
SWA algorithm is built on top of SAS algorithm, so we will discuss SAS first.
Algorithm is written in C++ language for optimal performance.
SAS method works by scanning all possible variants of notes from left to right and checking if each combination of variants satisfies the rules. Key characteristic of algorithm is that all combinations, which start with notes, that do not comply with the rules, are automatically skipped:
It is important that checking rules is limited while not all notes are generated:
Examples: repeated melodic climax, resolution of penultimate note.
Examples: too many notes in one measure, suspension resolution.
As more and more rules are checked while cantus grows, generating later notes requires more variants to be tested. Returning to previous notes is the process that requires much processing time (e.g. returning from step 7 to step 1). Some rules require to return to previous notes. If previous note does not have variants, which satisfy the rules, the return can be deeper to several notes to the left. This can significantly slow down generation, which is an important characteristic of this algorithm.
To achieve different results on each algorithm run, algorithm scans variants in a random order. Order of possible notes for each measure is randomized before scanning possible combinations of notes.
Algorithm is written in C++ language for optimal performance.
SWA method works by trying to replace each note of a melody with all possible variants of other notes while choosing variants that result in minimum sum of violated rules' penalties. Before running SWA, a random melody is generated, which is then step by step morphed into a better melody.
In this video you can see how melody is morphed by SWA CP1 counterpoint generation algorithm from random to a sane melody. Colored notes (having one or more violations of counterpoint rules) are being gradually replaced with gray notes:
SWA algorithm actually consists of multiple SAS algorithm runs:
It is important that checking rules is limited while not all notes are generated inside a window (e.g. when generating first note in window of two notes):
Examples: repeated melodic climax, resolution of penultimate note.
Examples: too many notes in one measure, suspension resolution.
The run of SAS with window size of one note is very fast, but increasing size of window leads to exponential growth of processing time required. SAS in SWA skips all combinations starting with notes, which already have greater penalty, but still processing windows longer than 10 notes is slow.
To achieve different results on each algorithm run, algorithm scans variants in a random order. Order of possible pitches of each note is randomized before scanning.