Skip to content

An avatar script for Figura that lets you play ABC Music Files in Minecraft.

Notifications You must be signed in to change notification settings

charliemikels/figura-music-player

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tanner Limes' Music Player for Figura

Figura is a Minecraft mod that lets you completely customize your avatar with custom models and Lua scripts.

This repo is a Figura avatar that lets you play ABC music in Minecraft for you and others to hear. It's inspired by Starbound's instrument items.

DemoVideo.mp4

Installation

This version of this script was built for Figura 0.1.4 and makes use of the new files api. Check the Github releases for versions compatable with older versions of Figura.

Use the green code button to download this repo as a zip file. Then navigate to your Figura avatars folder, make a sub-folder there for this avatar, and then extract the zip into that folder.

The file structure should look like this:

[[ Figura root ]]
├ avatars
│ └ Music Player   ← This folder can have any name
│   ├ avatar.json
│   ├ scripts
│   │ ├ abc_player
│   │ │ ├ abc_player.lua
│   │ │ ├ anchor.bbmodel
│   │ │ └ triangle_sin.ogg
│   │ └ Action Wheel.lua
│   └ …
│
└ data
  ├ TL_Songbook
  │ ├ optional_sub_dir
  │ │ └ organized_song.abc
  │ ├ song2.abc
  │ └ song*.abc
  └ …
If you don't know where the root Figura folder is, you can get to it through Minecraft
  1. Open Minecraft.
  2. Open the Figura menu.
  3. Click the folder icon in the upper left.
    This should open your file browser.
  4. Navigate up one folder.
    You should see your avatar folder here.
  5. Open or create the data folder.
  6. Your destination is on the left.

Adding Songs

After you've added the avatar, launch minecraft and load the avatar at least once. The avatar will atempt to create a songbook folder for you in Figura's data directory.

The default songbook location is in [figura_root]/data/TL_Songbook, but you can change the path by editing songbook_root_file_path at the top of the abc_player.lua file.

After finding the songbook folder, place your .abc files into this folder. You can also use sub-folders to help organize your files.

ABC Files

Currently, this avatar only supports songs written in the ABC music format. You can find ABC files online, (they're used frequently in the Starbound and Lord of the Rings Online communities.) or you can convert more common Midi files to ABC if you have the tools.

If you plan on converting your own ABC files from Midi tracks, I recommend Starbound Composer, if you happen to have Starbound installed. But you don't need to have Starbound installed to use SBC. Starbound Composer will ask you to point to your Starbound install folder, but you can actually trick it pretty easily by pointing it to a folder with this structure:

target folder
├ assets
│ └ packed.pak     ← renamed empty file
└ win32
  └ starbound.exe  ← renamed empty file

Without the actual Starbound assets, you won't be able to preview your songs, but you will still be able to convert them from Midi to ABC, and you'll even be able to merge multiple tracks/files into a single ABC file.

  1. Select all tracks. (Deselect track 10, it's allways percussion.)
  2. Click the blue merge button.
  3. Delete the old tracks.
  4. Save the new merged track to abc.
  5. If you have a percussion track, save it as a seperate file, and append - Drums to the end of the filename (immediatly before the .abc file extension). (Include the leading space in - Drums.)

If SBC won't work for you, you can try your hand at this mega list of software for ABC files, some of them say they can convert ABC files to and from Midi files, however a lot of them just point to dead links. I haven't found one I really like yet. Your mileage may vary.

Note that this script is not fully compatable with the .abc spec. It's close, but there are some abc features that will confuse it. This script was primaraly created with Starbound Composer in mind, and has pretty good compatability with this specific editor.

In Game Usage

The controls for this avatar are in their own Action Wheel page. Open the Action Wheel and click the jukebox to access the song player controls. You should new see 3 buttons:

Back

  • Left click sends you back to the previous Action Wheel page

Select Chloe Piano

ChloeSpacedOut made this awesome piano avatar. You can punch the keys to play notes, but you can also play songs through the piano with this script.

  • Left click while looking at a piano to target the piano. Future notes will play through the piano instead of this avatar's built in instrument.
    • Be sure to aim at the player head of the piano. It's much smaller than the piano itself, near the peddles.
  • Left click while not looking at a piano will deselect the current piano. Future notes will go back to the built in instrument.

Piano

Due note that piano support is not fully stable yet. There are a few edge cases that still need to be checked. If you encounter a crash, reload your avatar and the piano.

Song list

This is where all the important magic happens

The text window for this button displays some important info:

+-----------------------------------------+
| Songlist 9/30 Currently Playing: Song 6 |   ← Selected Song index
|     Song 5                              |   ↑ Currently playing song name
| ♬   Song 6                              |   ← Playing song marked by ♬
|     Song 7                              |
|   → Song 8                              |   ← Selected song marked by →
| •   Song 9                              |   ← Queued song marked by •
|     Song 10                             |   
|     Song 11                             |
| Click to queue selected song            |   ← Left click action hint
| Queued song starts in 2 seconds         |   ← Queued song's buffer time
+-----------------------------------------+
  • Scroll to navigate the song list
  • Shift+Scroll to navigate the list faster
  • Left click a song to queue it.
    • "Queuing" a song will load it from disk, chop it up into instructions, and will turn the instructions into packets, ready to be sent to the listener.
  • Left click a queued song to start playing it.
  • Left click on a queued song while another song is playing to stop the currently playing song.
    • (This also works if the queued song is also the playing song.)
  • Right click when not playing a song to enter Slow Mode. The script is tuned to stay under the ping limit at all times. But there are several cases where the actual ping limit is lower than expected. Slow Mode significantly reduces ping size and ping rate to stay under more restrictive ping limits.

FAQ

How can I get the piano?

You can give yourself one of Chloe's pianos using this command: /give @s player_head{SkullOwner:{Id:[I;-1808656131,1539063829,-1082155612,-209998759]}}. But make sure you increase it's permission level in your Figura settings. (You will need to show disconnected avatars to find it.)

Check out the Piano's github page for the actual avatar files.

Who's Charlie? I thought you were Tanner? (and vice versa)

Tanner_Limes is my Minecraft username. Hi Discord people!

Why do some songs make me wait a very long time before they play?

There are two main cases where this can happen. Very large songs take a long time to parce into instructions. This usualy makes minecraft freeze and has a chance to make your client "time out" in singleplayer. Very fast songs can out-pace the ping-limit, so they need time to buffer first.

About

An avatar script for Figura that lets you play ABC Music Files in Minecraft.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages