Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - AGP

Pages: 1 ... 103 104 [105] 106 107 ... 116
1561
Support / Midi Volume (Not jPCT But Java)
« on: February 03, 2009, 05:48:13 pm »
I've read everything on the subject that I could find by searching Google. Figured somebody here might know. I cannot, for the life of me, change the volume of the midi playback in my program. The following is my code. The last part (before the call to start()) is my attempt at discovering which Synthesizer is attached to the Sequencer. And the very last nested loop was an attempt to change everyone's volume. By the way, if my test for synthesizer.getDefaultSoundbank() == null is valid, I'm using the software synthesizer on my computer.

Code: [Select]
        private void playMidi(String fileName) {
try {
     midiPlayer = MidiSystem.getSequencer(true);
     Synthesizer synthesizer = MidiSystem.getSynthesizer();
     midiPlayer.open();
     synthesizer.open();
     Transmitter transmitter = midiPlayer.getTransmitter();

     if (synthesizer.getDefaultSoundbank() == null) {//MEANING "IF USING HARDWARE (NOT JRE) SYNTHESIZER"
transmitter.setReceiver(MidiSystem.getReceiver());//THIS IS RIGHT FOR HARDWARE
System.out.println("Hardware synthesizer!");
     }
     else {
transmitter.setReceiver(synthesizer.getReceiver());//SYNTHESIZER.GETRECEIVER() IS RIGHT FOR SOFTWARE

System.out.println("Software synthesizer in use!");
     }

     midiPlayer.setSequence(MidiSystem.getSequence(new File(fileName)));

     ShortMessage volumeMessage = new ShortMessage();
     int numberOfChannels = synthesizer.getChannels().length;
     for (int i = 0; i < numberOfChannels; i++) {
volumeMessage.setMessage(ShortMessage.CONTROL_CHANGE, i, 7, 5); //7 IS MASTER VOLUME CONTROLLER, 5 IS VOLUME BETWEEN 0-127
transmitter.getReceiver().send(volumeMessage, -1);
     }
System.out.println("Is the sequencer an instance of Synthesizer? "+(midiPlayer instanceof Synthesizer));

     MidiDevice device = MidiSystem.getMidiDevice(midiPlayer.getDeviceInfo());
     java.util.List<Transmitter> transmitters = device.getTransmitters();
     Transmitter[] transmitterArray = new Transmitter[transmitters.size()];
     transmitterArray = transmitters.toArray(transmitterArray);

for (int y = 0; y < transmitterArray.length; y++) {
for (int x = 0; x < 16; x++) {
volumeMessage.setMessage(ShortMessage.CONTROL_CHANGE, y, 7, 5); //7 IS MASTER VOLUME CONTROLLER, 5 IS VOLUME BETWEEN 0-127
transmitterArray[y].getReceiver().send(volumeMessage, -1);
}
}

     MidiChannel[] channels = synthesizer.getChannels();
     for (int i = 0; i < channels.length; i++){
channels[i].controlChange(7, 5);
System.out.println("Can we lower the volume? "+(channels[i].getController(7)!=0));}

     midiPlayer.start();
}
catch (Exception e) {System.out.println("Midi File Error: "+e.getMessage());}

1562
Support / Re: Md5 Importer
« on: February 01, 2009, 07:16:48 pm »
I've got a really kickass MD2 exporter for MAX named QTip. I've e-mailed the developer a few times, and he's very cool. The exporter costs (I think) 20 bucks, and it works perfectly with jPCT's importer. So, any animated model you can find that you could import into MAX you could export to MD2 using QTip. Works for me.

1563
Support / Re: Okino Website Claims 3DS Exports Cameras
« on: February 01, 2009, 07:06:57 pm »
Thank you, C3R14L.K1L4 and Egon for picking this up without me. I've been spending way too much to buy Okino's exporter! I've got my fingers crossed that Egon will find a way.

1564
Support / Re: Okino Website Claims 3DS Exports Cameras
« on: January 16, 2009, 03:40:09 am »
As far as I can tell, the only file format supported by jPCT that stores camera data is 3ds. Give me until Saturday and I'll get PolyTrans so I can send you a model with the camera data. And thanks again.

1565
Support / Re: Okino Website Claims 3DS Exports Cameras
« on: January 15, 2009, 12:31:02 am »
Is the following link to a PRJ file the same thing as a 3DS? It has both cameras and lights, and it looks like pretty much the same thing to me.

http://wolf359a.anet-stl.com/mesh/xwing.zip

1566
Support / Re: Okino Website Claims 3DS Exports Cameras
« on: January 12, 2009, 09:49:40 pm »
Sorry about that, pal. Get better soon.

1567
Support / Re: Okino Website Claims 3DS Exports Cameras
« on: January 10, 2009, 11:28:19 pm »
Do you want the MAX scene itself? Because I re-sent you the 3DS two days ago. But with the MAX scene you could export via other 3DS exporters (like Okino's).

1568
Support / Re: Okino Website Claims 3DS Exports Cameras
« on: January 09, 2009, 04:18:29 pm »
E-mailed you a screenshot. Thanks again.

1569
Support / Re: Okino Website Claims 3DS Exports Cameras
« on: January 09, 2009, 03:13:57 pm »
E-mailed a 3DS of a sheriff sitting down and a camera placed in front of him to you.

I'm not sure what you mean by "is it possible to get the camera settings in MAX in a dialog" but the coordinates for its position are -0.203, -22.073, 6.882. Thanks again, buddy.

1570
Support / Re: Okino Website Claims 3DS Exports Cameras
« on: January 09, 2009, 02:20:29 am »
No, not just to save time or formultiple views. My background, in this case, is 2D. Several objects on the foreground are 3D. Plus, there's a 3D plane on which the characters walk. But these object won't line up perfectly unless the camera is the exact same way. But there are differences in apperture and other things that just makes this impossible to do manually. I've tried everything. I come close to matching the cameras, but coming close is not nearly enough.

1571
Support / Re: Camera matching Object3d Z Axis
« on: January 08, 2009, 10:04:50 pm »
I'm not the one who started the thread. Just trying to help him. And no, no problem. It works great.

1572
Support / Re: Okino Website Claims 3DS Exports Cameras
« on: January 08, 2009, 09:57:24 pm »
I'm thinking a Camera[] Loader.load3DScamera(String, float) method. That way, you would load the cameras from only the files you wanted, and would set only the camera you wanted for the world at a time.

1573
Support / Re: Okino Website Claims 3DS Exports Cameras
« on: January 08, 2009, 06:26:56 pm »
I know but I use Max, so I'm covered.

1574
Support / Okino Website Claims 3DS Exports Cameras
« on: January 08, 2009, 04:23:21 pm »
Which, come to think, I'm sure I've seen done. Can we PLEASE get that implemented? It would change my life on 3D/2D hybrids like the game on which I'm currently working.

1575
Support / Re: Camera matching Object3d Z Axis
« on: January 08, 2009, 04:21:34 pm »
Some of this is Egon's. It's for my Rogue Squadron program. The camera is always behind the ship, wherever it goes or turns. Since I also don't know exactly what you want, I'm not sure if it will, but does that help?

Code: [Select]
     private void follow() {
Matrix matrix = xWing.getWorldTransformation().invert3x3();
camera.setBack(matrix);
camera.setPosition(xWing.getTransformedCenter());
camera.rotateCameraX((float)Math.toRadians(120));
camera.moveCamera(Camera.CAMERA_MOVEOUT, cameraToObjectDistance);
      }

Pages: 1 ... 103 104 [105] 106 107 ... 116