This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
neonerz's profile picture

RAC Media Player [v2.0]

Started by neonerz, 03 March 2014 - 05:05 PM
neonerz #1
Posted 03 March 2014 - 06:05 PM
RMPv2 is a ComputerCraft based media player that support both Music Disc's and Open Block's new Radio feature.

Features
  • Touchscreen
  • Auto-Scanning of discs (Adding new discs is as easy as dropping one in a chest and hitting scan)
  • Radio Support!
  • Volume support for the radio
  • Support for future mods that add music discs (this script will support any mod that adds Music Discs. Just make sure you follow step one)
Prerequisites
  • ComputerCraft (duh)
  • Open Peripherals (getAllStacks() is required to read the chest and radio)
  • Open Blocks (optional for radio support)
Video Instructions:

[media]http://www.youtube.com/watch?v=tfSSdY0jQQk[/media]

Images:


Install
  1. Rename your music discs in an anvil using the following format "Author - Title" (if you do not do this, the turtle-dj will not be able to recognize the track names. Radio crystals are already named properly, so they don't need to be renamed)
  2. Setup a wireless turtle with a chest below it (containing your music discs and optional radio crystals) and a disk drive above it. (position of chest and disk drive can be swapped, but will need to be edited in the code. They must be either above or below the turtle. Putting the chest and disk drive in any other position is not supported)
    1. If you want radio support, the radio needs to go *in front* of the turtle. Any other position is not supported
  3. Download the turtle-dj script from pastebin. There is some variables to configure, but we can do that after setting up the monitor
    1. pastebin get Sc9G4Px2 turtle-dj
  4. Setup an advanced computer with a wireless rednet modem and an advanced monitor in at least a 4x3 configuration (larger displays are supported, but this is the minimum.)
  5. Download the main rmpv2 script from pastebin
    1. pastebin get vN9eJaqT rmpv2
  6. Configure the following parameters inside the script (#edit rmpv2)
    1. modem - The side of the computer the modem is attached to
    2. monitor - The side of the computer the monitor is attached to
    3. turtle - The ID of the turtle-dj (this could be found out by executing the 'id' command on the turtle)
    4. radioCrystal - This is the item ID of a Radio Crystal. If you aren't using the optional radio support, this can be left alone
  7. Now get the ID of the computer that's running the monitor and edit the following parameters on the turtle-dj script (edit turtle-dj)
    1. chest - The position of the chest
    2. drive - The position of the drive
    3. modem - The position of the turtle's modem (keep in mind, this will almost always be 'right')
    4. radio - The position of the radio if you want optional radio support (this should always be left as 'front' as the script only support radios in front of the turtle)
    5. radioCrystal - This is the item ID of a Radio Crystal. If you aren't using the optional radio support, this can be left alone
    6. monitor - the ID of the computer running the monitor
  8. Optional Set the startup script to run the downloaded application if you want the script to run as soon as the computer boots up
    1. edit startup (on both the computer and turtle)
    2. computer: shell.run("rmpv2")
    3. turtle: shell.run("turtle-dj")
  9. Start both the turtle-dj script and the rmpv2 script
  10. Listen to some cool jams!
Pastebin Links:

rmpv2 (computer's code): http://pastebin.com/vN9eJaqT
turtle-dj (turtle's code): http://pastebin.com/Sc9G4Px2

Known Bugs:
  1. 4x3 screen size needs to be updated. For some reason if you place a 4x3 screen first, the spacing will be offset. To fix this, make the monitor larger (5x3 for instance), hit scan to refresh the screen size, then remove the extra row of monitors (4x3 again) and hit scan again
  2. If an item (besides a radio crystal) is included in the chest, but isn't named in the "Author - Title" format, the scan will stop when hitting that item
Future Additions:
  1. Multi-page Support. I was not able to get this added to this version. That means if you run out of space on the screen, you'll need to make the monitor bigger to support more songs. (the minimum screen size of 4x3 supports up to 24 tracks)
Things I'd like to add, but can't:
  1. Volume Support for Music Discs. Unfortunately there's currently no way to raise or lower the volume of a music disc since it's completely client side. As far as I'm aware, CC would have to write a completely new music API to implement this feature. (it does work for radio stations though)
  2. Random/Repeat/Playlist functions. Since a Disk Drive can't detect when it's done playing music (for similar reasons as above), there's no logical way to create those features. I am open to suggestions though.
Final Notes:

I never claim to be a developer, as such my code might not be the cleanest or bug free.

As with all my scripts, you are completely free to do whatever you want with this. Edit it, incorporate it into your own project, distribute it, etc. The only thing I ask is if you edit it or incorporate it into your own project you give me a shout out. This is only a friendly suggestion, you are welcome to be a jerk and claim it as your own.

If you do incorporate this into your own project, shoot me a message, I'd love to check it out.
Edited on 03 March 2014 - 05:06 PM
kwstoudt #2
Posted 31 July 2014 - 12:43 AM
Is there any way you could change this or tweak it so that it doesn't require a turtle? they are banned on the server I want to use this on
H4X0RZ #3
Posted 31 July 2014 - 01:13 AM
Is there any way you could change this or tweak it so that it doesn't require a turtle? they are banned on the server I want to use this on
Unfortunately, he isn't able to make it "turtle-less" since a computer can't handle items by default. BUT I saw someone made a "Computer Item Buffer" a while ago which allowed a computer to push one item at a time.
Not-A-Spammer #4
Posted 02 August 2014 - 09:32 PM
This Is Awesome!! Is There Any Way You Can Make A Pocket Computer Version?
bigbrainiac10 #5
Posted 04 August 2014 - 12:28 PM
Is there any way you could change this or tweak it so that it doesn't require a turtle? they are banned on the server I want to use this on
Unfortunately, he isn't able to make it "turtle-less" since a computer can't handle items by default. BUT I saw someone made a "Computer Item Buffer" a while ago which allowed a computer to push one item at a time.

Actually, this is possible using OpenPeripherals, which I'm assuming will be installed if ComputerCraft and OpenBlocks are installed.

To do this with OpenPeripherals, I believe it's just a method like "pullItem" or "pushItem", it's quite easy to use.