Java-Gaming.org Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (612)
Games in Android Showcase (172)
games submitted by our members
Games in WIP (658)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1] 2 3 ... 34
1  Discussions / Miscellaneous Topics / Re: OpenAL fails on my computer on: 2015-08-28 09:56:52
Julien has fought this wars of the APIs on JGO, spreading annoyance and misery to those involved. We had to close down entire boards ...

 Pointing

I sometimes wonder whether Julien is aware of the immense amount of harm he has done to something he professes to care about.  I've used both LWJGL and JOGL on different projects for different reasons - both have their pros and cons.  That anyone can show such religious fervour for a programming library is beyond me.  That JOGL doesn't have a solid and positive presence on JGO I find a shame.
2  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-08-14 17:48:24
Cool demo, at 3:17 there was a noticeable change in the live-coded pitch and then frequency which was quite impressive.
To give the demo a wider appeal, you might consider making bigger changes earlier on, and changing the graphic visualisation too.

Thanks!  Generally agree with you, but I'm still learning my way around my own tool here.  Grin  I'm working on doing some more videos like these (unedited real-time), but also possibly some more structured and edited ones to get more features demoed in a shorter space of time.

By the way, have any DJ's tried the project with electronic dance music?

Not yet that I know of, but then the new audio API was only released a few days ago, and is sorely lacking in documentation at the moment.  Various VJ's have done stuff with Praxis LIVE, so hopefully some interest will develop on the audio side soon too.  I also know a few people who are interested in using it to teach audio DSP.

For music usage there's a few UI improvements to come that will help.  I'm also hoping to put some music together with it sometime soon - a looong time ago I did a music degree - the tracks on the earlier videos I posted was old stuff of mine from about 15yrs ago.  Cool ...  Roll Eyes
3  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-08-12 20:39:52
Well, took @philfrei advice and made a somewhat more interesting video of live synth coding in action!  Wink  Rather than build up to a track, this actually de-constructs one of the new examples in the latest Praxis LIVE release.  Pure Java audio DSP, with both analogue and FM synthesis, and a little OpenGL visualization for the easily audibly distracted ...

(best watched at 1080p on YouTube itself if you want to make out some of the code!)

<a href="http://www.youtube.com/v/lK94qu1iObo?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/lK94qu1iObo?version=3&amp;hl=en_US&amp;start=</a>

4  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-08-06 07:44:41
Nice! Neat to hear the FM towards the end. It might be nice to have a 3-deep op patch demonstrated, as that is where most FM algorithms fail. Or show, if your program supports it, the ability to copy a pair of ops and tweak the pitches slightly on the second copy, to get a bit of phasing, thickening up the sound (a very common and useful FM programming technique).

Thanks!  It supports anything if you can code it - as well as the various pre-built components, it allows you to live code per-sample Java DSP.  That's what the FM example at the end is doing.

Overall, maybe the demo could be tightened up a bit, depending on what the goal is, and build to a final song that uses most of the parts built along the way. Is it maybe a bit long for something that is supposed to be "simple"?

Agreed, it's not my most exciting Praxis LIVE videos!  Wink  I just wanted to demonstrate the various coding aspects but will do one with a more interesting "score".  My aim with these [rough cuts] videos at the moment is one live, unedited take of the process for achieving a particular task.  Unfortunately, DSP coding is never going to be that quick!

Also, very difficult to read the text, even in full screen,

Try going to YouTube and forcing to 1080p.
5  Game Development / Newbie & Debugging Questions / Re: Interfaces and Method call- Handling by the JVM on: 2015-08-05 08:21:58
So first : Is is a bad practice ?(Almost sure that's a bad practice)
...
And a correct way to handle that, a check for instanceof feel like the code is bad designed but i don't really see any other way.

You have the former but you're worried about the latter?!  Tongue

instanceof has its place in a single dispatch language like Java.  Don't overuse it, but don't overly complicate things just to get rid of it!  Particularly don't worry if it's a check for a single type - eg. imagine how convoluted implementing equals() could be without type checking.  Ideally remove the need for it from your API though -

Have you a reason why isFriend(Person other) isn't a method of the Person interface?  Then the Student implementation would be -

1  
2  
3  
4  
5  
6  
7  
8  
public boolean isFriend(Person other) {
  if (other instanceof Student) {
    Student s = (Student) other;
    // do fast check
  } else {
     // do slow check (assuming Students can be friends with non-students, otherwise return false
  }
}


EDIT : appears @CelestialCreator and I had the same idea at the same time.  That's the problem with celestial creators - they always know what you're thinking!  Grin
6  Game Development / Shared Code / Re: Phase Modulation for Synthesizers on: 2015-08-04 12:31:54
Just posted this Praxis LIVE video elsewhere, but some simple phase modulation (I think  Wink ) from about 6:00 ...

https://youtu.be/C3dv2rf4fNM
7  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-08-04 12:30:07
Audio coding seems to be in at the moment ...

Just made video of simple live synth creation using new audio coding API in Praxis LIVE

<a href="http://www.youtube.com/v/C3dv2rf4fNM?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/C3dv2rf4fNM?version=3&amp;hl=en_US&amp;start=</a>

Aiming to get this in a release on Saturday, just for the pun of it.  Wink

8  Game Development / Shared Code / Re: Phase Modulation for Synthesizers on: 2015-08-01 09:38:25
@nsigma - the sin coefficients are bad.  Truncated power series is never a good choice.  Remez will give much better results.  The comment on 'abs' is incorrect.  There's no special NaN handling in abs.  It's not handling negative zeros...abs(-0) = -0 instead of +0.

The code was copied verbatim from the link (Toot), including the abs() and comment.  See your point, the actual JDK code is

1  
(a <= 0.0F) ? 0.0F - a : a;


so it's not exactly worth the effort now (I wonder if the implementation has changed at all).

In terms of "better results" that is in some ways a subjective thing.  Accuracy isn't all of it - eg. from what I can gather the DX7 used a low resolution LUT for sine waves, the inaccuracy of which in itself contributes to the final sound.
9  Game Development / Shared Code / Re: Phase Modulation for Synthesizers on: 2015-07-31 08:44:22
Original, I wrote FMOp's that employed frequency modulation instead of phase modulation. In that case, the value of cursor every frame would vary considerably, depending upon the amount of modulation which was being +='d into it.

Ah, thanks for that .. so, turns out I was doing FM and not PM.  Finally think I understand the difference in the maths. See, told you you know more about this than I do!  Wink

In terms of faster sin functions, I did experiment with plotting the (audio spectrum) output of the sin function from here the other week.  It's got some added harmonics which make it a little too "warm" for a pure sine tone, but might be OK for this purpose.  It's similar but not identical to the sin function Kappa posted.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
   // http://www.devmaster.net/forums/showthread.php?t=5784
    private static final float S_B = (float)(4 / PI);
    private static final float S_C = (float)(-4 / (PI*PI));
    // -PI < x < PI
    public final static float sin(final float x) {
        return S_B * x + S_C * x * abs(x);
    }

     // provide a faster abs, no NaN handling
    public final static float abs(final float x) {
        return x < 0 ? -x : x;
    }

10  Game Development / Shared Code / Re: Phase Modulation for Synthesizers on: 2015-07-30 08:00:38
Thanks for posting this, and sorry it's taken a couple of days to find enough time to read it properly.

nsigma, maybe you understand this better and have a suggestion for this step? My head is a little far away from the theory at the moment. Maybe there is a decibel/logrithmic function-related that would be more ideal.

I understand this far less!  Wink  The new Praxis LIVE release (out in a couple of weeks) will have live audio coding capability.  I've been trying to get my head around FM / PM synthesis to test it, but it's really new to me.  I think the algorithm I'm using is the same as yours, although I haven't tried adding in envelopes yet, which I guess is fairly fundamental.

From an amplitude perspective, a power curve should approximate the dB response.  This article might be worth a look - http://www.dr-lex.be/info-stuff/volumecontrols.html  I was thinking of following the advice there of ^4

One thing I don't get is why you're using a cos curve on the modulation amplitude.  Would you not use the same amplitude mapping there?

11  Game Development / Shared Code / Re: Extremely Fast sine/cosine on: 2015-07-27 11:01:37
I have to manage the cursor to make sure it doesn't look up a value outside the LUT, and his doesn't actually require this.

Isn't that being managed inside the code, which would just mean that he's managing it "better"?  Wink

I'm assuming the radian value inputs will remain accurate all the way up to Float.MAX_VALUE. Is this true?

I doubt it.  At some point your cursor (oscillator phase?) will surely become of sufficient magnitude that the phase increment effectively becomes a no-op?  Even before it becomes a no-op, it will become less accurate.  I wonder how long it takes for that to become audible?

Yay! Looks like this discussion will result in a significantly faster FM synthesis processing algorithm for me to use.  Grin

[OT] would love to see the code for the algorithm if you're up for sharing it (in another thread)?  Trying to get my head around FM (well, I assume you're actually doing PM?) at the moment.
12  Discussions / Miscellaneous Topics / Re: What's your favorite OS and why? on: 2015-07-14 15:06:12
Oh, and multi-monitor support is quite bad in Ubuntu.

