[INACTIVE][FUN] AhMIDI v 1.0 - Play MIDI files on Note Blocks [860]

Discussion in 'Inactive/Unsupported Plugins' started by IC3D, Jun 17, 2011.

  1. Offline

    IC3D

    This project was picked up from ahmeni. I have asked for permission to take up this project since he quit the project.

    Original thread: Click Here

    Ok, onto the plugin.

    AhMIDI (keeping with original name) is a plugin that allows you to play an entire MIDI file with noteblocks. Each block is given one track of the file.

    Features:
    * place signs to setup midi sequence
    * command to see how many blocks are playing
    * command to monitor/unmonitor a person to check for noteblock placement
    * command to stop all sequences before they finish

    Setup:
    1. place a noteblock anywhere on the map. To avoid a bug place blocks at least 1 unit gap from each other or some blocks will place twice
    2. place a sign next to that noteblock with the following format:
    Code:
    [MIDI]
     filename.mid
     tracknumber
    all items are case insensitive. See notes below.
    3. attach redstone wire from the sign to some power source

    Video:

    Notes:
    * redstone wire that passes by the sign will sometimes make the block play twice at the same time with a few milliseconds of delay between. Make sure wires are heading right towards the sign, and not along it.
    * when the plugin is loaded it should make a folder in plugins called midi, place all your midi files in that folder
    * Event activates sometimes when wire is broken or placed
    * Event will only activate when wire turns on, not off, with some exceptions

    Commands:
    * /midi stop : stops all midi threads (OP)
    * /midi monitor {playername} : watch to see when the player places a noteblock and where (OP)
    * /midi list : show how many threads are going at that current moment, may take a while if over 100 (OP)

    Todo:
    * Add Permissions, currently op
    * add a command to print all the music file names to the player so they know what files they can use
    * Any Suggestions?

    Uses:
    * A lever that makes a creepy sound
    * Alarms when soommeone steps on a pressure-plate
    * Notification when a source of power is lost

    Download:
    * Jar:

    - * <Edit by Moderator: Redacted mediafire url>

    Credits:
    * ahmeni:

    - * Original Scripting

    * 95+% of the code
    - DreadKyller:
    * Updated to latest Craftbukkit
    * Fixed 8 minor to medium bugs
    * Added Features:

    - * Monitor Player
    * Fixed unneeded code that set the block underneath to dirt, meaning no custom instruments

    Changelog:
    * 1.0 : released
     
    Last edited by a moderator: Nov 27, 2016
    Noppoly likes this.
  2. Offline

    captainawesome7

  3. Offline

    QQCucumber

    @IC3D Mind if I ask what makes, or will make, AhMIDI better than the alternatives, such as MidiBanks and MusicCraft?
     
  4. Offline

    jamescosten

    Why not just use music craft which has more features??
     
  5. Offline

    DreadKyller

    @captainawesome7 explain what you are doing, because I've tested it on 8 computers including one where my ip wasn't even the host, do you have your music files in the folder plugins/midi? are they even midi format? if not it wouldn't work.

    @QQCucumber : it's not nessesarilly better, but just as you are considering the others 'alternitives' this is 'another' way to play music files. Also searching for MidiBank the setup is much more specific, the wire placement HAS to be her and this HAS to be here. this plugin you can practically have them anywhere next to each other. This is only one way, this project was dead but it had gotten so far, at it's time it was the first of the midi plugins to be made, check the dates.

    @jamescosten why does every person on this forum have to complain every time someone posts a plugin somewhat simmilar to another one, yes MusicCraft has more features, but most of those features don't have anything to do with midi. Plus it has to convert all songs to MML format, it doesn't directly play midi.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  6. Offline

    jamescosten

    Im just saying alot of people are creating plugins so similiar to others its getting rather full up in the plugin thread :p
    And yes fair enough but you said it, ''more features'' I agree its easier to play a midi file on this. Im not sure though how big this will be, perhpas if it could play MP3's i would download it.
     
  7. Offline

    DreadKyller

    @jamescosten yes, but there are several differences between. one of the things I means to put in the todo list was other formats, but I'll put that up later, also another thing that's coming soon that the others do not have, pause and resume. I'm also asking for suggestions so the mp3 is on the list now.

    @captainawesome7 when I posted this thread I had 5 minutes to write it all upload all the files and submit it before I had to go. secondly, on every single redstone change event it has these lines in it:

    Code:
    File folder=new File("plugins/midi");
    if(!folder.exists()){
        folder.mkdirs();
    }
    So if it does not make the midi file that something is screwed up, I can delete my folder and it will just appear there again without anything. If it doesn't form just make one yourself then.

    next the name that the original coder wants it as is Sequencer, the jar file is called AhMIDI, if you're so worried about that then it's a simple fix to rename the file.

    Ps, check your plugins folder for a file called Sequencer, if so you can also put fiules in there and it should also read them, via this script:

    Code:
    File midi = new File("plugins/midi/"+filename);
    if(!midi.exists()){
        midi = new File("plugins/Sequencer/"+filename);
        if(!midi.exists()){
            File folder = new File("plugins/midi");
            if(!folder.exists()){
                folder.mkdirs();
            }
        }
    }
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  8. Offline

    captainawesome7

    @DreadKyller Well I put a midi that I know works in /plugins/midi and did what the OP says, and nothing happens. Video?
     
  9. Offline

    DreadKyller

    ...I'm trying to get a video working, but all video recorders lag me to like 8 fps. I finally found one that does not lag me at all but it has a very interesting format that has to be encoded by a program that comes with it, in which every time I try to save it "Error"
     
  10. Offline

    captainawesome7

    @DreadKyller Ahh, I was putting the wrong tack number :/
    Sorry about that. It does seem to play the songs too fast though, when I listen to them with my midi player they are alot slower...
     
  11. Offline

    DreadKyller

    strange, because in my game they play slower than the file. In next update 4'th line will hold a custom tempo, problem fixed. and video is almost done, not that you seem to need it now. but does it work ok?
     
  12. Offline

    MR_Schell

    For some reason it doesn't work for me. I have no clue what's wrong. All i know is nothing happens when i set it up and /midi replays with "An internal error occurred while attempting to perform this command".
    I have the latest version(build 860) of bukkit.
     
  13. Offline

    DreadKyller

    @MR_Schell you don't need to type "/midi" follow the video, it'll work, the only time you need to type /midi is to type '/midi stop' '/midi list' '/midi monitor {PlayerName}'
     
  14. Offline

    MR_Schell

    I did follow the video and nothing happened.
    I Put a midi file in the midi folder in the plugins folder.
    I placed a noteblock.
    I placed a sign right in front of it with "[MIDI]
    filename.mid
    1"(i had the actual file name of the file on the sign i checked 5 times)
    I connected powered red stone up to it and.... nothing happens.(i continued to do this 3 times)
    Only after i did all that did i type /midi to see if the plugin was even working.
     
  15. Offline

    DreadKyller

    yess,well I forgot to put a return in the script if only typed midi, so that's where the error was. but I don't know why it's not working, can you send me a screenshot of your setup?
     
  16. Offline

    MR_Schell

  17. Offline

    DreadKyller

    strange, all midi's should work, maybe not, I guess it depends a little how they were compiled.
     
  18. Offline

    s1ck3st

    we're using midibanks for playin' midi files and we're totally satisfied 'cos it's easy and simple and the results are quite good! so what makes this plugin special or "new"? can anybody spot the difference plz
     
  19. Offline

    DreadKyller

    @s1ck3st like I have said above, it's not new or better, it's just a different way, midi bank has an easier setup for some aspects but this has an easier setup like(more easy to understand) also redstone placement is a bit less specific. The only reason I picked this one up was because this one (at it's time) was the first and only midi plugin to be made, or even thought of. That's not the case now, there are better ones, but I still like to keep the original up and running, the old version of this was first around at MC 1.3_01 maybe earlier because the history seems to get deleted after a while. final conclusion:

    *Not better
    *Not Special
    *Just the updated version of the original for people who want to try it out

    Of coase this one will have some features sometime soon that include:
    • support for MP3
    • Support for Wave
    • Support for almost every audio format

    I'm also still looking for more suggestions, because this plugin is basic it has plenty of room to improve.
     
  20. Offline

    SonataKH

    You should add the ability to change the song speed by %. All my midi's play way too fast.
     
  21. Offline

    DreadKyller

    @SonataKH I am planning on it already:
     
  22. Offline

    bobloy

    I get this error then the server restarts when I was experimenting with the signs
    Show Spoiler
    2011-06-23 07:14:29 [SEVERE] Could not pass event REDSTONE_CHANGE to Sequencer
    java.lang.NumberFormatException: For input string: ""
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:493)
    at java.lang.Integer.parseInt(Integer.java:514)
    at com.ahmeni.bukkit.sample.aBlockListener.onBlockRedstoneChange(aBlockListener.java:104)
    at org.bukkit.plugin.java.JavaPluginLoader$33.execute(JavaPluginLoader.java:468)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:310)
    at net.minecraft.server.BlockRedstoneWire.a(BlockRedstoneWire.java:114)
    at net.minecraft.server.BlockRedstoneWire.g(BlockRedstoneWire.java:44)
    at net.minecraft.server.BlockRedstoneWire.doPhysics(BlockRedstoneWire.java:289)
    at net.minecraft.server.World.k(World.java:432)
    at net.minecraft.server.World.applyPhysics(World.java:407)
    at net.minecraft.server.BlockRedstoneWire.g(BlockRedstoneWire.java:52)
    at net.minecraft.server.BlockRedstoneWire.doPhysics(BlockRedstoneWire.java:289)
    at net.minecraft.server.World.k(World.java:432)
    at net.minecraft.server.World.applyPhysics(World.java:407)
    at net.minecraft.server.World.update(World.java:380)
    at net.minecraft.server.World.setData(World.java:322)
    at net.minecraft.server.BlockLever.interact(BlockLever.java:161)
    at net.minecraft.server.BlockLever.b(BlockLever.java:135)
    at net.minecraft.server.ItemInWorldManager.dig(ItemInWorldManager.java:77)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:455)
    at net.minecraft.server.Packet14BlockDig.a(SourceFile:42)
    at net.minecraft.server.NetworkManager.b(NetworkManager.java:223)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:399)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:309)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:422

    Also I couldnt get any other midi to work besides The Beatles Yellow Submarine
     
  23. Offline

    DreadKyller

    @bobloy it seems to be when you reload plugins can not read the signs for a few ticks or something, anyways, because the error is coming from gathering the text on line 3 and turning it into an int, it's saying there is no content on that line. Do you have it attached to a continuous circuit? otherwise it should not have the problem. About only being able to play one MIDI that's almost impossible, because all midis are made with things called sequences, and each sequence has notes, think of each sequence as the track, one could be a drum, another a guitar, ect. this just gets the track of what ever you type in and plays the notes in order. Are you sure you are using the right tracks? try one ofn each of them to make sure, sometimes they are compiled into one track.
     
  24. Offline

    bobloy

    I'm an idiot, its now working perfectly! Permissions support would be great though
     
  25. Offline

    DreadKyller

    Ok, I'll add permissions support, unfortunately I will not for a while, I have 2 projects I need to work on and a third coming in a few days.
     
  26. Offline

    JanTTuX

    mario song sounds 100% not mario :(
     
  27. Offline

    DreadKyller

    @JanTTuX you need the right instruments lol
     
  28. Offline

    JanTTuX

    oh yeah xD
     

Share This Page