Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - firiban

Pages: [1] 2
1
Guides and Tutorials / Re: How to use an external music editor
« on: December 26, 2011, 04:34:34 pm »
Yes, i used javascript because it's the language i'm best at, it's cross-platform (node+web, different browsers etc) and i used that DOM API a thousand times in web-related stuff. I know Rosegarden can do the converting as well, i just mentioned it to compare musescore to the ingame editor.

Edit: I updated the script, it should now support files created with Rosegarden.

2
Guides and Tutorials / Re: How to use an external music editor
« on: December 26, 2011, 03:42:44 pm »
You're right, this is not compatible with every editor, but personally i still prefer MuseScore over the ingame editor, since it supports midi keyboard input and is far less buggy and more intuitive. Also, Musescore can import midi files and convert them and so on.
I had a look at rosegarden, and it seems that you have to add
Code: [Select]
<fifths>0</fifths>to the <attributes> section manually in the original musicxml file to make the converter work.

3
Guides and Tutorials / How to use an external music editor
« on: December 26, 2011, 01:20:24 pm »
Hi there!

Since the ingame notation editor is somewhat painful to use, i wrote a script which converts standard MusicXML to a PlaneShift compatible format (PS uses a subset of MusicXML). I'm not claiming this will work for everyone with every MusicXML file, but it works for me and i thought i'd share it.

-- Edit: There's now an easier method that does not require node.js, see below --

1) Software needed
First, you need a notation editor which can write MusicXML files. Personally, i use MuseScore. Then, you'll need node.js and the jsdom library. On Linux, you can install jsdom with
Code: [Select]
npm install jsdomafter installing node.js. Node's npm package manager is kind of weird and i haven't completely figured out when node considers something to be installed and when not :|

2) The script
Copy the following into a file called converter.js in your musicalsheets directory (on Linux it's ~/.PlaneShift/musicalsheets/)
Code: [Select]
#!/usr/bin/env node

var jsdom = require("jsdom");
var fs = require('fs');


console.log("MusicXML to PlaneShift converter by Firiban - version 0.2");
console.log("parsing file "+process.argv[2]+"...");
// read file, parse it, create outfile with header
var infile = jsdom.jsdom(fs.readFileSync(process.argv[2], "utf8"));
var outfile = '<score-partwise version="2.0"><part-list><score-part id="P1"><part-name>'+process.argv[2].substr(0,process.argv[2].length-4)+'</part-name></score-part></part-list><part id="P1">';
var measures = infile.getElementsByTagName("measure");
console.log("Sorting the stuff...");

// This loop does the work: Iterates through the measures and copies the important stuff (read: "PlaneShift compatible tags") to outfile
var i=1;
var j=0;
var k=0;
var l=0;
var alter=0;
var duration=1;
var multiplier=1;
for (var i=0;i<measures.length;i++) {
outfile += '<measure number="'+(i+1)+'">';
if (i==0) {
multiplier = (4 / infile.getElementsByTagName("divisions")[0].childNodes[0].__nodeValue);
outfile += '<attributes><divisions>4</divisions><key><fifths>'+((infile.getElementsByTagName("fifths").length>0)?infile.getElementsByTagName("fifths")[0].childNodes[0].__nodeValue:"0")+'</fifths></key><time><beats>'+infile.getElementsByTagName("beats")[0].childNodes[0].__nodeValue+'</beats><beat-type>'+infile.getElementsByTagName("beat-type")[0].childNodes[0].__nodeValue+'</beat-type></time></attributes><direction>';
if (infile.getElementsByTagName("sound").length>0) {
outfile += '<sound tempo="'+infile.getElementsByTagName("sound")[0].attributes[0].value+'"/>';
} else {
outfile += '<sound tempo="90"/>';
}
outfile += "</direction>";
}
//console.log(measures[i]);
for (j=0;j<measures[i].children.length;j++) {
// we only need the notes, no stupid <print> stuff or text nodes (whitespaces/tabs/newlines etc.)
if (measures[i].children[j].tagName=="NOTE") {
outfile +="<note>";
duration=1;
// iterate through note's parameters and copy the neccessary ones (sort out <stem> etc., since they are not used by PS)
for (k=0;k<measures[i].children[j].children.length;k++) {
if (measures[i].children[j].children[k].tagName=="REST") {
outfile += "<rest/>";
} else if (measures[i].children[j].children[k].tagName=="CHORD") {
outfile += "<chord/>";
} else if (measures[i].children[j].children[k].tagName=="DURATION") {
duration = measures[i].children[j].children[k].textContent;
} else if (measures[i].children[j].children[k].tagName=="PITCH") {
outfile += "<pitch>";
alter = 0;
for (l=0;l<measures[i].children[j].children[k].children.length;l++) {
if ((measures[i].children[j].children[k].children[l].tagName=='STEP') || (measures[i].children[j].children[k].children[l].tagName=='OCTAVE')) {
outfile += "<"+measures[i].children[j].children[k].children[l].tagName.toLowerCase()+">"+measures[i].children[j].children[k].children[l].textContent+"</"+measures[i].children[j].children[k].children[l].tagName.toLowerCase()+">";
} else if (measures[i].children[j].children[k].children[l].tagName=='ALTER') {
alter = measures[i].children[j].children[k].children[l].textContent;
}
}
outfile += "<alter>"+alter+"</alter></pitch>";
}
}
outfile += "<duration>"+duration*multiplier+"</duration>";
outfile +="</note>";
}
}
outfile += '</measure>';
}

// close outfile and write it
outfile += '</part></score-partwise>';
fs.writeFileSync("PS-"+process.argv[2],outfile);
console.log("Done. Your PlaneShift-compatible music is now in PS-"+process.argv[2]+" . Enjoy! :)");
Save the file and make it executable. (chmod +x ./converter.js in a terminal)

3) Write some music
Well, open MuseScore and create a new sheet with one voice. Use flute or guitar or some other non-transposing one-staff instrument. There are some things which are not supported by PlaneShift, so you shouldn't use them in your composition:
  • Polyrhythm (e.g. whole note chord with quarter note melody above it)
  • I haven't tested key signatures different from C major/A minor (but single #s and bs should work)
  • tied notes
Be sure there's a time signature at the beginning of your piece, otherwise the script will fail.
You may add a tempo definition, otherwise, it will use 90BPM.

4) Make your song PlaneShift compatible
Save your composition as MusicXML (not compressed MusicXML) in your musicalsheets directory. Then let the script convert it. On Linux, open in a terminal and do
Code: [Select]
./converter.js yoursong.xml(converter.js and yoursong.xml should both be in musicalsheets, and yoursong.xml should be the filename you used for your song :P)
You'll now get a file called PS-song.xml which you can put in your musicalsheets directory and open with the ingame editor. Have fun! :)


Known Bugs: In the ingame editor, only the first measure of the converted piece is shown, but everything is played. If anyone can tell me how to fix this, please do so.


If you have any questions, please post them here (though i might not be able to help you, depending on your problem :P).

Happy composing :)
Firiban


Easier method

1) Create a file called converter.html with the following content
Code: [Select]
<html>
<head>
</head>
<body>
<h1>MusicXML to PlaneShift converter by Firiban - version 0.2</h1>
<form name="convert" action="#" method="get">
<textarea name="code" cols="100" rows="30"></textarea>
<br />
<input type="button" value="Convert!" name="startme" />
</form>
<script type="application/x-javascript">
// NOTE: This is just the web browser compatible port of the original converter.js
document.forms.convert.startme.onclick = function () {
console.log("MusicXML to PlaneShift converter by Firiban - version 0.2");
console.log("parsing file input...");
// read file, parse it, create outfile with header
if (window.DOMParser) {
var infile = (new DOMParser()).parseFromString(document.forms.convert.code.value,"text/xml");
}
else {
alert ("Incompatible Browser. Try Firefox.");

var outfile = '<score-partwise version="2.0"><part-list><score-part id="P1"><part-name>converted stuff</part-name></score-part></part-list><part id="P1">';
var measures = infile.getElementsByTagName("measure");
console.log("Sorting the stuff...");

// This loop does the work: Iterates through the measures and copies the important stuff (read: "PlaneShift compatible tags") to outfile
var i=1;
var j=0;
var k=0;
var l=0;
var alter=0;
var duration=1;
var multiplier=1;
for (var i=0;i<measures.length;i++) {
outfile += '<measure number="'+(i+1)+'">';
if (i==0) {
multiplier = (4 / infile.getElementsByTagName("divisions")[0].childNodes[0].textContent);
outfile += '<attributes><divisions>4</divisions><key><fifths>'+((infile.getElementsByTagName("fifths").length>0)?infile.getElementsByTagName("fifths")[0].childNodes[0].__nodeValue:"0")+'</fifths></key><time><beats>'+infile.getElementsByTagName("beats")[0].childNodes[0].__nodeValue+'</beats><beat-type>'+infile.getElementsByTagName("beat-type")[0].childNodes[0].__nodeValue+'</beat-type></time></attributes><direction>';
if (infile.getElementsByTagName("sound").length>0) {
outfile += '<sound tempo="'+infile.getElementsByTagName("sound")[0].attributes[0].value+'"/>';
} else {
outfile += '<sound tempo="90"/>';
}
outfile += "</direction>";
}
//console.log(measures[i]);
for (j=0;j<measures[i].children.length;j++) {
// we only need the notes, no stupid <print> stuff or text nodes (whitespaces/tabs/newlines etc.)
if (measures[i].children[j].tagName=="note") {
outfile +="<note>";
duration=1;
// iterate through note's parameters and copy the neccessary ones (sort out <stem> etc., since they are not used by PS)
for (k=0;k<measures[i].children[j].children.length;k++) {
if (measures[i].children[j].children[k].tagName=="rest") {
outfile += "<rest/>";
} else if (measures[i].children[j].children[k].tagName=="chord") {
outfile += "<chord/>";
} else if (measures[i].children[j].children[k].tagName=="duration") {
duration = measures[i].children[j].children[k].textContent;
} else if (measures[i].children[j].children[k].tagName=="pitch") {
outfile += "<pitch>";
alter = 0;
for (l=0;l<measures[i].children[j].children[k].children.length;l++) {
if ((measures[i].children[j].children[k].children[l].tagName=='step') || (measures[i].children[j].children[k].children[l].tagName=='octave')) {
outfile += "<"+measures[i].children[j].children[k].children[l].tagName+">"+measures[i].children[j].children[k].children[l].textContent+"</"+measures[i].children[j].children[k].children[l].tagName+">";
} else if (measures[i].children[j].children[k].children[l].tagName=='alter') {
alter = measures[i].children[j].children[k].children[l].textContent;
}
}
outfile += "<alter>"+alter+"</alter></pitch>";
}
}
outfile += "<duration>"+duration*multiplier+"</duration>";
outfile +="</note>";
}
}
outfile += '</measure>';
}

// close outfile and write it
outfile += '</part></score-partwise>';
document.forms.convert.code.value = outfile;
console.log("Done. Enjoy! :)");
}
</script>
</body>
</html>

2) open that file with your web browser. paste the content of your musicxml file there, click convert.

3) save the resulting code to an xml file in your musicalsheets folder and load it with planeshift.


Edit #1: added html method
Edit #2: Fixed bug with accidentals
Edit #3: Added support for adding missing <fifths> tag; now supports Rosegarden

4
Fan Art / Re: [CAC] Blackflame
« on: December 18, 2011, 12:06:08 pm »
my entry:



click on image for higher resolution

5
PlaneShift Mods / Re: Serverpinger
« on: January 29, 2011, 02:17:11 pm »
*Firiban cheers*

great thing thob!

For all those who dont want to type ./serverpinger.py all the time, you can have this script in a shiny and tiny screenlet (http://www.screenlets.org/), which displays the server status on your desktop.


May look like this in the end

1 install Screenlets (linux users → package manager of your distro | windows and mac users → go crying)

2 activate the screenlet called "Output"

3 right-click on that screenlet → Properties → Options → Options

4 "Command to run": /whereever/you/put/the/serverpinger.py (make sure the file is executable)

5 Click Apply

6 "Update interval seconds": Something that does not DDOS the server, but still is way up to date (maybe 5 or 10)

7 Optionally change colors, position, size, scale, etc.

8 Close Properties window and enjoy the server status on your Desktop.

6
General Discussion / Re: Pterosaurs - Amdeneir
« on: December 20, 2010, 12:25:16 pm »
Well, I typed in "amedeneir" and then all the npc in the Hydlaa disappeared.  I signed out thinking it would reset and now I can't get back in at all. Suggestions?

I have the same problem, no matter whether i'm on zeroping, ezpcusa or localhost. I'm on Ubuntu Linux 10.10, oss ati graphics driver. When trying to relog, the loading screen after Character selection hangs at "requesting connection". A GM moved me back to hydlaa.

7
Fan Art / Re: More music!
« on: July 07, 2009, 05:24:42 pm »
:D - thanks for the reply

You're the first one to tell me this is good. :P I think you are overestimating my skills though - the "mouthpiece" is a kazoo :) . Besides that, i've used a soprano and alto recorders, a trombone, a baritone, a glockenspiel a rattle and the free drum synthesizer known as Hydrogen. My "circular breathing" is the result of stretcheng the middle of a recorded note using Audacity's "Change Tempo" feature ^^. The mic is a little Sennheiser headset, connected via an usb sound card. The "arrangement" is completely improvised - first i recorded a melody while playing the drum pattern, then i added the bass and the other instruments (or the other way round). most of the backgrounds are loops of the same recording. You're right about the bass boost, i've played around with audacity a bit more and got quite some nice effects by duplicating the bass track and changing the pitch of the copy by one octave.

Regards
Firiban

8
:woot:  :woot:  :woot:  :woot:  :woot:

Thanks for the logs, seems to have been really awesome! Cant wait to see more of that  :)

9
Wish list / Re: Quest Descriptions
« on: June 27, 2009, 02:57:26 pm »
however, it would be nice if there was some kind of extra logfile for (uncompleted) quests, and ingame access to them. crawling through megabytes of logs with a text editor isnt that funny.

10
Fan Art / More music!
« on: June 27, 2009, 12:59:24 pm »
Hi,
as there was a litte party at the Explorers' camp today and we lacked some music, i felt like making some - here it is  :) .
There's no MIDI, except for the drum part. The rest was recorded and mixed using Audacity. I tried to have it fit into the medieval setting.

Download
--->http://filebin.ca/wobzb/Firiban-Under_the_Cliffs.zip
Password is: ojagughydlaa
Sorry for the filebin, it will soon be avalible on the psde.de mirror.

The archive includes three songs.
Released under
cc-by-nc-nd

Firiban - Under the Cliffs
Welcoming Warmup1:10
Ambigous Aim2:44
Silent Samba6:39


Have fun listening and please comment :)
Firiban

11
Fan Art / Re: Beniel's Music Thread
« on: June 25, 2009, 08:48:16 am »
Hehe, nice track, that's definetly gonna become something good   :woot: .

The strings at the beginning sound a bit too artificial, perhaps you can try to replace the ΒΌ notes at the beginning with dotted half notes... just an idea ;) or add an accent to the first note of each measure. or use another synthesizer/instrument.

I'm looking foward to seeing this being finished :)

12
Mac OSX Specific Issues / Re: Action menu on my mac?
« on: June 25, 2009, 04:21:56 am »
the command /targetcontext replaces a rightclick. Create a shortcut in the shortcut window and chose a key to run it (i.e. X). then click an item/person to select it and press X to bring up the context menu.

13
Complaint Department / Re: should auto in duel when get proposed
« on: June 20, 2009, 11:52:25 am »
if this is gonna be implemented, please let Ausuna decide whether she wants to duel after she has clicked "No". Otherwise it could be exploited to kill people by simply doing
/target Ausuna
/marriage proposal
/attack bloody   ←this will work as duel mode will apply for both immeadetly

14
In-Game Roleplay Events / Re: The Organisation's Organisation of a Fair
« on: February 24, 2009, 04:27:00 am »
Quote
Posted on: February 16, 2009, 10:19:54 AM

[...]

Quote
we the organisation wish to organise a fair in the plaza for sunday evening next [between 19:00 and 23:00 GMT]


------> Feb 22th 2009 :P

15
Linux Specific Issues / Re: Avoid the Crashes using WINE
« on: January 02, 2009, 05:54:30 am »
Update!

Yesterday, Fettbemm and I wrote a bash script that installs a perfect PlaneShift client into wine's fake windows. Fettbemm fixed the GUI bug by extracting the skin zip-files into directories with their names, changing/adding some options in the psclient.cfg.

Here is what the script can do for you:
  • Install PlaneShift into WINE
  • Fix the Linux bugs like the gaps between map changes
  • Fix the !leaf-bug that makes many clients crash in random situations
  • Fix the bug that causes you to get stuck in the ojaroad and bdroad maps

The bad things:
  • The script installs some original Microsoft libraries. You need to have a valid license of Windows in order to run the script legally.
  • As emulated applications run slower than native ones, WINE-PlaneShift might run a little slower on your PC than the Linux client.



So, here is how to install it: (on your own risk of cause!)
  • If not already done, install WINE on your system (preferably using your distro's package manager)
  • If you already have a ~/.wine directory, rename it so we can create a new one for PlaneShift.
  • Go to the directory where your Linux PlaneShift client is installed. It should contain for example "psclient" "psupdater" and some folders such as "art".
  • Open a terminal in that directory.
  • Download our script by executing
    wget http://mirror.psde.de/util/psclient_wine/megascript.sh
  • Run it!
    sh ./megascript.sh
  • The script should now start the winecfg configuration panel. Just click "Ok" to proceed.
  • Now, all the art files, i.e. the maps are copied to your WINE PlaneShift client.
  • During the installation you will be prompted whether you want to accept the licenses for vcrun2005 and OpenAL. Of cause you need to accept them in order to install a working WINE client. To be able to see the OpenAL license, you may have to scroll up and down a bit.
  • After the script is finished running, go to ~/.wine/drive_c/Games/PlaneShift and run the command
    wine ./psclient.exe
    to start PlaneShift!
  • You also may want to symlink the directory ~/.wine/drive_c/windows/profiles/yourname/AppData/PlaneShift to ~/.PlaneShift to use the same options and logs with both clients (WINE & native).


Please report any bugs in the script here, or ask for help here if you encounter any problems.
If you don't: Have fun playing!

Thanks to peeg and Sajut from psde.de for uploading our stuff to their mirror!

Firiban

Pages: [1] 2