Fingering format discussion

Synthesia is a living project. You can help by sharing your ideas.
Search the forum before posting your idea. :D

No explicit, hateful, or hurtful language. Nothing illegal.
TonE
Synthesia Donor
Posts: 1180

Post by TonE » 10-26-11 4:50 pm

First I paste from the locked topic:
Alright, I've finished the grammar for the written-out finger hint data. It's as similar to what we discussed over in Frost's automated fingering thread as I could make it. Maybe a little simpler.

Here are some specifics (pretty much just for TonE ):
Whitespace (and ANY character not in 0-9, :, -, t, or m) is ignored and can be used anywhere.
The numbers 1-5 used anywhere outside the context of a track or measure command means the "next" note is left-hand, finger 1-5.
Similarly, 6-0 means right-hand, finger 1-5 respectively. (So 6 is finger 1, 9 is finger 4, and 0 is finger 5.)
Use - to skip a note. "132-43" would apply 5 labels to 6 notes where the 4th note had no label.
Jump to assigning finger hints to notes in a different track with "tN:" where N is an integer. So "t14:123" would add 3 labels to track 14. (Tracks are zero-based.)
Use "mN:" to jump to a different measure in the current track. Measures are ones-based. "t2: 123-4 m7: 789" will add seven labels to track 2... four of which are in the first (and second, if it spills over) measure and another three to the 7th measure.
That's it. Everything for the same song goes in the same big string. Use newlines for clarity, but they're not required. My serializer is probably going to put spaces between measures and newlines for each track. Still, whitespace is totally arbitrary. This is hard to read but perfectly valid: "t1:1248t2:325m9:974"... instead though, you'd probably want to write it something closer to this:
Code: Select all
t1: 1248
t2: 325 m9:974

The default track and measure are 0 and 1 respectively.

The "next" note mentioned in the first bullet refers very specifically to the order of note-on events in the original MIDI file. I was (painstakingly) able to create a mapping back to the "original" positions of all events and tracks. So a "t0:" command will refer specifically to whatever was in the first track in the MIDI file... all of my wacky splitting/merging/deleting/re-ordering aside. This makes it a little hectic for format-0 MIDI. My recommendation: don't use format-0 MIDI.

Finger hints are auto-saved in a new fingers.xml file. It'll look something like this:
Spoiler:
And I'll be adding a method in the synthesia-metadata-gui (very soon) to extract auto-saved in-Synthesia finger hints out to metadata files you can share with friends or on the forum or whatever. The process will be roughly:
Use Synthesia to enter finger hints.
Open the metadata editor.
Add the songs you want to share finger hints for.
Click the (forthcoming) "Import Finger Hints from Synthesia" menu option.
Save the file and share it.
As always, including that .synthesia file someplace in your watched folders path will cause it to be automatically loaded and finger hints should just show up.

The dev preview with all of this will be up very soon (today probably), and then I'll be embarking on the journey of adding all the finger hints from the G Major original PDFs to the in-game songs. If anyone wanted to help out with that, you'll totally get a credit in the readme and I'll be forever grateful. Like past data-entry attempts, we'll just agree on something like "I'll take the 'Medium' folder... you get 'Easy'."
In my opinion this is too complicated format. Also the finger numbers are not as I wanted them. My ideal was:

right hand: 12345 for the fingers 12345
left hand: 67890 for the fingers 12345 (left hand = right hand + 5, except you have to imagine the 0 as a 10)

As in my previous proposal no "track consideration" was available, this can be accomplished simply by using multiple text files, one for each track which contains any fingering information. Then the proposal as in the original post, each line denoting a measure, jumping over notes via ".", but a "-" is also ok, I would prefer a DOT as I imagine a note more like a dot, than a horizontal line = minus.

The numbering system above is not for easy typing on the laptop or pc, "the logic should be easy in the human brain". Mostly songs have right hand information, so we can say at least for beginners, the right hand is more important than left hand, as the main melody is usually in the right hand, the left hand contains only the bass or additional chord notes, not always, but very often. At least for beginner songs. This is why the simple numbers 1..5 should just be mapped to the RIGHT HANDs 1..5 finger numbers.

