All Projects → Duelr → Play-Notes

Duelr / Play-Notes

Licence: other
A simple Powershell function that lets you write/play songs in musical notation using the Beep() function in windows.

Programming Languages

powershell
5483 projects

Projects that are alternatives of or similar to Play-Notes

penney
Penney's Game
Stars: ✭ 14 (-17.65%)
Mutual labels:  fun
Compare-UserJS
PowerShell script for comparing user.js (or prefs.js) files.
Stars: ✭ 79 (+364.71%)
Mutual labels:  powershell-script
SHA3ImplementedInsideofaRARfile
The Keccak hash algorithm implemented inside of a RAR archive using the RAR filter assembly language
Stars: ✭ 21 (+23.53%)
Mutual labels:  fun
anime-scraper
[partially working] Scrape and add anime episode stream URLs to uGet (Linux) or IDM (Windows) ~ Python3
Stars: ✭ 21 (+23.53%)
Mutual labels:  fun
Create-EXEFromPS1
Takes one PowerShell script and any number of supplementary files or even a directory and creates an exe using Windows's built in iexpress program. The exe will run on any machine with PowerShell 2.0+.
Stars: ✭ 81 (+376.47%)
Mutual labels:  powershell-script
DossyTextLabel
A subclass of UILabel reminiscent of Strong Bad's faithful Tandy 400.
Stars: ✭ 75 (+341.18%)
Mutual labels:  fun
AutomatedOutlookSignature
PowerShell script to automate the creation of Outlook signatures using Active Directory attributes.
Stars: ✭ 36 (+111.76%)
Mutual labels:  powershell-script
EasyBuzzer
The Beep Library For Arduino
Stars: ✭ 63 (+270.59%)
Mutual labels:  beep
honk-twitter-bot
A simple honk twitter bot that reply honk slash command
Stars: ✭ 19 (+11.76%)
Mutual labels:  fun
mediaforge
A Discord bot for editing and creating videos, images, GIFs, and more!
Stars: ✭ 45 (+164.71%)
Mutual labels:  fun
ideal-alligator
PowerShell script to retreive wifi ESSIDs and Passwords.
Stars: ✭ 24 (+41.18%)
Mutual labels:  powershell-script
randmoji
Generate wacky Bitmoji avatars using the private API.
Stars: ✭ 17 (+0%)
Mutual labels:  fun
A-for-apple
No description or website provided.
Stars: ✭ 14 (-17.65%)
Mutual labels:  fun
StarWarsArrays.jl
Arrays indexed as the order of Star Wars movies
Stars: ✭ 93 (+447.06%)
Mutual labels:  fun
arktur
No description or website provided.
Stars: ✭ 38 (+123.53%)
Mutual labels:  fun
PowerShell-WindowsAdmin
A collection of scripts I've created over the years to administer things.
Stars: ✭ 35 (+105.88%)
Mutual labels:  powershell-script
random-restaurant-generator
An Android app that queries Yelp's API for a random restaurant near you
Stars: ✭ 15 (-11.76%)
Mutual labels:  fun
snake
Basic Snake Game in TypeScript
Stars: ✭ 25 (+47.06%)
Mutual labels:  fun
penny
3 servos, 10 dollars hexapod
Stars: ✭ 26 (+52.94%)
Mutual labels:  fun
Drawing
Drawing and fill color
Stars: ✭ 37 (+117.65%)
Mutual labels:  fun

Play-Notes

Description

A simple PowerShell function that lets you write/play songs in musical notation using the Beep() function in windows.

Custom Musical Notation

For each note, the script will split your input into 3 parts.

  • The Pitch
    • C,C#,D,Eb,E,F,F#,G,G#,A,Bb,B
  • The Octave
    • 0,1,2,3,4,5,6,7,8
    • Default = 5
  • The Duration (Or NoteType)
    • W,H,Q,E,S
    • Default = Q

The line for this looks like..

$Note -match '(?<Pitch>[A-G][#|b]?|[R])(?<Octave>[0-8])?(?<NoteType>[Ww|Hh|Qq|Ee|Ss][\.]?)?'

Notes

  • I recommend making a new line for each line in the sheet music you use.
  • No support for tied notes, but you can get creative. ;)
  • I made a few song excepts for y'all to get started!
  • Including -Output for debugging may add a few ms of pause due to Write-Output
  • If you enjoy this silly script and make your own songs, please share them with me!

Usage Examples

