Dismiss Notice
Wynncraft, the Minecraft MMORPG. Play it now on your Minecraft client at (IP): play.wynncraft.com. No mods required! Click here for more info...

Music Zelda Medley - In Minecraft!

Discussion in 'Your Work' started by (Meric), Dec 19, 2021.

Thread Status:
Not open for further replies.
  1. (Meric)

    (Meric) No longer edgy

    Messages:
    3,194
    Likes Received:
    2,753
    Trophy Points:
    149
    Guild:
    Minecraft:

    Second Demo > https://streamable.com/c2lxty
    I've been working on a little project for some custom sample playback in MC in order to play music fully with samples. I just finished the basic barebones player, However, I don't actually have any instruments sampled for that aside from the piano, so I just quickly whipped together a flute and it sounds pretty good for 10 minutes of work.

    I've also added a basic articulation switching engine that decides to play a long sustain or short staccato note depending on the note length. I chose a pretty bad number for the video demo, but didn't want to re-record to adjust the one number so you'll notice the piano is pretty atrocious sometimes.

    The pops and clicking is still something I'm unsure of on how to fix, in the end I might just change the sampling format to do what I do with NBS (Static note lengths) which would solve that issue but be rather unfortunate since dynamic note lengths just sound so much better.

    Some sections of the song will sound dramatically better than others due to the various technical issues and bugs, so feel free to skip around if you don't want to view the whole thing. I promise the entire song doesn't sound shitty like the start!

    Anyways rant aside. The song as a whole sounds pretty damn good in certain sections, much better than I thought it would as a first test. Still a lot to improve for the engine. Hopefully, it gets better!
     
    Last edited: Dec 20, 2021
  2. fishcute

    fishcute fish CHAMPION Builder

    Messages:
    719
    Likes Received:
    760
    Trophy Points:
    125
    Creator Karma:
    Minecraft:
    That probably means you are ending a note at a peak or trough, so you end up with a rapid change in pressure. Is there any place that you will be sharing source code? I'm curious how this works.
     
  3. (Meric)

    (Meric) No longer edgy

    Messages:
    3,194
    Likes Received:
    2,753
    Trophy Points:
    149
    Guild:
    Minecraft:
    Indeed it always ends on a peak, the sustained notes are a constant volume. Afaik there's really no way to fix this, unfortunately.

    I have a variety of backup plans in place to change the format if this stays an issue though.

    As per source code:
    https://github.com/MericGit/Cobalt

    None of this is really usable at the moment. It's been a learning process so organization is not good, there are a few hard coded file paths since I got lazy, etc.
    I'll do a total re-write at some point so you'll probably have better luck understanding it.


    I'll just do a quick summary of how it works here.

    MidiUtils handles the base midi parser. It's then run through a ton of very inefficient methods with a crazy high O(n) runtime to basically just assign samples to notes. Much of it is pretty understandable, but the one section that you may find confusing is the "rrPoolInterface" and calcRRandOctave.

    Because the program uses /stopsound to end notes, we need to play each sound at a different source so stopsound won't stop every flute note playing for example. The RR Engine just cycles the sound source for samples to make sure that stopsound only ever stops the proper note.
    upload_2021-12-20_16-9-19.png

    For example here under the sample you can see how its playing the note "block.note_block.titan_sus_09_1"
    Basically it's instrument name, articulation type, sample pitch, then the round robin number.

    Here's the resourcepack: https://www.mediafire.com/file/lsw8ypfxq227uxw/Cobalt-Moon.zip/file if you want to try it out.
    If you really want to get it to work let me know and I can walk you through a few steps
     
  4. fishcute

    fishcute fish CHAMPION Builder

    Messages:
    719
    Likes Received:
    760
    Trophy Points:
    125
    Creator Karma:
    Minecraft:
    Wait this is fully serverside (aside from resource pack but that can be forced on the server)? For some reason I thought this was on both client and server.

    The samples being used/when you cut them off might be the issue. Since you are stopping the sounds midway through then a bit of variation in ping from not being on localhost will probably partially solve the issue, but also might make it impossible to fully solve unless you do something weird with NMS and sending packets in between ticks on a separate thread or something?
     
  5. (Meric)

    (Meric) No longer edgy

    Messages:
    3,194
    Likes Received:
    2,753
    Trophy Points:
    149
    Guild:
    Minecraft:
    Nah it's all in a server-side plugin!

    The ping isn't the issue. It's just that the abrupt audio cutout will cause those artifacts.
    [​IMG]

    Stopping the audio on a transient will lead to those pops and harsh noises. Normally applications don't instantly pause, they wait a microscopic amount of time and do some modification to guarantee it stops at a safe time.

    Minecraft doesn't really have any system for doing this so unfortunately, I have no real way of solving this issue at the moment. I'm thinking up some possible solutions but don't have anything on the top of my head right now.

    Worst case scenario is I just record static note lengths of different lengths. (I.E. 1s, 2s, 5,s) so I don't need to stop any audio file, and just let it play out in full.



    Thats what I used to do for my NBS songs and you can hear an example here ^^

    This has it's own drawbacks so hopefully, it won't come to that.
     
  6. (Meric)

    (Meric) No longer edgy

    Messages:
    3,194
    Likes Received:
    2,753
    Trophy Points:
    149
    Guild:
    Minecraft:
    Made a small secondary demo that shows the flute more in isolation:
    https://streamable.com/c2lxty

    (Couple of issues with this one where it seems NOTE_OFF events aren't being registered. Not a huge issue though, song for the most part sounds as intended)
     
  7. fishcute

    fishcute fish CHAMPION Builder

    Messages:
    719
    Likes Received:
    760
    Trophy Points:
    125
    Creator Karma:
    Minecraft:
    What I was referring to was how minor changes in ping could cause the point in the audio recording where it switches to be different (I'd need to look into MCP to check how stopsound packets are handled on the client to confirm this though). This means that it won't necessarily end at the same spot every time.
     
Thread Status:
Not open for further replies.