For the LEFT HAND, I would prefer using the editing method via AutoHotkey, using LEFTCONTROL + 1..5, which would map to 6..0. Each time I would see a fingering information on the bass clef, which is lower on the sheet, I would simply press LEFTCONTROL additionally, which is also lower on the QWERTY area. In short for the fingering we never need to spend any "brain power", always using 1..5, depending on G-clef or bass-clef WITHOUT a leftcontrol or WITH leftcontrol.

Finally, how could be the fingering file names? For example as follows
song.t1.txt
song.t2.txt (in one-based fashion) or

song.t0.txt
song.t1.txt (in zero-based fashion)

I would prefer the one based fashion in this case. Most songs would have anyway most fingering information on a single track or at maximum on two tracks.

The idea of this whole method is, to be able to write EASILY fingering information in following scenario:
- you have already your midi files, in the example above as song.mid
- you have the correct fingering information in a real book or in .pdf files, which relate exactly to the above midi files
- you do not want to write your fingering information in synthesia
- you want to write the fingering in a simple text editor as Notepad++ or Vim or Emacs
- you do not want to think much while writing the fingering
- you want to be able to write the fingering information very quickly
- you want fingering information be easily shareable and easily visible in forums, meaning every new line is a new measure.

Nicholas
Posts: 12075

Post by Nicholas » 10-26-11 5:16 pm

TonE wrote:The numbering system above is not for easy typing on the laptop or pc...
All of that is editable via the new key binding screen, isn't it?
TonE wrote:- you have the correct fingering information in a real book or in .pdf files, which relate exactly to the above midi files
- you want to write the fingering in a simple text editor as Notepad++ or Vim or Emacs
- you do not want to think much while writing the fingering
The reason for the "m" instruction is so you don't have to spend half your time counting out notes without finger hints. It becomes very easy to make a mistake when you have to enter 24 dots in a row while carefully following along in sheet music, watching the top and bottom staff as you go. Your "uncompressed" method is more entry time and easier to make a mistake. And one mistake gets the entire rest of the song off-track instead of getting back on track the next time you jump to a measure.
TonE wrote:- you do not want to write your fingering information in synthesia
- you want to be able to write the fingering information very quickly
These two seem in competition. The UI is already very fast -- granted, not typing fast -- and it removes ALL of the counting, tracking, and error-prone steps from the manual typing entry. I can't imagine why you'd ever choose typing over the quick mouse gesture that handles all the behind-the-scenes details for you.
TonE wrote:- you want fingering information be easily shareable and easily visible in forums, meaning every new line is a new measure.
The .synthesia files are already easily shareable. Otherwise, I'm not sure why you want easily visible.

TonE
Synthesia Donor
Posts: 1180

Post by TonE » 10-26-11 6:12 pm

Nicholas wrote:It becomes very easy to make a mistake when you have to enter 24 dots in a row while carefully following along in sheet music, watching the top and bottom staff as you go.
How often we have a case where 24 notes are in a single measure, I never saw such notes. Even if, I would probably use 5 note groups as follows: ..... ..... ..... ..... ....

Also you never need to count exactly over multiple measures, only over single measures. If a measure has 7 notes and I used in this measure line 100 "dots", as the parsing will be on "per line basis" the last 93 dots would NOT have any effect on the fingering and counting. So only inter-measure counting is necessary, like "add fingering on second note of measure", but not the first.

Anyway, thanks for all your implementation, but it seems I will not use this much. Of course we have the way of editing in Synthesia, but my idea was having also a second method OUTSIDE of Synthesia.

Nicholas
Posts: 12075

Post by Nicholas » 10-26-11 6:41 pm

TonE wrote:Anyway, thanks for all your implementation, but it seems I will not use this much.
If a clean, easy-to-use interface that I've received more positive feedback about than any other single feature in the game -- coupled with an expressive, compact notation (also allowed to span more than one line) that is easy to generate or modify by hand -- isn't enough for you to use it, I suppose that's your prerogative. ;)

TonE
Synthesia Donor
Posts: 1180

Post by TonE » 10-26-11 7:00 pm

I will give it a try, and can write about my experiences with Czerny tests. I am always talking of editing OUTSIDE of Synthesia, of course the GUI in Synthesia is great, without any doubt, except whenever a "repetition sign appears in staff notation" via Synthesia GUI we have to do double work for fingering. :?

Here is 36-96.Czerny 01.txt according to my definition above:

Code: Select all

018
623
018
623
013
8574
6372
81
018
623
018
623
013
8574
6372
81
623
642
0394
8503
623
642
8163
01
623
642
0394
8503
623
642
8163
01
I added Czerny 2,3,4 via the Synthesia GUI 5 button mouse method, which I can not share yet as the SynthesiaMetadataGui-r13.exe does not run here yet.

Here is 36-96.Czerny 05.txt:

Code: Select all

012045
642642
611635
042042
012045
642642
613613
0242
012045
642642
611635
042042
012045
642642
613613
0242
712745
853021
712745
853021
825743
821031
642642
0131
712745
853021
712745
853021
825743
821031
642642
0131
From my first comparison, even with the "optimized" 5 button mouse input method vs. text file editing, it feels to me, I am much faster with the text file method. I mapped right hands 1..5 to the keys B,U,I,O,P, the same with leftcontrol to the left hands 1..5. SPACE goes to next line. leftcontrol-space adds a dot.

Even using only the numpad section without any special mapping might be very quick already. After little practice you can just follow the notes with your eyes and just directly type in the numbers without looking at the keyboard, as those women in the ALDI supermarkets. :)

Czerny 06:

Code: Select all

01235
02987
615615
015015
01245
03135
642642
0111
01235
02987
615615
015015
01245
03135
642642
0111
6278192
03680
6278192
03868
05353
01313
642642
0111
6278192
03680
6278192
03868
05353
01313
642642
0111
Czerny 07:

Code: Select all

01234
0585
642642
011
01234
0585
642642
011
642635
0381
643625
010
642635
0381
643625
010
Czerny 08:

Code: Select all

01358
01358
61256
0135
01358
01358
61256
0135
61356
024
61356
024
71356
71356
01350
7125
61356
024
61356
024
71356
71356
01350
7125
Czerny 09:

Code: Select all

9761353
9761353
0864242
97631
9761353
9761353
0864242
97631
0861111
076315
0765421
976222
0861111
076315
0765421
976222
Czerny 10:

Code: Select all

976125976125
976124976124
076135076135
976125
976125976125
976124976124
076135076135
976125
076135076135
086124
076245076245
86135
0712407124
8613586135
0863507613
862
076135076135
086124
076245076245
86135
0712407124
8613586135
0863507613
862
Last edited by TonE on 10-27-11 12:51 am, edited 2 times in total.

Pianotehead
Posts: 319

Post by Pianotehead » 10-26-11 7:56 pm

I've been thinking about this finger insertion problem a lot the last days, and I wonder if there is a faster way to do it. The inserting method in Synthesia works fine for short songs, but if you have a song over one minute, it's quite slow. When I want to insert the finger numbers I have to have my extra monitor connected and have the PDF-file open on my laptop display.

Even with that large monitor (24 inches) the space is very limited and I only see about two measures at a time. I prefer to have the sheet music display on, so I can check if the measures in the PDF file match with the ones in Synthesia. Would it maybe be quicker to just use the format of the Synthesia Metadata editor? By simply keeping track of the measure numbers and insert in the format m(measure number): f1,f2,---(if no fingering) and so on.

I'll give an example, the following is the start of the fingering for Rondo Alla Turca, which I started doing recently. You can insert it in Synthesia Metadata editor. The MIDI file is on gmajormusictheory.org. One question about this: Shouldn't the G major MIDIs in the categories Intermediate 1 - 4 be in the Synthesia package?

t1: 9--688---99--69 m4: ---79-----79 m8: --79 m17: 68--68 m18: 9---79 m20: 9---7968--68 m22: 9---79 m24: 9---79 m29: 7 m30: 67 m31: 97 t2: 5

TonE
Synthesia Donor
Posts: 1180

Post by TonE » 10-26-11 8:32 pm

Well,the monitor space problem is problem zero, opening a pdf and a very thin text editor fits well on the contrary.
Mouse-over dependency is problem one, makes it very slow, instead all the fingering editing should be done via the keys, also note by note navigation.
Non-logic numbers is problem three, I mean in the source files, well I have to write a converter then myself.
Repetition sign requires double fingering work via GUI which is problem four, a text editor can have nice quick copy and paste features.

If we have all the fingering information in front of our eyes in a book or a pdf we need NO ANY MORE information, we only need a VERY QUICK way to write this down and which should be understood by Synthesia hopefully. Currently we have the above four problems which I experienced so far.

Nicholas
Posts: 12075

Post by Nicholas » 10-26-11 9:20 pm

Pianotehead wrote:Would it maybe be quicker to just use the format of the Synthesia Metadata editor? By simply keeping track of the measure numbers and insert in the format m(measure number): f1,f2,---(if no fingering) and so on.
I was actually able to do this pretty successfully when I was working on my section of the G Major finger hints.
Pianotehead wrote:One question about this: Shouldn't the G major MIDIs in the categories Intermediate 1 - 4 be in the Synthesia package?
They're not? As far as I know, there are finger hints for all the G Major songs. Do you have the latest version of the MIDI files? They are updated periodically. The installer version overwrites them, but the dev update doesn't.

TonE
Synthesia Donor
Posts: 1180

Post by TonE » 10-26-11 10:05 pm

Those who have a 5 button mouse can also try the AutoHotkey code below. The idea is simple, five buttons for each finger of the right hand, using leftcontrol additionally same finger numbers for the left hand. Tip: Write first all fingerings for the right hand, then all fingerings for the left hand. This minimizes the jumps in the brain/fingers. My key binding here is not the default one, but the one mentioned above. This is a nice solution for adding fingering information IN Synthesia GUI, using only the 5 button mouse and the left control key.

After finishing the fingering adding to a song I would wish Synthesia would automatically export the song.synthesia file into the same directory as the original song.mid, then we can easily share it without any extra export work. [EDIT] It would be also nice if after each fingering mapping the falling note display would auto-scroll to the next nearest note. This would minimize mousewheel scrolling.

Code: Select all

; mouse numbers
lbutton::
{
	Send, 2
	return
}

mbutton::
{
	Send, 3
	return
}

rbutton::
{
	Send, 4
	return
}

xbutton2::
{
	Send, 5
	return
}

xbutton1::
{
	Send, 1
	return
}


lcontrol & lbutton::
{
	Send, 7
	return
}

lcontrol & mbutton::
{
	Send, 8
	return
}

lcontrol & rbutton::
{
	Send, 9
	return
}

lcontrol & xbutton2::
{
	Send, 0
	return
}

lcontrol & xbutton1::
{
	Send, 6
	return
}

TonE
Synthesia Donor
Posts: 1180

Post by TonE » 10-27-11 2:45 pm

The Synthesia meta-data file format is an XML file that contains extra information related to one or more music (MIDI, etc.) files that Synthesia understands and can use to enhance game play. The file has an extension of .synthesia and must be in one of the folders watched by the song library.
I do not use the song library at all, but would like to use .synthesia fingering files on "per song.mid basis". So is it possible that Synthesia understands also following scenario in ANY directory:

song1.mid
song1.synthesia
...
songN.mid
songN.synthesia

Synthesia would check for any song.mid triggering, e.g. via the command-line, if there is a song.synthesia, if yes, it would use this fingering data. Without any dependency on the song library use. In my opinion all the song and fingering information should be all independently of each other, so I should always be able to add or delete any song or fingering information without much thought, as it is now with normal midi files.

Nicholas
Posts: 12075

Post by Nicholas » 10-27-11 3:45 pm

TonE wrote:I do not use the song library at all, but would like to use .synthesia fingering files...
"I keep half the program disabled, but I wish I could use the whole program..."

You're working very hard to fight the system. It takes one .synthesia file -- in one folder, once -- to make everything work perfectly, and you're still asking for changes.

In the future, the metadata stuff is going to become more inclusive with lots of additional information, not less. The new left-hand / right-hand delineations are going to go in there too. For remotely-downloaded .synthesia files (when the URL handler stuff happens), the remote URL for each song is going to go in there. Bookmarks will eventually be able to be passed around in metadata files. All the new goal stuff that I haven't even talked about yet (effectively "TonE's Arcade Mode") will live in .synthesia files.