Huh, what?  Generally found this really good.

I also like the Unity desktop Wink

Finally I'm not the only one!  Grin
13  Discussions / General Discussions / Re: Oracle are winning in the 'copyright an api' legal fight on: 2015-07-02 07:58:49
If copying the entire api is not possible, then compatibility is broken.

Not necessarily, because interoperability would come under fair use.  Interesting in this case is that Google deliberately designed Android not to be compatible ...

Obviously this is silly, but this chain of thought seems consistent with oracle's and some of your arguments.

My only argument is that it's a somewhat arbitrary line deciding that code can be copyright but API's can't, as if they exist in some vacuum from each other.

Incidentally it seems at some point Google tried to argue that code shouldn't be copyrightable either, only patentable.  Oh joy!  See, neither side is right in this argument but both sides may (inadvertently) f**k things up even more than they are already.  Wink

I'm on neither side - I'm sitting on the fence munching popcorn.
14  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-07-01 14:46:38
Bought a hosting server on Digital Ocean,

Depending what you're building on there, I'd recommend Cloudways or something similar - managed hosting on top of Digital Ocean.  The lower tier has no mark-up.  Of course, Cloudways are focused primarily on PHP, so you might have to hunt around for a service providing the platform you want.  Unless you have a particular desire to manage the entire server stack yourself, it's a good way to concentrate on the important stuff.
15  Discussions / General Discussions / Re: Oracle are winning in the 'copyright an api' legal fight on: 2015-07-01 12:47:20
Surely it's quite the opposite though; the API can *only* be expressed in one form,

That's a tautological argument.  The process(es) which the API expresses could be expressed in another form as a different API.

a precise set of class, field & method signatures.

And documented behaviour!  Without that the API is pretty much worthless.  With that, in particular in the specification of behaviour between components, you start to get the expression of the idea (IMO).
16  Discussions / General Discussions / Re: Oracle are winning in the 'copyright an api' legal fight on: 2015-07-01 11:18:42
....but processes are not subject to copyright.

Much as I dislike quoting Wikipedia

Quote
copyright for computer programs prohibits not only literal copying, but also copying of "nonliteral elements", such as program's structure, sequence and organization. These non-literal aspects, however, can be protected only "to the extent that they incorporate authorship in programmer's expression of original ideas, as distinguished from the ideas themselves."

What I'm saying is that an API could embody all of the expression of the idea, where the implementation of each individual method (the code) is trivial / only expressible in one form and therefore can't be copyrighted.
17  Discussions / General Discussions / Re: Oracle are winning in the 'copyright an api' legal fight on: 2015-07-01 10:52:28
I really don't see how APIs can be copyrighted; they're not an expression of an idea,

I agree with @ags1 and @princec.  In quite a lot of my code, particularly the public facing API's, often more work goes into creating the API than into its implementation.  Individual method behaviour is defined by the API, and individual method implementations can often be trivial.  It is the API that defines the process and therefore the API that is the expression of the idea.  Actual code is "just" an implementation detail.  Wink
18  Discussions / General Discussions / Re: Oracle are winning in the 'copyright an api' legal fight on: 2015-07-01 08:42:32
Ethically, making it first open source and then suing someone for seemingly using it appropriately,

At which point your argument breaks down because the case has nothing to do with it being open source, but if it had been that Android derived from OpenJDK this would have been using it inappropriately, in that Google has no right (ethically or legally) to change the license.

A) They didnt image this usage - Seemingly impossible and or very stupid

There's a reason Java ME is GPL without the classpath extension.  And likewise, a reason that the ARM version of HotSpot isn't open-source.  Wink
19  Discussions / General Discussions / Re: Oracle are winning in the 'copyright an api' legal fight on: 2015-06-30 15:15:01
Yeah I think there is no right but both are wrong in their own positions, as I said before Cheesy

True, so you did  Wink  this OTOH I disagree with you on ...

I know it is kind of stupid but if you want to use Java on a mobile you're supposed to use Java ME and for Java ME you have to pay royalties. Google worked around that saying that a mobile these days is powerful enough to run a normal Java or better said not to use Java but Dalvik / ART on the mobile and "cross-compile" the Java bytecode to Dalvik bytecode.

Had Android development started later and had Google been happy with GPL w/CPE, they could have used OpenJDK as the basis for Android.  The GPL doesn't allow field of use restrictions, so Oracle couldn't do anything about that.

