Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (488)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  JcgMusic - A Java port of cgMusic  (Read 5702 times)
0 Members and 1 Guest are viewing this topic.
Offline krasse
« Posted 2011-02-12 08:30:20 »

I have created a Java reimplementation/port of the popular cgMusic program

An executable jar:
jcgmusic.jar

A preliminary version of the source is here:
jcgmusic.zip

Here are some example result:
ballad 1
ballad 2
dance 1
dance 2
latin 1
latin 2
march 1
march 2
piano classical 1
piano classical 2
piano disco 1
piano disco 2
boogie woogie 1
boogie woogie 2
punk rock 1
punk rock 2
swinging blues 1
swinging blues 2

There are obviously some bugs left, but a lot of the features from the original cgMusic seems to work very good.

There are also possibilities to add greater control of the musical parts in the GUI, just like in the original program.
I don't really know if you are allowed to use the songs that come out from JcgMusic commercially since the original doesn't allow this. I will gladly allow it if you don't claim any exclusive rights or do something obviously evil!

Enjoy!

Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #1 - Posted 2011-02-12 09:35:17 »

Interesting. Swinging blues is awesome. So, can it generate and play in real time? Can I modify the knobs while it is playing? Eg, maybe I could use it to play mellow music that slowly switches between a few genres so the player doesn't get bored, then as the player nears death, I would speed up the music. Is this possible? What is the state of Java MIDI? I seem to remember not all JREs have it. Can it generate PCM? That would be ideal.

Offline krasse
« Reply #2 - Posted 2011-02-12 09:45:59 »

Added some more examples.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline TheMatrix154

Junior Member


Medals: 2



« Reply #3 - Posted 2011-02-12 09:46:36 »

Wow, exactly what a one man army needs Wink
But unfortunately the "math" package is missing, any chance to get the whole source or an executable Jar / Webstart?

Offline krasse
« Reply #4 - Posted 2011-02-12 09:50:42 »

cgMusic is a static music generator. I plan to improve my own reactive music generator with cgMusic constructs to make it adapt to changes. The main reason for doing the port was to learn how cgMusic works. You can however generate many different versions that share the same structure etc. and switch between them depending on input.

I think that when you use the Gervill MIDI synthesizer, it has the same probability of success as Java Sound.

PCM is possible and very simple to add with Gervill's help.

Offline krasse
« Reply #5 - Posted 2011-02-12 10:00:50 »

Ahh, my tangled source mess...

I have updated the source again but it does not compile yet however. I will sort this out by moving the few methods I use into the jcgmusic Utils class.

Offline krasse
« Reply #6 - Posted 2011-02-12 11:10:58 »

There is now a executable jar-file available here:
http://www.springworldgames.com/jcgmusic/jcgmusic.jar

A compilable source will be there soon as well...

Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #7 - Posted 2011-02-12 21:38:36 »

I'm invisible, that's cool. :p

Offline krasse
« Reply #8 - Posted 2011-02-12 21:54:26 »

I'm invisible, that's cool. :p

No, you're not Sad

Me no understand? I thought that I answered your questions above? I forgot to quote you though...
I might got all of this wrong though Smiley, but in case I didn't:

cgMusic generates static music but you can generate many different versions and switch between them depending on input. The API supports setting separate scripts/modules and seeds for harmony, inner structure, melody, rythm, scale, tempo etc. You might want to check out the original program since it has a GUI.

You can use MIDI in Java if you use Gervill (that uses Java Sound) with a soundbank of your choice. You can also use Gervill to generate PCM but if you go that road you might want to use a better MIDI-synth that can do VST or something similar.


Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #9 - Posted 2011-02-13 01:55:58 »

Ah, I see, thanks. Smiley I was hoping for a drop in solution to my specific needs.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline krasse
« Reply #10 - Posted 2011-02-13 11:09:38 »

Ah, I see, thanks. Smiley I was hoping for a drop in solution to my specific needs.

I'm working on it Smiley

My reactive music generator, will be reinforced with cgMusic constructs and will kick some serious $#%

Offline Mads

JGO Ninja


Medals: 26
Projects: 3
Exp: 6 years


One for all!


« Reply #11 - Posted 2011-02-13 20:48:22 »

That is really cool! It would be even cooler if we could speficy what key to play in, and which to switch between. Also the option to disallow weird* choords would be great.

*..and by that I mean choords (inclusive the melody - right hand on piano), that has notes which fall out of the scale. I knwo this sounds great sometimes, but I hear some pretty "interresting" ( Roll Eyes) choords sometimes Tongue

A bit of improvement and this is really good! Very nice tool for 99% of the people in here (Cas and Marcus actually makes money  Kiss)

Offline krasse
« Reply #12 - Posted 2011-02-13 22:57:27 »

That is really cool! It would be even cooler if we could speficy what key to play in, and which to switch between. Also the option to disallow weird* choords would be great.

*..and by that I mean choords (inclusive the melody - right hand on piano), that has notes which fall out of the scale. I knwo this sounds great sometimes, but I hear some pretty "interresting" ( Roll Eyes) choords sometimes Tongue

A bit of improvement and this is really good! Very nice tool for 99% of the people in here (Cas and Marcus actually makes money  Kiss)

This is possible in the API. In my extremely simple GUI you can only specify a overall seed, arrangement and structure.

In the API and the original cgMusic you can specify separate generators for each part:
* harmonic rythm + seed for that
* melody generator + seed
* rythm + seed
* inner structure (phrases etc.)
* scale
* chorus/verse/no melody hints
* tempo change

You can for example keep changing the harmonic rythm seed until you like it and keep everything else intact.

If you try the original cgMusic, you can see what it possible to do with the API. I really recommend it since my GUI sucks Smiley

I have also heard this "interesting" harmony and the strange non-harmonic notes. This is probably a bug in my reimplementation of cgMusic or when the jazz-harmony generator is suddenly used which add 7th and 6th chords all over the place. If you combine that with a random diatonic harmonic rythm and a random scale, strange/sophisticated chords will be inevitable.
But you can have a lot more control over the music than my GUI suggests.

Offline krasse
« Reply #13 - Posted 2011-02-14 07:51:44 »

Source code that should compile without any extra jars or hacks:

Link

Offline teras

Junior Newbie





« Reply #14 - Posted 2013-01-04 02:01:03 »

Thank you for updating the links!
What is the license of this project?
Offline krasse
« Reply #15 - Posted 2013-01-04 12:20:11 »

Thank you for updating the links!
What is the license of this project?

I don't know about the ported parts. You have to ask the maker of cgMusic about this since a large part of jcgMusic consists of ported scripts that ship with that program.

The reimplementation (my guess of how cgMusic works internally) is MIT.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (17 views)
2014-08-28 18:26:30

CopyableCougar4 (26 views)
2014-08-22 19:31:30

atombrot (39 views)
2014-08-19 09:29:53

Tekkerue (36 views)
2014-08-16 06:45:27

Tekkerue (33 views)
2014-08-16 06:22:17

Tekkerue (22 views)
2014-08-16 06:20:21

Tekkerue (33 views)
2014-08-16 06:12:11

Rayexar (68 views)
2014-08-11 02:49:23

BurntPizza (45 views)
2014-08-09 21:09:32

BurntPizza (36 views)
2014-08-08 02:01:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!