est un script qui joue des notes de musiques sur le haut paleur du pc.
.\gadget-piano
°joue un petit air de musique
.\gadget-piano "2A" 5000
°joue un La 5 secondes
.\gadget-piano (("1F# Z ")*5) 300
°joue un Fa dièse et un silence 5 fois
.\gadget-piano "1A 1B 1C 3A 3B 3C" 150 50
°joue une séquence de notes, chacune jouée 150 ms avec un interval de
50 ms
* gadget-morse.ps1 *
est un script de démo utilisant gadget-piano.ps1.
Il joue des chaînes en Morse.
.\gadget-morse
°joue une démo
.\gadget-morse -verbose
°joue une démo et retourne les mots et le code Morse
.\gadget-morse "Hello world" -verbose
°joue "Hello world" en Morse et retourne les mots et le code Morse
.\gadget-morse "Hello world" 70 "1G"
°joue "Hello world" avec un Ti d'unee longeur de 70 ms et un Si
pour jouer les Ti et Ta
Voir les commentaires dans les scripts pour plus de précisions.
#=9/2006===================================Version 0==========# #=========== "human hearable" string music notes ============# # # To use : # # -music paremeter is a string containing music notes separated # by a space. # # A simplified abc notation is used. # A music note begins with the keyboard's ocatve used (1, 2 or 3) # followed by a character music note (from C to B) + eventually # a # character indicating an half tone higher (sharp), so : # # 2F# is music note F sharp played on the second piano # keyboard's octave. # # Values allowed for notes : # C,C#,D,D#,E,F,F#,G,G#,A,A# and B # preceded by 1,2 or 3 # # A silence is marked with a Z. # # -black is the duration in millisecond a note is played # default 0 # # -tempo is the duration between notes in milliseconds # default0 # # To test : # # .gadget-piano # °plays a little music # .gadget-piano "2A" 5000 # °plays a A note 5 seconds ... to tune your Stradivarius # .gadget-piano (("1F# Z ")*5) 300 # °plays a F sharp and a silence 5 times # .gadget-piano "1A 1B 1C 3A 3B 3C" 150 50 # °plays a sequence of notes, each one played 150 ms with # an interval of 50 ms # # NOTE : # # You must have a pc speaker present and enabled # to hear something :-) # #========Tested on PowerShell 1 RC2===========================#
param( [string]$music='2C 2D 2E 2G 2F 2F 2A 2G 2G 3C 2B 3C 2G 2E 2C', [int]$black 0, [int]$tempo0 )
#=9/2006===================================Version 0==========#
#=========== "human hearable" string music notes ============#
#
# To use :
#
# -music paremeter is a string containing music notes separated
# by a space.
#
# A simplified abc notation is used.
# A music note begins with the keyboard's ocatve used (1, 2 or 3)
# followed by a character music note (from C to B) + eventually
# a # character indicating an half tone higher (sharp), so :
#
# 2F# is music note F sharp played on the second piano
# keyboard's octave.
#
# Values allowed for notes :
# C,C#,D,D#,E,F,F#,G,G#,A,A# and B
# preceded by 1,2 or 3
#
# A silence is marked with a Z.
#
# -black is the duration in millisecond a note is played
# default 0
#
# -tempo is the duration between notes in milliseconds
# default0
#
# To test :
#
# .gadget-piano
# °plays a little music
# .gadget-piano "2A" 5000
# °plays a A note 5 seconds ... to tune your Stradivarius
# .gadget-piano (("1F# Z ")*5) 300
# °plays a F sharp and a silence 5 times
# .gadget-piano "1A 1B 1C 3A 3B 3C" 150 50
# °plays a sequence of notes, each one played 150 ms with
# an interval of 50 ms
#
# NOTE :
#
# You must have a pc speaker present and enabled
# to hear something :-)
#
#========Tested on PowerShell 1 RC2===========================#
param(
[string]$music='2C 2D 2E 2G 2F 2F 2A 2G 2G 3C 2B 3C 2G 2E 2C',
[int]$black 0,
[int]$tempo0
)
#=9/2006===================================Version 0==========# #=========== "human hearable" string music notes ============# # # To use : # # -music paremeter is a string containing music notes separated # by a space. # # A simplified abc notation is used. # A music note begins with the keyboard's ocatve used (1, 2 or 3) # followed by a character music note (from C to B) + eventually # a # character indicating an half tone higher (sharp), so : # # 2F# is music note F sharp played on the second piano # keyboard's octave. # # Values allowed for notes : # C,C#,D,D#,E,F,F#,G,G#,A,A# and B # preceded by 1,2 or 3 # # A silence is marked with a Z. # # -black is the duration in millisecond a note is played # default 0 # # -tempo is the duration between notes in milliseconds # default0 # # To test : # # .gadget-piano # °plays a little music # .gadget-piano "2A" 5000 # °plays a A note 5 seconds ... to tune your Stradivarius # .gadget-piano (("1F# Z ")*5) 300 # °plays a F sharp and a silence 5 times # .gadget-piano "1A 1B 1C 3A 3B 3C" 150 50 # °plays a sequence of notes, each one played 150 ms with # an interval of 50 ms # # NOTE : # # You must have a pc speaker present and enabled # to hear something :-) # #========Tested on PowerShell 1 RC2===========================#
param( [string]$music='2C 2D 2E 2G 2F 2F 2A 2G 2G 3C 2B 3C 2G 2E 2C', [int]$black 0, [int]$tempo0 )
#/2006==================================Version 0==========# #================ plays a string in Morse ==================# # # *This script needs script gadget-piano.ps1 in its directory # to work properly* # # To use : # # -text paremeter is a string containing the string to play. # # -dit paremeter is the duration in milliseconds of a "dit" # default` # # -note paremeter is the (string) note used to play "dit" and # "dah" Morse sounds # default: # # -verbose switch writes words and Morse code in console. # # To test : # # .gadget-morse # °plays a demo string # .gadget-morse -verbose # °plays a demo string and outputs words and Morse code # .gadget-morse "Hello world" -verbose # °plays "Hello world" in Morse and outputs words and code # .gadget-morse "Hello world" 70 "1G" # °plays "Hello world" with a Dit length of 70 ms and a G # note to play Dit and Dah # # gadget-morse.ps1 is a demo script reusing this one # # NOTE : # # You must have a pc speaker present and enabled # to hear something :-) # #========Tested on PowerShell 1 RC2===========================#
param( [string]$text='PowerShell is powerful', [int32]$dit`, [string]$note='3A', [switch]$verbose )
#/2006==================================Version 0==========#
#================ plays a string in Morse ==================#
#
# *This script needs script gadget-piano.ps1 in its directory
# to work properly*
#
# To use :
#
# -text paremeter is a string containing the string to play.
#
# -dit paremeter is the duration in milliseconds of a "dit"
# default`
#
# -note paremeter is the (string) note used to play "dit" and
# "dah" Morse sounds
# default:
#
# -verbose switch writes words and Morse code in console.
#
# To test :
#
# .gadget-morse
# °plays a demo string
# .gadget-morse -verbose
# °plays a demo string and outputs words and Morse code
# .gadget-morse "Hello world" -verbose
# °plays "Hello world" in Morse and outputs words and code
# .gadget-morse "Hello world" 70 "1G"
# °plays "Hello world" with a Dit length of 70 ms and a G
# note to play Dit and Dah
#
# gadget-morse.ps1 is a demo script reusing this one
#
# NOTE :
#
# You must have a pc speaker present and enabled
# to hear something :-)
#
#========Tested on PowerShell 1 RC2===========================#
param(
[string]$text='PowerShell is powerful',
[int32]$dit`,
[string]$note='3A',
[switch]$verbose
)
#/2006==================================Version 0==========# #================ plays a string in Morse ==================# # # *This script needs script gadget-piano.ps1 in its directory # to work properly* # # To use : # # -text paremeter is a string containing the string to play. # # -dit paremeter is the duration in milliseconds of a "dit" # default` # # -note paremeter is the (string) note used to play "dit" and # "dah" Morse sounds # default: # # -verbose switch writes words and Morse code in console. # # To test : # # .gadget-morse # °plays a demo string # .gadget-morse -verbose # °plays a demo string and outputs words and Morse code # .gadget-morse "Hello world" -verbose # °plays "Hello world" in Morse and outputs words and code # .gadget-morse "Hello world" 70 "1G" # °plays "Hello world" with a Dit length of 70 ms and a G # note to play Dit and Dah # # gadget-morse.ps1 is a demo script reusing this one # # NOTE : # # You must have a pc speaker present and enabled # to hear something :-) # #========Tested on PowerShell 1 RC2===========================#
param( [string]$text='PowerShell is powerful', [int32]$dit`, [string]$note='3A', [switch]$verbose )
#=9/2006===================================Version 1==========# #=========== "human hearable" string music notes ============# # # To use : # # -music paremeter is a string containing music notes separated # by a space. # # A simplified abc notation is used. # A music note begins with the keyboard's ocatve used (1, 2 or 3) # followed by a character music note (from C to B) + eventually # a # character indicating an half tone higher (sharp), so : # # 2F# is music note F sharp played on the second piano # keyboard's octave. # # Values allowed for notes : # C,C#,D,D#,E,F,F#,G,G#,A,A# and B # preceded by 1,2 or 3 # # A silence is marked with a Z. # # To multiply a note duration, ie $black*2 : 3C2 # To divide a note duration, ie $black/4 : 3C/4 # # -black is the duration in millisecond a note is played # default 0 # # -tempo is the duration between notes in milliseconds # default0 # # To test : # # .gadget-piano # °plays a little music # .gadget-piano "2A" 5000 # °plays a A note 5 seconds ... to tune your Stradivarius # .gadget-piano (("1F# Z ")*5) 300 # °plays a F sharp and a silence 5 times # .gadget-piano "1A 1B 1C 3A 3B 3C" 150 50 # °plays a sequence of notes, each one played 150 ms with # an interval of 50 ms # # NOTE : # # You must have a pc internal speaker present and enabled # to hear something :-) # #========Tested on PowerShell 1 RC2===========================#
param( [string]$music='2C 2D 2E 2G 2F 2F 2A 2G 2G 3C 2B 3C 2G 2E 2C', [int]$black 0, [int]$tempo0 )
#=9/2006===================================Version 1==========#
#=========== "human hearable" string music notes ============#
#
# To use :
#
# -music paremeter is a string containing music notes separated
# by a space.
#
# A simplified abc notation is used.
# A music note begins with the keyboard's ocatve used (1, 2 or 3)
# followed by a character music note (from C to B) + eventually
# a # character indicating an half tone higher (sharp), so :
#
# 2F# is music note F sharp played on the second piano
# keyboard's octave.
#
# Values allowed for notes :
# C,C#,D,D#,E,F,F#,G,G#,A,A# and B
# preceded by 1,2 or 3
#
# A silence is marked with a Z.
#
# To multiply a note duration, ie $black*2 : 3C2
# To divide a note duration, ie $black/4 : 3C/4
#
# -black is the duration in millisecond a note is played
# default 0
#
# -tempo is the duration between notes in milliseconds
# default0
#
# To test :
#
# .gadget-piano
# °plays a little music
# .gadget-piano "2A" 5000
# °plays a A note 5 seconds ... to tune your Stradivarius
# .gadget-piano (("1F# Z ")*5) 300
# °plays a F sharp and a silence 5 times
# .gadget-piano "1A 1B 1C 3A 3B 3C" 150 50
# °plays a sequence of notes, each one played 150 ms with
# an interval of 50 ms
#
# NOTE :
#
# You must have a pc internal speaker present and enabled
# to hear something :-)
#
#========Tested on PowerShell 1 RC2===========================#
param(
[string]$music='2C 2D 2E 2G 2F 2F 2A 2G 2G 3C 2B 3C 2G 2E 2C',
[int]$black 0,
[int]$tempo0
)
#=9/2006===================================Version 1==========# #=========== "human hearable" string music notes ============# # # To use : # # -music paremeter is a string containing music notes separated # by a space. # # A simplified abc notation is used. # A music note begins with the keyboard's ocatve used (1, 2 or 3) # followed by a character music note (from C to B) + eventually # a # character indicating an half tone higher (sharp), so : # # 2F# is music note F sharp played on the second piano # keyboard's octave. # # Values allowed for notes : # C,C#,D,D#,E,F,F#,G,G#,A,A# and B # preceded by 1,2 or 3 # # A silence is marked with a Z. # # To multiply a note duration, ie $black*2 : 3C2 # To divide a note duration, ie $black/4 : 3C/4 # # -black is the duration in millisecond a note is played # default 0 # # -tempo is the duration between notes in milliseconds # default0 # # To test : # # .gadget-piano # °plays a little music # .gadget-piano "2A" 5000 # °plays a A note 5 seconds ... to tune your Stradivarius # .gadget-piano (("1F# Z ")*5) 300 # °plays a F sharp and a silence 5 times # .gadget-piano "1A 1B 1C 3A 3B 3C" 150 50 # °plays a sequence of notes, each one played 150 ms with # an interval of 50 ms # # NOTE : # # You must have a pc internal speaker present and enabled # to hear something :-) # #========Tested on PowerShell 1 RC2===========================#
param( [string]$music='2C 2D 2E 2G 2F 2F 2A 2G 2G 3C 2B 3C 2G 2E 2C', [int]$black 0, [int]$tempo0 )