There is an open-source editor that you can modify to handle reading and writing these things. They're also just plain XML so you don't even need the editor code to have a pretty good shot of doing it right the very first time. All of this stuff is easy to work with, easy to use, integrated nicely into the game, but you still don't want to use it for some reason.

vicentefer31
Posts: 899
Location: Madrid, Spain

Post by vicentefer31 » 10-27-11 4:59 pm

TonE wrote:In my opinion all the song and fingering information should be all independently of each other
Me too.
Picasso: I am always doing that which I cannot do, in order that I may learn how to do it.

Nicholas
Posts: 12075

Post by Nicholas » 10-27-11 5:07 pm

From my perspective, fingering information is song information. Neither set of information ever changes once it's correct. Outside of simply enjoying having more files in your filesystem, what good does separating the two give?

TonE
Synthesia Donor
Posts: 1180

Post by TonE » 10-28-11 1:24 am

Nicholas wrote:"I keep half the program disabled, but I wish I could use the whole program..."
...
All of this stuff is easy to work with, easy to use, integrated nicely into the game, but you still don't want to use it for some reason.
Yes, fingering is what I want to use, but not the song library which has nothing to do with music or playing the keyboard. It is just for organizing my files, for these in my opinion Synthesia should not be the place for, but well, we have already these features, good for those who asked for it in the past. I never asked.

If you say, fingering should only work if you use Synthesia's internal organization system, then ok, we have to accept it, you are the master and guru here :) , we can not thank you enough for the great Synthesia, but which equals to not using the fingering system in my case. I do not like artificial limitations. If Synthesias song library would work freely over all the harddisks, without any "watched folders" idea, then I would maybe consider using it, but I just want to play ANY song in my harddisks quickly, no matter where, without EACH TIME having to organize or check if they are in the list of watched folders. This concept I do not like, which is the reason why I do not use the song library at all.

I described above entering fingering information in text files is much quicker in my case, if it would be possible to quickly convert such a text file into a *.synthesia format it would be good for the whole community, again just in my opinion. Now the whole process to create .synthesia files is too slow and complicated which is maybe the reason why we still do not have any fingering information for all the Hanon and Czerny exercises. If I want to write fingering information for 100 files, the first thing I do is looking for the fastest way which might be possible, not just using and accepting what we have. I also wrote above, that I tried both methods, mouse on Synthesia GUI, even my AutoHotkey improved clicking on Synthesia GUI was not faster than text file fingering writing via B,U,I,O,P,LEFTCONTROL,SPACE keys. You only need to look at the score in a vertical way, always from botton to top, then going to the right, and type in what you see. With a little practice you can just fly over the sheet. The "5 button mouse Synthesia GUI input method" I liked actually also, but it is only a little slower, also using button 5 each time is slowing down a little and is a little uncomfortable. If we can use a BUIOP method which feels actually like playing the piano itself, from the correct fingering perspective, why should we not use it? But maybe in a future release you want to add a similar functionality into Synthesia, who knows? With an auto-note-iteration after each fingering entry the available keybinding system should already help.

Also fingering information is unfortunately NOT song information yet, otherwise we would have them in the midi file already. But the reality is, we have many midi files which do not contain any fingering information yet. So what to do in this situation? Someone wants to write Hanon 17 fingering, and ONLY Hanon 17 and quickly share it here, how to achieve this, so Synthesia will accept it? So we need a way of creating Hanon17.synthesia. As quick as possible, as easy as possible. All my idea was allowing Synthesia to accept a free text format which equals to Hanon17.synthesia information, so Synthesia can convert it internally to this .synthesia format, which would consist of two steps:
1. Creating the hash.
2. Accepting the fingering format in the text file, which is already available. (I can write a converter for the left <-> right hand mapping differences.)

Finally, I want to emphasize here, that you are a great person Nicholas, all my writing here is nothing personal at all, even if you are the programmer, all the idea sharing here should be just for the topic itself, having fun with the piano, and how can we make it as easy as possible to write and share and delete and add SINGLE fingering information. The current available method could be still improved, this is what I want to say. If I know fingering writing is easy to accomplish, I can quickly write new fingerings when I am bored at the computer, if not, I will do anything else instead. This should be true for most people I guess.

