def create_musictrack(mapname: str, beats: list):
    """
    Function for creating musictrack

    :param mapname: MapName
    :param beats: Generated beats
    :returns: Musictrack as dict
    """

    # Creating musictrack
    musictrack: dict = dict(
        __class="Actor_Template",
        WIP=0,
        LOWUPDATE=0,
        UPDATE_LAYER=0,
        PROCEDURAL=0,
        STARTPAUSED=0,
        FORCEISENVIRONMENT=0,
        COMPONENTS=[
            dict(
                __class="MusicTrackComponent_Template",
                trackData=dict(
                    __class="MusicTrackData",
                    structure=dict(
                        __class="MusicTrackStructure",
                        markers=beats,
                        signatures=[
                            dict(
                                __class="MusicSignature",
                                marker=8,
                                beats=4
                            )
                        ],
                        sections=[
                            dict(
                                __class="MusicSection",
                                marker=16,
                                sectionType=4,
                                comments="jdmega is flop"
                            )
                        ],
                        startBeat=0,
                        endBeat=len(beats),
                        videoStartTime=0.0,
                        previewEntry=round(len(beats) / 4),
                        previewLoopStart=round(len(beats) / 3),
                        previewLoopEnd=round(len(beats) / 2),
                        volume=0.0
                    ),
                    path=f"world/maps/{mapname.lower()}/audio/{mapname.lower()}.wav",
                    url="jmcs://jd-contents/{mapname}/{mapname}.ogg"
                )
           )
        ]
    )

    # Returns a musictrack
    return musictrack