Song: Still Alive Excerpt - Portal

Source: https://musescore.com/user/12125/scores/21060

.\Play-Notes.ps1 -Notes "R0H,G6E,F#6E,E6E,E6E,F#6H,R0H,R0Q,R0E,A5E,G6E,F#6E,E6E,E6E,F#6Q.,D6Q,E6E"
.\Play-Notes.ps1 -Notes "A5H,R5E,R0Q.,A5E,E6Q,F#6E,G6Q.,E6E,C#6Q,D6Q.,E6Q,A5E,A5Q,F#6Q.,R0H"
.\Play-Notes.ps1 -Notes "R0H,G6E,F#6E,E6E,E6E,F#6H,R0H,R0Q,R0E,A5E,G6E,F#6E,E6E,E6Q,F#6E,D6Q.,E6E"
.\Play-Notes.ps1 -Notes "A5H,R5E,R0Q.,E6Q,F#6E,G6Q.,E6E,C#6Q.,D6E,E6Q,A5E,D6E,E6E"
.\Play-Notes.ps1 -Notes "F6E,E6E,D6E,C6E,R0Q,A5E,Bb5E,C6Q,F6Q,E6E,D6E,D6E,C6E,D6E,C6E,C6Q,C6Q,A5E,Bb5E"
.\Play-Notes.ps1 -Notes "C6Q,F6Q,G6E,F6E,E6E,D6E,D6E,E6E,F6Q,F6Q,G6E,A6E,Bb6E,Bb6E,A6Q,G6Q,F6E,G6E"
.\Play-Notes.ps1 -Notes "A6E,A6E,G6Q,F6Q,D6E,C6E,D6E,F6E,F6E,E6Q,E6E,F#6E,F#6Q."
.\Play-Notes.ps1 -Notes "A6E,A6E,G6Q,F6Q,D6E,C6E,D6E,F6E,F6E,E6Q,E6E,F#6E,F#6H"
.\Play-Notes.ps1 -Notes "G6E,A6E,A6Q,R0Q,R0E,G6E,F#6E,F#6Q"
.\Play-Notes.ps1 -Notes "G6E,A6E,A6Q,R0Q,R0E,G6E,F#6E,F#6Q"

Song: Overworld Excerpt - Super Mario Brothers

.\Play-Notes.ps1 -Notes "E6E,E6E,R0E,E6E,R0E,A5E,E6E,R0E,G6E,R0E,R0Q,G5E,R0E,R0Q" -Tempo 120

Other examples

All Supported Pitch Frequencies

@('1','2','3','4','','6','7','8') | %{
    .\Play-Notes.ps1 -Notes ("CN,C#N,DN,EbN,EN,FN,F#N,GN,G#N,AN,BbN,BN" -replace '[N]',$_) -Output
}

Limitation of Tempo/Duration

  • There is a fixed amount of time between Beep() calls so you can only go so fast..
@('5') | %{
    $p = $_
    @('S','S.','E','E.','Q','Q.','H','H.','W') | %{
        .\Play-Notes.ps1 -Notes (
            (
                "CNT,C#NT,DNT,EbNT,ENT,FNT,F#NT,GNT,G#NT,ANT,BbNT,BNT" -replace '[N]',$p
            ) -replace '[T]',$_
        ) -Output
    }
}

Attempt at a Multi-Track example using the PoshRsJobs Module

Import-Module PoshRSJob
$Track1 = [pscustomobject]@{
    Name = 'Track1'
    Track = 'R0H,G6E,F#6E,E6E,E6E,F#6H,R0H,R0Q,R0E,A5E,G6E,F#6E,E6E,E6E,F#6Q.,D6Q,E6E,A5H'
}
$Track2 = [pscustomobject]@{
    Name = 'Track2'
    Track = "R0H,G5E,F#5E,E5E,E5E,F#5H,R0H,R0Q,R0E,A4E,G5E,F#5E,E5E,E5E,F#5Q.,D5Q,E5E,A4H"
}
@($Track1,$Track2) | Start-RSJob -Name {$_.Name} -ScriptBlock {
    .\Play-Notes.ps1 $_.Track
} | Get-RSJob | Wait-RSJob
Get-RSJob | Remove-RSJob -Force

Doesn't work sadly.. The Beep() function only lets one beep happen at a time globally.

To any nerds at MSFT reading this, please create a feature request for this please! XD

Or if anyone can figure it out, please share!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].