Snippets Collections
import mido
import random

def generate_notes(notes_len):
    notes = []
    for i in range(notes_len):
        notes.append(random.randint(0, 127))

    return notes

def create_midi_file(notes):
    output_midi = mido.MidiFile()
    # create a track 
    track = mido.MidiTrack()
    # add track

    # write notes
    for note in notes:
        track.append(mido.Message('note_on', note = note, velocity=64, time = 120))
        track.append(mido.Message('note_off', note = note, velocity=64, time = 120))

    # write midi file'out.mid')

notes = generate_notes(100)
/* Global Reset */

* {

    font-family: 'Allerta', arial, Tahoma;

    box-sizing: border-box;


body {

    background: linear-gradient(to left, #7700aa, #800ff);




    text-shadow:1px 1px 1px #fff;


/* Start  styling the page */

.container-audio {

    width: 66%;

    height: auto;

    padding: px;

    border-radius: 5px;
    background-color: #eee;

    color: #444;

    margin: 20px auto;
<!-- Called of font style  file -->


<link href='' rel='stylesheet'>



    <h2>Wellcome to Rofa Music store</h2>

    <div class="container-audio">

        <audio controls  loop autoplay>

                   <source src="" type="audio/ogg">

                   Your browser dose not Support the audio Tag



    <div class="container-audio">

        <div class="colum1">

            <div class="row"></div>


        <div class="colum1">

            <div class="row"></div>


        <div class="colum1">
This example streams a playlist (.pls file) from an internet URL.

import vlc

# URL to the .pls (playlist) file
playlist_url = ""

# create a VLC instance and pass any VLC arguments you want to the new instance
# --intf dummy  is a dummy interface and this is used to run VLC in a headless mode
instance = vlc.Instance('--intf dummy')

player = instance.media_list_player_new()  # create a "media list" player for use with playlists

media = instance.media_list_new(playlist_url)  # create the media instance for the playlist

player.set_media_list(media)  # set what media instance you want to play

player.start()  # start the stream

player.pause()  # pause the stream

player.stop()  # stop the stream

Sat Apr 13 2024 19:42:26 GMT+0000 (Coordinated Universal Time)

##python #coding #python #midi #music #audio

Tue Dec 06 2022 03:49:12 GMT+0000 (Coordinated Universal Time)

#music #player #css

Tue Dec 06 2022 03:48:50 GMT+0000 (Coordinated Universal Time)

#music #player #javascript

Mon Jan 31 2022 02:15:00 GMT+0000 (Coordinated Universal Time)

#python #music

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension