Programming language Piano Script

Description of the musical notes programming language Piano Script

Using this program, you can represent musical notes in text format.

The simplest program looks like this:

Type the word C and press F5 to play the note C.

The register of letters does not matter.

You can type the letter C and it will also play the note C.


Program #1. Playing a C Major Scale in Russian:
   
C, D, E, F, G, A, B
        

Program #1.1. Defining Note Durations:
     
octave small
C whole
C 1

C half
C 1/2
C 2

C quarter
C 1/4
C 4

octave first  
C eighth
C 1/8
C 8

C sixteenth
C 1/16
C 16

C thirty second
C 1/32
C 32

//Specifying pauses in milliseconds for increased accuracy
octave second 
C 564
C 121
        

Program #1.2. Defining Octaves and Note Durations:
      
//The number after the note defines the octave. Must be written as one word!

C4 flat whole
C4 1

C5 half
C5 flat 1/2
C5 2

C4 quarter
C4 1/4
C4 4

C1 eighth
C1 flat 1/8
C1 8

C2 sixteenth
C2 sharp 1/16
C2 16

C3 thirty second
C3 1/32
C3 sharp 32

//Specifying pauses in milliseconds for increased accuracy
B0 sharp 564
B0 flat 123
pause whole 
B0 whole

//Here the number 4 denotes a quarter note, not 4 milliseconds.
B0 4
B0 4
B0 4
        

Program #1.3. Defining Pauses:
      
pause whole 
Pause 1

pause half
Pause 1/2
Pause 2

pause quarter 
Pause 1/4
Pause 4

pause eighth
Pause 1/8
Pause 8

pause sixteenth
Pause 1/16
Pause 16

pause thirty second 
Pause 1/32
Pause 32

//Specifying pauses in milliseconds for increased accuracy
Pause 564
Pause 125
        

Program #2. Playing an Italian C Major Scale:
  
do, re, mi, fa, sol, la, si
        

Program #2.1. Playing Sharps and Flats on Italian Notes:
  
do, do bemolle, do diesis, re, mi, fa, sol, la, si
        

Program #3. Playing Notes with Flats and Sharps:
  
//If no note length is specified, each note lasts for a quarter note by default.

octave small
C, C flat, C sharp, D sharp, E, F sharp, G sharp, A sharp, B, B sharp

octave great 
C flat, C, C sharp, D sharp, E, F sharp, G sharp, A sharp, B, B sharp
        

Program #4. Demonstration of Different Note Lengths:
 
volume 127
octave first 

F sharp quarter
G quarter
A quarter
B half

G eighth
G eighth
G quarter
        

Program #5. Chords and Subroutines:

Before using subroutines, they should have their names prefixed with an ampersand (&).

Subroutine names can be anything and don’t affect functionality!

Subroutine names always start with an ampersand (&).

The program searches for subroutine definitions from top to bottom through the entire code.

To avoid errors, use the ampersand only for defining subroutines.

In this example, we are using “T53” for better readability.

This corresponds to a tonic major chord.

Subroutines essentially group notes or motifs.

These groups allow creating melodies and experimenting with compositions more efficiently.

Using these motifs significantly speeds up composition workflow.


//List of notes with subroutine/motif names (&T53).
C whole &T53
E whole &T53
G whole &T53

//Execution starts at keyword START.
Start

//Asterisk (*) means all notes are played simultaneously!
//This creates four consecutive chords consisting of notes C, E, G.
T53*, T53*, T53*, T53*

//Without asterisk (*), notes are played sequentially.
T53

//Execution ends at END keyword.
End
        

Program #5.1. Same Logic Without Comments:

C whole &T53
E whole &T53
G whole &T53

Start

T53*, T53*, T53*, T53*
T53

End
        

Program #6. Arpeggios:
  
//Note duration 100 equals sound time in milliseconds.
//In this case, very fast playing.

C 100 &T53
E 100 &T53
G 100 &T53

Start

//Play arpeggio six times.
T53, T53, T53, T53, T53, T53

//Playing chords six times.
T53*, T53*, T53*, T53*, T53*, T53*

//Simply playing individual notes.
C whole, E whole, G whole

//Slow down execution with TEMPO command.
Tempo 10.0
T53*

//Speed up execution with TEMPO command.
Tempo 1.0
T53*

End
        

Program #7. Composition Tempo Adjustment:
  
//Example of changing tempo.

//Value 2 slows down playback exactly two-fold.
//Value 0.5 increases speed exactly two-fold.

//Higher numbers mean slower playback.
//Lower numbers mean faster playback.

Tempo 2.0
C, D, E, F, G, A, B

Tempo 0.5
C, D, E, F, G, A, B
        

Program #8. Mozart's Symphony No. 40 Opening Example:
  
D sharp 4 &motiv1
D       4 &motiv1
D       2 &motiv1

B flat  4 &motiv2
A       4 &motiv2
G       2 &motiv2

G       4 &motiv3
F       4 &motiv3
D sharp 2 &motiv3

D sharp 4 &motiv4
D       4 &motiv4
C       2 &motiv4
C       2 &motiv4

Start

Volume 127
Octave First
Tempo 0.7

motiv1, motiv1, motiv1
B flat whole

motiv2
motiv3
motiv4

Pause 400

Volume 120

motiv1, motiv1, motiv1
B flat whole

motiv2
motiv3
motiv4

End
        

Program #8.1. Mozart's Symphony No. 40 Opening Example:
  
//To reduce file size, notes were placed in external file n.txt.
include c:\1\n.txt

Start

Volume 127
Octave First
Tempo 0.7

motiv1, motiv1, motiv1
B flat whole

motiv2
motiv3
motiv4

Pause 400

Volume 120

motiv1, motiv1, motiv1
B flat whole

motiv2
motiv3
motiv4

End
        

Download video showing how the program works

Download Video

Key Features of the Program

Contact information

Email: admin@pianoscript.ru

Backup website - pianoscript.ru