Author Topic: Event_Piano || Composing piano melodies has never been easier!  (Read 7912 times)

Exactly what I thought! Also, you should add at least one other sound pack to it!
The code doesn't look too difficult, I bet I could do that. What I don't know how to do is
Quote
You could for example have a pre-/suffix that indicates the duration of the note.
Like this: 1f 1f 3s 3s 1f 1f - The number indicates the note (1 is C and 3 is D), while the letter indicates the duration (t(hirty-two) for 1/32, s(ixteen) for 1/16, e(ight) for 1/8 and so forth)

The code doesn't look too difficult, I bet I could do that. What I don't know how to do is
Yes pls! That would be awesome!

Yes pls! That would be awesome!
Alright. I took a "quick" (I spent some 3 hours or so, it was the first time I ever wrote something in TorqueScript) look at it and came up with a feasable solution.
My improved script works with PianoExtended2.0, supports multiple notes simultaneously, and has a more flexible timing.
:D

I'll look into making it work with multiple Soundsets at once (dropdown menu or something, so you don't have to change the code every time) .

I'll share it as soon as I've implemented all the changes I want. Unless PurpleMetro doesn't want me to share it, of course.


It now works with external files as well. I'm afraid the files are client-sided, meaning you can't share the music unless you share the actual .txt-file. Some people might think thats a good thing, I'm not sure. I need to do some online testing to confirm this, however.

Something that is definately good about this is that you're not limited to 200 characters anymore. You can compose whole symphonies, if you want! 
Which brings me to the next step: converting my converter. I need to rewrite my Midi2Blockland event generator so that it creates useable .txt-files for this. That shouldn't be too much work, however.

Sounds really really cool.

Nice work King Leo. Once you are done i'll update the OP with your revision.

Such a simple idea. Extremely good. Nice use of || title.


Any updates King Leo?
The updates are that I've been playing a bit too much BF3 lately :P
I take a look at it now.

make a version 6 where you can select the soundtrack and people could make add-ons to this add-on that add more soundtracks.
Oh, and

          |
          |
          |
          |
          |
 

make a version 6 where you can select the soundtrack and people could make add-ons to this add-on that add more soundtracks.
Oh, and

          |
          |
          |
          |
          |
 
Not much of a bump, An bump only works if it's been a day, For example, I just bumped it.
Bump.

I want to see a video demonstration of this, I will download it once released on RTB too. (I'm lazy :C)

Just when I thought I was done, I see that tied notes forget everything up. Argghhhh!

Okay, I have absolutely no idea how to to fix this. I think I just let it be and add a safety tip on the side: manually remove tied notes before converting it into a song!
« Last Edit: April 16, 2013, 02:39:45 PM by King Leo »

Alright, here's a version for those of you who want to try it:
http://www.mediafire.com/?y64nklu2i2cwp3z

Remember: you need Sound_Extendedpiano2.0 for this to work.




So what's new in this version? Notes are now written like this: C4/2. Let me explain.



- The C is the note you wanna play, in this case C. A lower case c refers to the sharp note C#. Likewise, d means D#, f means F#, g means G# and a means A#.

- The number after the note indicates which octave is going to be played. C4 is the middle C on the piano keyboard.

- The last part tells something about how long the delay between this note and the next one will be. The default value can be set in the second input box (default 500 ms). Use * followed by a number to make the delay longer. Use / followed by a number to make the delay longer. For example, C5*4 will last four times longer than C5, while C5/2 only lasts half as long. Easy, right?

- Chords can be played by writing multiple notes with a comma between them. The delay modifier is added at the very end of the string of notes, like so: C4,E4,G4/2

- Rest or pause is basically any word that isn't recognized as a note or chord. However, the notation R- / or *xxx should be used. That is a capital R followed by a minus and a(n optional) delay modifier.



Okay. So that's how the input works. It is quite intuitively once you get the hold of it.
My next problem was that you can only save 200 characters per event. That's only enough for about 40 notes or so. Not really enough for a composition. So I added the event PianoSynthRFF (read from file) as well. It does what the name says: it takes in the name of a file, and plays said file. Files are better for very long series of notes because you won't run out of characters. You can make the file as long as you want!

So how do you make a file? Easy. Just copy/paste your notes into a .txt file and save it in Blockland/config/server/musicFiles . If the folder doesn't exist, make it. You can access the file in-game by entering the name of the file, followed by .txt, in the big input field. So if your .txt file is called "MyPianoSong", you just write "MyPianoSong.txt" into the field. Easy peasy.




There is a third part to this add-on as well. That is a script that generates text files that can be imported with PianoSynthRFF. The problem is that it doesn't work properly. It struggles with tied notes, it cannot effectively handle multiple voices (they are played in sucsession, rather than simultaneously) and it had to be written in Python. So in other words, its use is quite limited. First of all, you need to have a program that converts your midi file to a music xml file. Most midi programs can do that, so that's not really a problem. Second of all, you need Python to compile the script. There's no reason why you shouldn't have Python on your computer, so that's not really an issue, either.
Last, but not at least, you have to be selective about which songs you feed into the program. It doesn't like songs with lots of voices and tied-notes, as mentioned earlier. Since the soundpacks don't have sustainable notes, your song will sound very staccato. So don't pick a song with lots of sustained notes (let's say Moonlight Sonata by Beethoven).
Due to these limitations, I'm not sure if I should bother uploading the converter. Tell me what you think.
« Last Edit: April 16, 2013, 04:15:51 PM by King Leo »

Cool! So the /2 part of C4/2 makes it half the speed? Or twice the speed?