Software Synth Library for Java [closed] - java

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I've been thinking a lot lately about a music-oriented project I'd like to work on. Kind of like a game... kind of like a studio workstation (FL Studio, Reason).
I guess the best way to describe it would be: like "Guitar Hero", but with no canned tracks. All original music--composed by you, on the fly--but the software would use its knowledge of music theory (as well as some supervised learning algorithms) to make sure that your input gets turned into something that sounds great.
It sounds a little silly, explaining it like that, but there ya go. It's something I think would make an interesting side project.
Anyhow, I'm looking for a Java library for generating the actual audio. Browsing around on sourceforge, there are countless software synths, and I have no idea which to choose.
My top priority is that it should sound incredible... Really rich, layered, textured synths, with gobs of configurable parameters. Emulation of acoustic instruments is not important to me.
My second priority is that it ought to be straightforward to use strictly as a library, with no GUI involved at all. (If there's a synth with really breathtaking output, but it's tightly-coupled with a GUI, then I might consider ripping the audio portion out of the application, but I'd rather start with a nicely contained library).
I know I could send MIDI to a standalone synth, but I think it'd be cool to read the actual synth code and learn a little DSP while I'm at it.
Any suggestions?
Oh yeah, I'm on Windows, so posix-only stuff is a no go.
Thanks!

Have you checked out JFugue? It's an "open-source Java API for programming music without the complexities of MIDI".
Additional information: Found a couple of other resources referenced in the JFugue documentation (pdf):
Audio Synthesis Engine Project: open source version of Java’s MIDI synthesizer
Gervill: open source software synthesizer created as a proposal for the Audio Synthesis Engine Project

Yeah, I noticed JFugue a few years ago. It's on my list of interesting computer/music bookmarks:
http://delicious.com/BenjiSmith/computermusic
http://delicious.com/BenjiSmith/programming.java.libraries.music
But JFugue is all about the structure of the music itself... the melodies, harmonies, rhythms, etc....
What I'm looking for right now is just the synthesizer. Something like this...
Synth s = new Synth();
Instrument i = s.getInstrument("Robot Bass");
i.makeAwesome(true);
And then I'll send my events into the MIDI stream (or into whatever control API the synth library provides).

If Clojure is an acceptable option (runs on the JVM, easy to integrate with Java), then it's definitely worth checking out Overtone.
It uses SuperCollider as the synthesis engine, but wraps it all in a nice DSL and interactive programming environment.

minim isn't exactly a java synth, but it is a processing lib and I imagine that it should be pretty easy to use with vanilla java too.

Related

Can I use Python for Android development? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Can I create simple programs for Android using Kivy or do I have to learn Java?
By simple, I mean some graphics (some rotating lines, a timer, a highscore), a memo etc not real-time games.
I've created this kind of programs for Windows/Linux and I'd really like to extend to Android.
On Google, most of the answers say that I should learn Java, whereas the remaining answers say that Python is pretty good. I also asked this question on chat, and some said 'yes', while others said 'no' and finally someone said "All programming languages get to be translated to JavaScript, so it is not much of a difference".
No. And may be Yes. Let me explain.
No:
The app will not look native if you use Kivy
There will be a lag in startup
You can call native Java API using Pyjnius but sometimes it won't work fine or you will need to work very hard to get simple things done.
Because you can not use the native UI, crafting a good looking android app might be a lot of work.
Yes:
You can build an app that works
Many games and apps don't use native UI but they are still very usable
You can use projects like Plyer and Pyjnius to get the common android functionality
Kivy might be an excellent choice for games
My recommendation:
Please do check out the apps and games built with Kivy on Play Store. Play with them on your phone or tab. See how they look and feel. Checkout the Kivy docs and see what they offer.
PS: I am a big time Python fan and I do like Kivy. I hope and believe that it will offer better widgets and UI integrations in the future. I wish Kivy offered something like NativeScript where I could use Python to create native widgets.

How to program a simple music sequencer for Android (Java) [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
What I want to do:
I would like to program a very simple music sequencer for Android. But I've never worked with audio on Android or in Java, respectively.
What the application should do:
play back samples (WAVE/OGG files)
play several audio channels simultaneously (e.g. the trumpet and the flute should play simultaneously, maximum of 10 instruments)
change the pitch of the samples (e.g. the trumpet WAVE file must be played in normal pitch (c4) and lower/higher pitch (e2/g6) and so on)
This is what the application should be able to do in general.
What components do I need? A normal media player (AudioManager?) won't work, right?
There are already some applications which do what I am thinking about:
FingerBeat for iOS
FL Studio Mobile for iOS
Uloops Studio for Android
Thanks in advance for your help!
There is very simple open source beat sequencer for Android called SoundFuse. They have description and screenshots on the page.
Here is the github repository.
You have not one simple requirement, but three very different requirements.
Playing WAV should be supported out of the box by the JRE with the help of the classes in javax.sound.sampled, it jsut requires some code to wire it up (not too sure about android).
Playing OGG is not supported out of the box. There is an open source implementation for OGG called jOrbis, see their web site. Again this can require some wiring code to hook into your application.
For a Sequencer, you could just use MIDI. Again it should be supported by the JRE, and if it is not on your platform, you can use Gervill - a pure Java MIDI sequencer (Project web site).
There is also a ModPlayer that can play good old Soundtracker and some others. This can also be abused as a Sequencer of some sort if you know the Soundtracker or Screamtracker module format (ancient format, but descriptions are still available on the net). Player with source can be found here. The Tracker formats are not all that ancient by the way, some of todays game engines still make use of them.
If you really want, you can cook up your own Sequencer, all the basic stuff if there in javax.sound.sampled. It just requires some basic knowledge about digital sound and a big lot of wiring code.
There is no single solution for all your needs, you will have to stitch you own together from the building blocks freely available.
I won't be able to provide a complete answer, but I will point you in the right direction.
Android does support .wav and .ogg decoding. According to: http://developer.android.com/guide/appendix/media-formats.html
I don't have any experience in audio, but your best bet seems to be the SoundPool class, it allows you to adjust pitch and volume and it seems to be able to play multiple sounds simultaneously: "Note that calling play() may cause another sound to stop playing if the maximum number of active streams is exceeded."
http://developer.android.com/reference/android/media/SoundPool.html
There also is a MediaPlayer class, but this is for more simple use. I don't think it allows pitch control.
I made something similar for my application (playing trombones sample). After a lot of experiencing, I found the best solution was to use AudioTrack.
Have a look at my source code:
http://code.google.com/p/trombonino/source/browse/trunk/src/com/trombonino
Especially
http://code.google.com/p/trombonino/source/browse/trunk/src/com/trombonino/Trombone.java
http://code.google.com/p/trombonino/source/browse/trunk/src/com/trombonino/WavFile.java
You will have problems with your timing on the Android system. To avoid your sequencer thread being interrupted by garbage collection you probably need to write the sequencer in native using the ndk.
Playing back the sounds is probably best to do using the ndk as well.
Take a look at https://code.google.com/p/high-performance-audio/
In the above Soundfuse example the sequencer uses SystemClock.sleep() that is never a good idea. Check Why using System.Threading.Thread.Sleep() is a bad practice?.
Realized this question is really old but will answer it anyway since no answer mentions the NDK.

Media player libraries in Java [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I am evaluating libraries for playing audio/video in Java. It does not need to be 100% Java; Java bindings to native libraries are perfectly OK. An external application that can be controlled from Java is also fine, as long as it can render video on a Java component.
The target platform is Linux. Windows support is a plus, but not required.
I have played with VLC using the VLCj bindings, and it works pretty well in general, but keeps crashing occasionally when put under stress. I have also used mplayer in slave mode, which looks good. But I'd like to evaluate other options as well.
These are the requirements:
Live playback of H.264, MPEG4 through RTP using RTSP. Extra points for MJPEG over HTTP.
Able to render video on a Java (Swing or AWT) Component
Open source, and actively maintained
Stable, rock-solid
Suggestions? Advice?
Ok, I've spent the last month playing with several options and these are the results:
VLC. This was my first thought, as everybody keeps saying that it "plays everything". I have used both the VLCj Java bindings, and the built-in remote interface (-I rc). I found this to work pretty well in general, but had some issues. I kept seeing ocassional crashes under heavy load (not VLCj's fault as it also happens when using the binary directly). Also I've found memory consumption to be relatively high when compared to other options.
MPlayer. This actually performs better than VLC in my experience, no crashes, and memory consumption is lower. No Java bindings, although the slave mode works very well.
GStreamer. Very powerful, very flexible, while still easy to get started with. Tried both the Java bindings and running the gst-launch binary from Java. Both approaches work remarkably well.
Xuggler looked good, however it seems to have issues with RTP (as stated in the FAQ). Since both GStreamer and MPlayer worked so well, I did not get past the initial research.
I found GStreamer to be the best solution given the requirements, with MPlayer being the second option.
have you looked at gstreamer?
I've also spent a while researching my options, and I've actually come to the conclusion that VLCJ is the best option - however here's the clincher, you need to run it out of process (especially with multiple players) for it to give you 100% reliable operation. That's the approach I'm taking and I've yet to see it crash. With it rock solid in this way it also has other advantages:
It can play pretty much anything. Yes it's a bit of a cliche, but this includes DVDs, Youtube videos, pretty much any video file...
Should support Linux / Mac / Windows, though I've yet to verify Mac working.
Actively maintained, and if you ask a good (as in well thought out) question on the discussion group the owner often replies in minute in my experience!
Open source, and the Google group activity at the time of writing is high.
Uses all the graphics acceleration VLC does
Able to play to any heavyweight Canvas component (and if you use the direct player, you get the BufferedImage to display anywhere you like, even in JOGL 3D land if you're that crazy!
I haven't found it that heavy on the resources front either, though I haven't done any thorough testing (but 3 players work fine in tandem as well as my relatively power-hungry application on my 4 year old basic laptop!)
Disadvantages? There's no official framework for out of process players, so you have to build one yourself (see here for how I did it). And you do sometimes have to do some fiddling to get it working. But as far as I can see, it's working well for me so far!

What is a good Open Source game engine for a beginner? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I want to develop a game and I am at a beginner level.
When I searched for game engines on Google a long list was returned (e.g. Delta 3D, Panda 3D)
Then I looked at wikipedia and it also showed a very large list.
I am not sure which engine to choose.
Please suggest a good game engine and some good tutorial or a good ebook.
I am experienced in C++, QT4, Java and Python(at very initial level).
If the game engine supports Linux platform then I will be very happy.
You should check out OGRE3D. It's totally cross-platform and it's a commercial quality game engine- for example, the indie game Torchlight uses OGRE3D and it was a huge success.
Asuming you are looking at 3D, I'd personally recommend jMonkeyEngine.
It's well designed, open source, has great performance, very easy to use (for a 3D engine...) and under active development.
Whatever you choose then good luck - just be aware that you have a long journey ahead if you want to actually successfully develop a 3D game :-)
Java:
jMonkeyEngine
Python:
pygame (though not really a game engine)
For Linux you can look at the Cube which you can download from here.
Since you are a beginner, I suggest you look at linear algebra. A very good source for this is the Khan Academy. That you will be in a much better position to evaluate the needs you have for a game-engine.
Most all of the code for Quake engine, but not the content, has been made public. So you can play around with that engine to see if it's up to you specifications (the Quake 1, Quake 2, and Quake 3 engines have all been released). Quake 1, 2, and 3 all support the Linux platform.
Also, while the Source Engine isn't open source, a great deal of the source code is available through the Source SDK. It's very easy to modify and you should definitely consider working with it. However, Source is Windows and Mac only.
This resource deals with the Quake 3 engine and is a bit outdated, but I'm sure it'll suit you just fine.
You may wish to qualify your question with what sort of game you're trying to build. Not all game engines are created equal for this :)
So, just for brevity's sake, if you are after building a 2D game, the Gluon game creation and distribution framework ( http://gluon.gamingfreedom.org/ ) may well be the sort of thing you're looking for. Also because it's built using Qt, with which you mention you are already familiar.
If you're looking for 2D, then the GLib engine (theglibengine.wordpress.com) is probably a good start. I must warn you though, it's new and still a bit buggy. It's written Java. For 3D, I'd recommend JMonkeyEngine (for NetBeans) or Ardor3D (for Eclipse).
PLIB is a useful engine for Linux users. It uses a program called OpenGL to operate, so you may need that first, and it's a tiny bit complicated to install, but there are tutorials on that and on C+++ script writing. Perfect 3D engine for Linux.

Game programming in Java? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I am looking into game programming in Java to see if it is feasible. When googling for it I find several old references to Java2D, Project Darkstar (Sun's MMO-server) and some books on Java game programming. But alot of the information seems to be several years old.
So the question I am asking, is anyone creating any games in Java SE 1.5 or above?
If so, what frameworks are used and are there any best practices or libraries available?
there is the excellent open source 3d engine called jMonkey (http://www.jmonkeyengine.com) which is being used for a few commercial projects as well as hobby developers...
there is also at a lower level the lwjgl library which jmonkeyengine is built on which is a set of apis to wrap opengl as well as provide other game specific libs...
http://www.javagaming.org/ is a good source for up-to-date information.
Another framework not mentioned yet is Xith3D
I haven't directly done any game programming but some scene-demo coding and have found that JOGL is really a quite nice framework to work with. It's Java OpenGL so it has a rich 3D functionality and i do believe there are some open source graphic engines done for it aswell.
Also check Pulp core - deals with the most common problems facing Java gaming.
Despite the odd name ( pretty sure he's talking about the soft drink...), this site has loads of resources and examples games both 2D and 3D. Coke and Code
As an update, a couple of the JMonkeyEngine guys have forked that project to create Ardor3d, a new version of which was recently released, so its still under active development. Project Darkstar is also still actively developed. Indeed DarkMMO an opensource example Darkstar game is being currently refactored to use the latest version of both Darkstar and Ardor3d.
GTGE (www.goldenstudios.or.id) is an excellent 2D Java Game Library, with tutorials and an extensive API. It has gone open-source in its latest version, and the source can be downloaded, browsed, etc. at gtge.googlecode.com.
As mentioned by all others in this topic, there are plenty of excellent libraries/engines available for building games in Java.
Game programming in Java is definitely feasible. Keep in mind though that, as with any other language, getting real-time performance will always take some effort. I wrote a small article about my experiences with using Java for our 3D breakout game 'Caromble!'. It is mainly about the steps we had to take to get our game running smoothly.
http://www.caromble.com/2013/05/java-game-programming/
I've made a list of a bunch of tutorials that should be of help
I like to code games a bit in my free time. I use a library called slick2d which makes programming the back-end a lot easier. For example, you can copy/paste the example 'main' class file from the Slick2d Wiki and you have your game loop as well as the Update() and Render() methods all ready to go.
Slick 2d is based on LWGJL and uses it to load images and do other cool things with OpenGL. There is also a bunch of helpful topics at: http://www.java-gaming.org/

Categories

Resources