Just for the fun of it we could even have "fast and correct fingering writing competitions". Two players start on two computers writing the fingering for a given song, having the same pdf or book or webpage in front of their eyes, the quicker correct result wins. As long as Frost stays hidden with his genious auto-fingering system a quick fingering entry method is essential. Frost can you hear me! :lol:

Nicholas
Posts: 12075

Post by Nicholas » 10-28-11 1:48 am

TonE wrote:Frost can you hear me! :lol:
I know, right? Where did that guy go?! :D
TonE wrote:... if it would be possible to quickly convert such a text file into a *.synthesia format it would be good for the whole community
This actually shouldn't be that hard. Even doing the hash lookup would be simple since the side-by-side files you're proposing are named the same as the MIDI file. And since your multi-line format is the same as using "m" directives, there shouldn't be any extra information required to quickly port between the two "languages", would there?

You should totally write a utility that will convert between the two. ;)

TonE
Synthesia Donor
Posts: 1180

Post by TonE » 10-28-11 1:59 am

Nicholas wrote:And since your multi-line format is the same as using "m" directives, there shouldn't be any extra information required to quickly port between the two "languages", would there?
Yes, there is, not information, but limitation, Synthesia has the limitation of requiring .synthesia files being in the song library. If this limitation does not exist, we can think about such conversions.

Nicholas
Posts: 12075

Post by Nicholas » 10-28-11 2:06 am

Oh there are default folders... that is such a weak limitation! :D

Or, just watch the root of your drive recursively. (Though that will take a while each startup.)

TonE
Synthesia Donor
Posts: 1180

Post by TonE » 10-28-11 2:20 am

Nicholas wrote:Or, just watch the root of your drive recursively. (Though that will take a while each startup.)
You mean multiple drives? Hmm, not a good situation for me and .synthesia files, there is no reason to create .synthesia files then, thanks for all your response. Do you know the song of Bob Marley "No fingering, no cry"? :)

TonE
Synthesia Donor
Posts: 1180

Post by TonE » 04-08-12 7:04 am

Here is something I wrote in November 2011 for converting TonE fingering text format .txt files to .synthesia files which can be used directly in Synthesia. However Synthesia still does not support .synthesia files from command line yet, probably with 0.8.5 such a support might be added or later. Have fun, you can use it now by watching the folders, then directly starting the midi from inside of Synthesia, NOT from the command line.

You need to create for song.mid a text file named song.txt, using TonE fingering format, then selecting this .mid file in FreeCommander, press F5, if there is a song.txt it will be converted to song.synthesia automatically. I hope it works also there, here it worked nicely.

Code: Select all

/*

Converting fingering information for a midi file from TonE text format
to .synthesia format which you can use in Synthesia, if you watch the
folder the song and .synthesia file is inside.

dependencies:
    0.  AutoHotkey, www.autohotkey.com
    1.  FreeCommander, www.freecommander.com
    2.  Synthesia, www.synthesiagame.com

*/

#NoEnv 
#SingleInstance force
#InstallKeybdHook
SetTitleMatchMode, 2
SendMode Input
DetectHiddenWindows, On



GetMidiFileFromFreeCommander()
{
    Clipboard =
    SetTitleMatchMode, 2
    WinActivate, - FreeCommander
    Sleep, 2000
    Send, {AltDown}{insert}{altup}
    ClipWait
    return %Clipboard%
}
    
