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
    output_midi.tracks.append(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
    output_midi.save('out.mid')

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

* {

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

    box-sizing: border-box;

}

body {

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

    color:#fff;

}

h3{

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

}

/* Start  styling the page */

.container-audio {

    width: 66%;

    height: auto;

    padding: px;

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

    color: #444;

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

​

<link href='https://fonts.googleapis.com/css?family=Allerta' rel='stylesheet'>

​

​

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

    <div class="container-audio">

        <audio controls  loop autoplay>

                   <source src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/9473/new_year_dubstep_minimix.ogg" type="audio/ogg">

                   Your browser dose not Support the audio Tag

               </audio>

    </div>

    <div class="container-audio">

        <div class="colum1">

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

        </div>

        <div class="colum1">

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

        </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 = "https://somafm.com/nossl/specials.pls"

# 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
star

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

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

Tue Dec 06 2022 03:49:12 GMT+0000 (Coordinated Universal Time) https://codepen.io/Roro-decode/pen/VWpLRm

#music #player #css
star

Tue Dec 06 2022 03:48:50 GMT+0000 (Coordinated Universal Time) https://codepen.io/Roro-decode/pen/VWpLRm

#music #player #javascript
star

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