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 - Builderboy

Pages: 1 ... 127 128 [129] 130 131 ... 375
1921
Minecraft Discussion / Re: Minecraft
« on: January 27, 2011, 01:37:19 am »
Redstone is my friend :D

Now i just need to do this:

1922
Jumpman 68K / Re: Jumpman
« on: January 27, 2011, 01:21:30 am »
me too and congrats on the subforum :D definitely well earned ^^

1923
Miscellaneous / Re: Impatient Insanity
« on: January 27, 2011, 01:20:28 am »
I listened to the video in full


Haha but that was an awesome story :D I wonder what was in the package? o.O

1924
Minecraft Discussion / Re: Minecraft
« on: January 27, 2011, 01:19:56 am »
I have been playing minecraft for some time now, and I already have a host of fun things i have wrought :D

1) Automatic double doors that lead into my main base.  They open when you get near and stay open until you go through!  And there is also a switch which locks them closed so that mobs can't get in.

2) A giant cavern where I have mobs spawning.  I placed a trap in there that harvests them and then sends their loot into my base.  An alarm alerts me if there is any loot to be collected, as well as a flashing light to alert me.  

3) An automatic railway station that can take me too and from my two bases.  It always has a cart at both stations, so you can leave base 1 on foot, go to base 2, take the cart all the way to base 1, and repeat the processes forever :D It also automatically detects when you get into the cart, and sends you on your way.  When you arrive, it waits for you to get out of your cart and then takes the cart and brings it to the departing area of the station.

4) Large treehouse I built using saplings and bone meal, its really huge and can be seen for a long ways around!  Its a great way to find my way back to my base if I ever get lost :]

5) A walled courtyard where I can be outside during the night without fear of monsters spawning or getting in.  It contains my farm, which is on the edge of an ocean for irrigation, and trees for wood harvesting.

6) A skylight in my underground base so I can tell what time it is without going up (kind of rendered useless now that I crafted myself a watch XD)

1925
News / Re: Z80 to HEX conversion and vice-versa now available on IRC
« on: January 27, 2011, 01:09:52 am »
Wow thats so cool! :D I probably won't find much use for this myself but it definitely is epic ^^

1926
TI Z80 / Re: Isometry
« on: January 27, 2011, 01:05:07 am »
Heh I can't wait to see this Final fantasy Tactics game :D

1927
Official Contest / Re: [BULLETIN] Cage Matches
« on: January 27, 2011, 01:04:39 am »
Might it be a good idea to include the due date in the first post?  I can't find it D:

1928
TI Z80 / Re: Zelda News
« on: January 27, 2011, 01:03:32 am »
So I have a question, the parts that you change, are they usually things like chests and buttons and doors?  Things that are usually one tile, or a series of unique tiles?

1929
BatLib / Re: Creepy-Crawlies (Bugs)
« on: January 27, 2011, 01:01:01 am »
Hmmm does the same program crash at the same spot every time you run it?  If so, it might be an issue with the compiling?  If it crashes randomly, maybe an issue with interrupts?

1930
Computer Programming / Re: Java volume control
« on: January 26, 2011, 04:31:52 pm »
Nope, I did some heavy modification of the original code I had tested, creating a dynamic buffer that changed in size based on the frame length of a single frame of the game.  The issue that was preventing me before was that there was too large of a data buffer 128K, and when I changed the volume, it had to finished 128K of sound data before the changes could be seen.  By significantly shortening the buffer and making it dynamic, I was able to get smooth volume and pan control:

here is my Sound class:

Code: [Select]
import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
import java.io.File;
import java.io.IOException;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.DataLine;
import javax.sound.sampled.FloatControl;
import javax.sound.sampled.EnumControl;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.SourceDataLine;
import javax.sound.sampled.UnsupportedAudioFileException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import javax.sound.sampled.Control;


public class Sound  extends Actor
{
    AePlayWave sound;
    private String filename;
    SourceDataLine auline;
    private final int EXTERNAL_BUFFER_SIZE = 524288; // 128Kb
    byte[] abData = new byte[EXTERNAL_BUFFER_SIZE];
    int nBytesRead = 0;
    AudioInputStream audioInputStream;
    FloatControl volume;
    FloatControl pan;
    float vol = 0;   
    int count = 0;
    boolean stopped = true;
    boolean paused = false;
    long prev = 0;

    public Sound(){
    }
   
   
    public Sound(String wavfile){
        filename = wavfile;
       
        File soundFile = new File(filename);
        if (!soundFile.exists()) {
            System.err.println("Wave file not found: " + filename);
            return;
        }
 
        audioInputStream = null;
        try {
            audioInputStream = AudioSystem.getAudioInputStream(soundFile);
        } catch (UnsupportedAudioFileException e1) {
            e1.printStackTrace();
            return;
        } catch (IOException e1) {
            e1.printStackTrace();
            return;
        }
 
        AudioFormat format = audioInputStream.getFormat();
        auline = null;
        DataLine.Info info = new DataLine.Info(SourceDataLine.class, format);
 
        try {
            auline = (SourceDataLine) AudioSystem.getLine(info);
            auline.open(format);
            //auline.open();
        } catch (LineUnavailableException e) {
            e.printStackTrace();
            return;
        } catch (Exception e) {
            e.printStackTrace();
            return;
        }
 
        if (auline.isControlSupported(FloatControl.Type.PAN)) {
            pan = (FloatControl) auline.getControl(FloatControl.Type.PAN);
        }
       
        if (auline.isControlSupported(FloatControl.Type.MASTER_GAIN)) {
            volume = (FloatControl) auline.getControl(FloatControl.Type.MASTER_GAIN);
        }   
    }
   
   

    public void act(){   //must be called every frame of the game for sound to continually play
        if(stopped || paused){
            prev = 0;
            return;
        }
        long time = System.currentTimeMillis();
        long diff = 0;
        if(prev == 0){
            diff = 5000;
        }else{
            diff = time - prev;
            diff *= 200;
        }
           
        try {       
            nBytesRead = audioInputStream.read(abData, 0, (int)diff);
            if (nBytesRead >= 0){
                auline.write(abData, 0, nBytesRead);
            }else{
                stopSound();
            }
           
        } catch (IOException e) {
            e.printStackTrace();
            return;
        }     
        prev = time;   
    }
   
    public void setVolume(float vol){
        volume.setValue(vol);
    }
   
    public void setPan(float p){
        pan.setValue(p);
    }
   
    public void stopSound(){
        auline.stop();
        auline.flush();
        stopped = true;
        paused = false;
    }
   
    public void playSound(){
        //try {       
        //    audioInputStream.reset();
        //} catch (IOException e) {
        //    e.printStackTrace();
        //    return;
        //}   
        auline.start();
        stopped = false;
        paused = false;
    }
   
    public void pauseSound(){
        if(stopped || paused){
            return;
        }
        auline.stop();
        paused = true;
    }
   
    public void resumeSound(){
        if(stopped || !paused){
            return;
        }
        auline.start();
        paused = false;
    }

    public void loopSound(){
       
    }
}

1931
Other Calculators / Re: Your calculator collection
« on: January 26, 2011, 02:47:53 pm »
I has a Ti84+SE :P Thats it ;D

1932
News / Re: Obliteration ensues
« on: January 26, 2011, 02:47:03 pm »
The obvious next step is to play with >9000 simultaneous players.  How does pindurTi work with gcn?

Fixed ;)

1933
Computer Programming / Re: Java volume control
« on: January 26, 2011, 02:46:11 pm »
Hey thanks for your help everybody, I was able to eventually get it to work, but unfortunately specific circumstances have prevented me from using the method I developed.  It worked perfectly, it had volume, pan, and echo control, but it relied on input as a Wav file, and as I'm sure all of you know, wav files can be quite huge.  greenfoot applets have a maximum size requirement, and so I was forced to switch to mp3 files, of which I have no control over whatsoever.  So thanks for all your help, but unfortunately it looks like colume control will not play any part in Nightmare

1934
Math and Science / Re: Factorials
« on: January 24, 2011, 12:35:30 pm »
Just know that Omnicalc has a build in Gamma function :D

1935
Math and Science / Re: Factorials
« on: January 24, 2011, 12:30:54 pm »
The gamma function gives out the same answers as the Factorial function, but works for all Real and Complex numbers :)

Pages: 1 ... 127 128 [129] 130 131 ... 375