Author Topic: PSTune - a easy way to create music  (Read 417 times)

Sajut

  • Traveller
  • *
  • Posts: 36
    • View Profile
PSTune - a easy way to create music
« on: September 30, 2013, 05:32:04 pm »
I wrote a little script to create music for planeshift without starting the client. And also without clicking around in the editor ;)
Its hopfully an fast an easy way to bring new music to planeshift.

The "translator" is written in PHP so you need a working php installation. If you like i can build an online converter.

short syntax overview:
comment line = !
note = [b/#]<pitch><octave>-<duration>[.]
chord = ([b/#]<pitch><octave> [b/#]<pitch><octave> ...)-<duration>[.]
pause = p<duration>
repeat start = RS
repeat end = R<repertitions>
Duration is "1" for whole note, "2" for half note, "4" for quarter note, "8" for eighth note, "16" for sixteenth note.

the file structure
1. line -> Title
2. line -> <tonality> <beat> <BPM>
3. line -> measure 1.
4. line -> measure 2.
... line -> measure ...
99. line -> measure 99.

Download (including a detailed description and two examples): http://files.sajut.de/pstune.zip.

One of the examples:
Quote
! !=Comment
!Title
rocky road
!tonality, beat, tempo
2 9/8 120
!begin
rs d5-8 f5-8 d5-8 c5-4 h4-8 a4-4 a4-8
e4-4 a4-8 a4-4 a4-8 h4-8 c5-8 d5-8
e5-8 f5-8 e5-8 d5-4 h4-8 a4-4 c5-8
h4-4 a4-8 g4-4 a4-8 h4-8 c5-8 d5-8 r1
!
rs e5-4 a5-8 a5-4 f5-8 g5-4 h5-8
e5-4 a5-8 a5-4 a4-8 h4-8 c5-8 d5-8
e5-4 a5-8 a5-4 f5-8 f5-4 e5-8
d5-4 h4-8 g4-4 a4-8 h4-8 c5-8 d5-8
!
e5-4 a5-8 a5-4 f5-8 g5-4 d5-8
e5-4 a5-8 a5-4 a4-8 h4-8 c5-8 d5-8
e5-8 f5-8 g5-8 f5-8 g5-8 a5-8 g5-8 f5-8 e5-8
d5-4 h4-8 g4-4 a4-8 h4-8 c5-8 d5-8
!
e5-8 c5-8 a4-8 e5-8 c5-8 a4-8 a4-4 a5-8
e5-8 c5-8 a4-8 e5-8 c5-8 g4-8 h4-8 c5-8 d5-8
e5-8 c5-8 a4-8 e5-8 c5-8 a4-8 a5-4 c5-8
e5-4 h4-8 g4-4 a4-8 h4-8 c5-8 d5-8
!
e5-8 c5-8 a4-8 e5-8 c5-8 a4-8 a4-4 a5-8
e5-8 c5-8 a4-8 e5-8 c5-8 g4-8 h4-8 c5-8 d5-8
e5-8 f5-8 g5-8 f5-8 g5-8 a5-8 g5-8 f5-8 e5-8
e5-4 h4-8 g4-4 a4-8 h4-8 c5-8 d5-8 r1

and the generated xml file.
http://files.sajut.de/rocky_road.xml


P.S.: The code is ready to use but might have some bugs. Please report them  :)

Gilrond

  • Hydlaa Notable
  • *
  • Posts: 764
    • View Profile
Re: PSTune - a easy way to create music
« Reply #1 on: September 30, 2013, 05:57:38 pm »
If you can, better rewrite it in some standalone language (Ruby, Python etc.), to make the script more accessible.

Sajut

  • Traveller
  • *
  • Posts: 36
    • View Profile
Re: PSTune - a easy way to create music
« Reply #2 on: September 30, 2013, 06:09:23 pm »
I can try it with c, but it would take some time....

LigH

  • Forum Legend
  • *
  • Posts: 7096
    • View Profile
Re: PSTune - a easy way to create music
« Reply #3 on: October 01, 2013, 07:41:45 am »
It may not be hard to write a little HTML form user interface around it, for someone with access to a web server...

Gag Harmond
Knight and Ambassador
The Royal House of Purrty

Sajut

  • Traveller
  • *
  • Posts: 36
    • View Profile
Re: PSTune - a easy way to create music
« Reply #4 on: October 01, 2013, 05:53:19 pm »
It may not be hard to write a little HTML form user interface around it, for someone with access to a web server...

http://pstune.sajut.de/index.php should do the job ;)

Eonwind

  • Developers
  • Hydlaa Notable
  • *
  • Posts: 815
    • View Profile
Re: PSTune - a easy way to create music
« Reply #5 on: October 02, 2013, 03:21:04 am »
Nice job Sajut ;)

A little news from the development team: Lucubro (our awesome music man :D ) is back again and is partly rewriting the music plugin, in the the future fixes the engine will be more compatible with the standard music XML format.

Gilrond

  • Hydlaa Notable
  • *
  • Posts: 764
    • View Profile
Re: PSTune - a easy way to create music
« Reply #6 on: October 03, 2013, 12:04:44 am »
Eonwind: That's great! Standards are here exactly to avoid making convertors :)