I'm surprised sometimes Google hasn't re-based Android's Java API on top of a fork of OpenJDK.  I don't see that the license change would affect their business model that much, and they're already using GPL (without CPE) code in the OS.
20  Discussions / General Discussions / Re: Oracle are winning in the 'copyright an api' legal fight on: 2015-06-30 14:50:06
Yes, because the FSF never went after anyone for GPL violations!  Tongue

Actually there is no GPL violation. The CPE keeps the APIs (which will be linked into your program) out of the GPL necessity to redistribute your own code as GPL. It is kind of like a LGPL for the Java Standard API. The internal implementation inside the Dalvik-/Android-Runtime is no OpenJDK code but partly taken from the old Apache Harmony project (which obviously is ASL2 licensed) and partly self written by Google. So no violation at all, and the FSF hunts GPL violations down, see router vendors in the past.

Yes, I know!  My point kind of skipped by you there  Wink  I was pointing out that @CommanderKeith's suggestion that this case is about Google copying an open-source project is incorrect.  Had they used OpenJDK (and GPL w/CPE), which would also have required said time machine, there wouldn't be a case because of the API permission you mention. 

I mentioned FSF because they're quite supportive of Google's position, but had Google instead forked OpenJDK and placed it under ASL2, then FSF would have been clearly backing Oracle.  I tend to agree with @princec that there isn't really a "right" in all this.
21  Game Development / Newbie & Debugging Questions / Re: JNI threading > JNIEnv memleaks on: 2015-06-30 14:36:18
The good news is that the JVM uses TLS caching too;

But not AFAIK automatic thread detachment using TLS destructors, or a least it didn't, which is a shame!

DetachCurrentThread is never called; the expectation is that native threads will be few and as long-lived as the application.

That's a bit of an arbitrary viewpoint, although it might be true for the majority of use cases with LWJGL.  Using a native media library for video inter-titles is one obvious case where it might not be though, as it's likely to start a new media callback thread each time.
22  Discussions / General Discussions / Re: Oracle are winning in the 'copyright an api' legal fight on: 2015-06-30 14:21:48
They are suing Google for copying an open source project. Seems pretty obvious to me that google is right and oracle is wrong.

Edit: Assuming that google kept to the terms of the open source license agreement, which I think they did.

Yes, because the FSF never went after anyone for GPL violations!  Tongue

If Google had actually forked off OpenJDK under the GPL w/CPE then there wouldn't be the hint of a case.  This is partly because Google wanted to control the ecosystem.  It may also be due to the lack of a time machine.
23  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-06-30 10:30:56
Seems like there's a lot of audio coding going on at the moment - I'm most of the way through completing the live audio coding element of Praxis LIVE - link up FX and live code DSP, all without a break in the sound.

Of course, progress is slowed by the fact that I keep getting distracted making bleepy noises!  Grin
24  Game Development / Newbie & Debugging Questions / Re: JNI threading > JNIEnv memleaks on: 2015-06-30 10:00:57
i do cos i'm running into
OutOfMemoryError
s (after creating thousands of short-living threads) and try to fix it.
Forgive me if i seem like I'm being a pain.  How are thousands of short-lived threads being created?

For thread read Thread.  This issue is caused by the creation of thousands of Thread objects that proxy the same (or a few) native threads.
25  Game Development / Newbie & Debugging Questions / Re: JNI threading > JNIEnv memleaks on: 2015-06-30 09:52:21
TL;DR - switch to using JNA  Wink

OK, I did a load of research to help fix this issue in JNA.  This now uses thread-local storage (pthread_key_create or TlsAlloc) to cache a reference to the JNI info for an attaching thread, and makes use of the TLS destructor to detach the thread from the JVM just before the thread dies.  This behaviour isn't JNA default, but has to be requested - I did some work on it because of a similar issue in binding to a native audio library (JACK audio server <> JNAJack)

JNA code for this is included in here - https://github.com/twall/jna/blob/master/native/callback.c

Incidentally, the complexity of that code is one reason I'm quite in favour of projects like JNA - fix the problem in one cross-platform library rather than many!

@trollwarrior1 mentioned Android - if this is just for Android then it's easier because you don't have to handle the Windows side and pthread TLS is simpler.  This is mentioned in the Android docs (last paragraph) - http://developer.android.com/training/articles/perf-jni.html#threads

btw - the Thread objects created are very lightweight.  On desktop I did some benchmarking, but while there was a significant performance hit with audio in JNAJack, there was minimal with video in GStreamer-Java - but there's the difference between 24fps and 600+!
26  Java Game APIs & Engines / Engines, Libraries and Tools / Re: YUNPM get frame is black on: 2015-06-29 16:37:56
That's a fancy trip down the rabbit hole, btw.