FileMD5( sFile="", cSz=4 ) 
{ ; www.autohotkey.com/forum/viewtopic.php?p=275910#275910 
 cSz  := (cSz<0||cSz>8) ? 2**22 : 2**(18+cSz), VarSetCapacity( Buffer,cSz,0 ) 
 hFil := DllCall( "CreateFile", Str,sFile,UInt,0x80000000, Int,3,Int,0,Int,3,Int,0,Int,0 ) 
 IfLess,hFil,1, Return,hFil 
 DllCall( "GetFileSizeEx", UInt,hFil, Str,Buffer ),   fSz := NumGet( Buffer,0,"Int64" ) 
 VarSetCapacity( MD5_CTX,104,0 ),    DllCall( "advapi32\MD5Init", Str,MD5_CTX ) 
 Loop % ( fSz//cSz+!!Mod(fSz,cSz) ) 
   DllCall( "ReadFile", UInt,hFil, Str,Buffer, UInt,cSz, UIntP,bytesRead, UInt,0 ) 
 , DllCall( "advapi32\MD5Update", Str,MD5_CTX, Str,Buffer, UInt,bytesRead ) 
 DllCall( "advapi32\MD5Final", Str,MD5_CTX ), DllCall( "CloseHandle", UInt,hFil ) 
 Loop % StrLen( Hex:="123456789ABCDEF0" ) 
  N := NumGet( MD5_CTX,87+A_Index,"Char"), MD5 .= SubStr(Hex,N>>4,1) . SubStr(Hex,N&15,1) 
Return MD5 
}
    
F5::
    {
	MidiFileName := GetMidiFileFromFreeCommander()
 ID := FileMD5(MidiFileName)
 StringLower, ID, ID
   FormatTime, TimeString,, yyyy.MM.dd HH:mm
   SplitPath, MidiFileName, OutFileName, OutDir, OutExtension, OutNameNoExt, OutDrive
  FileRead, FingerHints, %OutDir%\%OutNameNoExt%.txt
  if Errorlevel 
  {
      MsgBox,,TonE text fingering file does not exist, TonE text fingering file %OutDir%\%OutNameNoExt%.txt seems not to exist. Please write or download it first. Here the quick specification for such text fingering files:  right hand 1..5, left hand 6..0, newline for a new measure, . for jumping over a note, count notes from left to right, from bottom to top
  }
  else
  {
Fingering := ""      
Loop, read, %OutDir%\%OutNameNoExt%.txt
{
    CurrentLine := A_LoopReadLine
    ; eliminating differences between Nicholas and TonE mapping
    StringReplace, CurrentLine, CurrentLine, ., -, All
    
    StringReplace, CurrentLine, CurrentLine, 1, a, All
    StringReplace, CurrentLine, CurrentLine, 2, b, All
    StringReplace, CurrentLine, CurrentLine, 3, c, All
    StringReplace, CurrentLine, CurrentLine, 4, d, All
    StringReplace, CurrentLine, CurrentLine, 5, e, All
    
    StringReplace, CurrentLine, CurrentLine, 6, f, All
    StringReplace, CurrentLine, CurrentLine, 7, g, All
    StringReplace, CurrentLine, CurrentLine, 8, h, All
    StringReplace, CurrentLine, CurrentLine, 9, i, All
    StringReplace, CurrentLine, CurrentLine, 0, j, All
    
    
    StringReplace, CurrentLine, CurrentLine, a, 6, All
    StringReplace, CurrentLine, CurrentLine, b, 7, All
    StringReplace, CurrentLine, CurrentLine, c, 8, All
    StringReplace, CurrentLine, CurrentLine, d, 9, All
    StringReplace, CurrentLine, CurrentLine, e, 0, All
    
    StringReplace, CurrentLine, CurrentLine, f, 1, All
    StringReplace, CurrentLine, CurrentLine, g, 2, All
    StringReplace, CurrentLine, CurrentLine, h, 3, All
    StringReplace, CurrentLine, CurrentLine, i, 4, All
    StringReplace, CurrentLine, CurrentLine, j, 5, All
    
        Fingering := Fingering .  "m" . A_Index . ":" . CurrentLine . " "
}
;MsgBox, %Fingering%      
      
  SynthesiaContent =
(
<?xml version="1.0" encoding="utf-8"?>
<SynthesiaMetadata Version="1">
  <Songs>
    <Song UniqueId="%ID%"
    Title="%OutNameNoExt%" Tags="converted from TonE fingering text file for %OutFileName%;written on %TimeString%" FingerHints="%Fingering%" License="Have fun license." Subtitle="TonE edit" Composer="Composer" Arranger="Arranger" Copyright="Copyleft" />
  </Songs>
</SynthesiaMetadata>
)

  FileDelete, %OutDir%\%OutNameNoExt%.synthesia
  FileAppend, %SynthesiaContent%, %OutDir%\%OutNameNoExt%.synthesia
  
    }

	return
    }

TonE
Synthesia Donor
Posts: 1180

Post by TonE » 04-23-12 5:43 am

-- can be deleted -- my post was a reply to a spammer. :)
Last edited by TonE on 04-23-12 7:58 am, edited 1 time in total.

Post Reply