It's like a wind chime, but instead of only chimes, you have any sound available on the synthesizer. And you can adjust the possible length and frequency of each note (or tone).
If you've ever listened to white-noise ambient recordings on YouTube, you may have noticed that they repeat, sometimes after a very brief period. If one is meditating or falling asleep, the mind will start to track on the repeats, which is distracting and counterproductive.
That's why this application generates random ambient music using parameters passed to various compositional engines - the randomness eliminates the repetition. So the texture remains similar throughout, but there is no exact repetition, unless the parameters limit the possibilities enough to make repetition inevitable.
(technically the numbers generated by this computer algorithm are not genuinely random, but "pseudo-random." Though I assure you, they are sufficiently random to provide unpredictable results)
Groovy should be on the path, meaning Java should be on the path.
It uses the javax.sound.midi library. The scripts are written to run in cygwin.
They will probably work in Linux or on the Mac, but have not been tested.
They're not complex, so you can look at them and run the commands by hand.
There are Java classes in the midi directory that need to be compiled using javac.
The build bash script does that. Groovy is an interpretive language,
so no compilation step is needed when modifying Groovy scripts.
At present, most of the patches are set up for the Alesis QS-8. So they may not sound right on your system, unless you have one of those.
I'll be working on creating some pieces using standard MIDI sounds at some point. Otherwise, you can look at the title of the Gamma and substitute a patch to the indicated sound.
You can also give it the option to create a MIDI file as it plays, so you can import the note-ons and offs to play back using your own sounds.
Note that OndeSynth, the virtual synth available on this same github site, is capable of translating a MIDI file into a WAV file.
cdto thesrcdirectorygroovy morbleu c-major
This should produce ambient music through the local machine's MIDI synthesizer.
Hit Enter to quit.
If you are running bash, the morbleu script will save you typing groovy, especially if . is on your path.
There are also some other scripts that will create MIDI music using a similar framework. For example, this happened along the way: https://youtu.be/qXlGXqxPX5k
The scripts (written in Groovy) that determine what music morbleu will play are
loosely called gammas,
or more accurately, they contain a list of gammas
To learn how that works, please see
Gamma.md
Below you'll find more low-level help, including some ideas in case you can't get any sound to play.
You can figure out what MIDI instruments Java thinks you have installed by
running the info bash script.
By default, it will use "Gervil," which is Microsoft's wavetable synth. You can override this setting
by renaming morbleu-settings.gvy.example to morbleu-settings.gvy and editing the value of the
'player' property. It does a case-insensitive 'contains' match on the Name field
as returned by the info command, so you only need to spell out enough of the name
to be distinct.
Below is a sample of the info output:
-------------
Description: Internal software synthesizer
Name: Microsoft GS Wavetable Synth
Vendor: Unknown vendor
Version: 1.0
isOpen(): true
Maximum # of Transmitters: 0
Open Transmitters: 0
Maximum # of Receivers: -1
Open Receivers: 1
rcvr: com.sun.media.sound.MidiOutDevice$MidiOutReceiver@33b37288
is instanceof Synthesizer: false
is instanceof Sequencer: false
Notice that even though it's a synthesizer, it reports that it's not a synthesizer. The key is that Open Receivers is 1, and not 0. That means it can receive playback messages via MIDI.
Hopefully you have something better to play back on.
You can write your own very easily. Here's a script that plays middle C, holds it for 4 seconds, then closes (called simple.gy)
import midi.Player
gervil=new Player('gervil') // the microsoft GS synth
gervil.open()
gervil.noteOn(1,60,93)
Thread.sleep(4000)
gervil.noteOff(1,60,0)
gervil.close() The Player constructor does a very wide search on the "name" field of the MIDI info for the device.
You can run the script by saying
groovy simple.gvy
To hear the ambient experiment try
groovy morbleu d-minor
NOTE:
Morbleu listens to Enter from the keyboard as a signal to shut down its threads. It does not automatically shut off notes if you interrupt with ctl-C and are using an external synth. If you do so, be prepared to reset manually.
If you see this:
java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Try this:
- Go into your Start Menu and type regedit into the search field.
- Navigate to path HKEY_LOCAL_MACHINE\Software\JavaSoft (Windows 10 seems to now have this here: HKEY_LOCAL_MACHINE\Software\WOW6432Node\JavaSoft)
- Right click on the JavaSoft folder and click on New -> Key
- Name the new Key Prefs and everything should work.
Some code tweaks may be required depending on your setup. It's in a state of flux. The directory is cluttered. Java Sound is finicky.
See ./TODO.md to see what may eventually get done.