Been there, done that.  IIRC though it should in this case pass everything to the native conversion loops in one go rather than per pixel, hence blindly hoping that the OP might find it fast enough.  It's a quicker thing to test.

Does YUNPM give any way to specify what color model FFMPEG provides the data?  Easy to modify to BGR?

especially considering that people report factor 1000 slowdowns for some paths in the link you mentioned.

That also mentions some versions of OSX, that makes me think it might refer to the old Quartz renderer - nice and fast in some circumstances, FUBAR in others.
27  Java Game APIs & Engines / Engines, Libraries and Tools / Re: YUNPM get frame is black on: 2015-06-29 15:15:47
I think that triggers an extraordinarily slow path when rendering. persecutioncomplex

Quite possibly, although at worst it's probably* only doing the same byte rearranging you are.  Wink

* probably implies logic in Java2D  persecutioncomplex
28  Java Game APIs & Engines / Engines, Libraries and Tools / Re: YUNPM get frame is black on: 2015-06-29 13:59:39
BufferedImage sadly doesn't have a 3BYTE_RGB type Roll Eyes

hmmm .. possible to make one though (code not tested - based on this)

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
WritableRaster raster = Raster.createInterleavedRaster(
        DataBuffer.TYPE_BYTE, width, height,
        width * 3, // scanlineStride
        3, // pixelStride
        new int[]{0, 1, 2}, // bandOffsets
        null);

ColorModel colorModel = new ComponentColorModel(
        ColorSpace.getInstance(ColorSpace.CS_sRGB),
        new int[]{8, 8, 8}, // bits
        false, // hasAlpha
        false, // isPreMultiplied
        ComponentColorModel.OPAQUE,
        DataBuffer.TYPE_BYTE);

BufferedImage img = new BufferedImage(colorModel, raster, false, null);
29  Discussions / Miscellaneous Topics / Re: How to Learn Web Development for Java Programmers on: 2015-06-27 10:14:32
How would you create a new page, say a new blog post, without using a database?

Copy & paste into a new file.  Or use Jekyll ^^ or some other static site generator - if you're using plain HTML files and you decide to change header say, you need to do that in every file.

Onto a different subject, which editor would you guys recommended using for editing HTML/CSS files on Windows?

NetBeans!

I've been using the HTML5 support in NetBeans recently and like it.  There's a plugin for Chrome that lets you debug things too - point at something in the browser and highlight the code that creates it, etc.

https://netbeans.org/kb/docs/webclient/html5-gettingstarted.html
30  Discussions / Miscellaneous Topics / Re: How to Learn Web Development for Java Programmers on: 2015-06-27 08:59:15
Static sites are a thing, especially for tech blogs these days it seems...

Yes, and definitely not just for tech blogs.  We've also been looking at how to open up client-side editing (with prose.io, Cloud Cannon, etc.)  Separation of CMS features and static content is nice, both from a security side (CMS exploits happen in hours!) and for performance.

I'd be tempted to have a look at Jekyll, which is used on GitHub pages.  It's a good way of learning the basics (HTML / CSS / JS) which you need, while offering enough templating functionality to meet your needs for managing a project site / blog.  And you can host it for free too!   Grin

Also, there are some great starter themes out there that you can build on top of, for Jekyll or plain HTML5 - tweaking those is a good way of learning IMO.

http://jekyllthemes.org/ | http://startbootstrap.com/ | http://html5up.net/

Eagle-eyed may notice new Praxis LIVE website is derived from Start Bootstrap's Grayscale theme.  I build web stuff for a living, but I'm not averse to some time-saving (and legal) plagiarism!  Wink
Pages: [1] 2 3 ... 34
 
afikri (11 views)
2015-08-31 09:30:22

afikri (18 views)
2015-08-31 09:30:07

afikri (7 views)
2015-08-31 09:27:24

afikri (12 views)
2015-08-31 09:26:40

Roquen (16 views)
2015-08-29 11:30:54

GamerC4 (29 views)
2015-08-22 20:38:50

GamerC4 (25 views)
2015-08-22 20:37:18

GamerC4 (29 views)
2015-08-22 20:37:01

Kefwar (35 views)
2015-08-22 18:07:24

GamerC4 (26 views)
2015-08-22 01:00:24
HotSpot Options
by Roquen
2015-08-29 11:33:11

Rendering resources
by Roquen
2015-08-17 12:42:29

Rendering resources
by Roquen
2015-08-17 09:36:56

Rendering resources
by Roquen
2015-08-13 07:40:51

Networking Resources
by Roquen
2015-08-13 07:40:43

List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30
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!