♫ E2 99 AB beamed eighth notes

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
markfilipak
Posts: 7
Joined: Sat Aug 09, 2014 8:08 pm

♫ E2 99 AB beamed eighth notes

Post by markfilipak »

Hello All, Happy Holidays!

I'm planning to manually edit SRTs (i.e., UTF-8 movie subtitles). The only UTF-8 character I need to add is code point E2 99 AB (i.e., beamed eighth notes, to signal that music is playing).

Is there a way to add that code point to the Clip Library? Or, is there any other place to put it so I can simply copy it into the SRT when it is needed?

Thanks,
Mark.
User avatar
AmigoJack
Posts: 568
Joined: Sun Oct 30, 2016 4:28 pm
Location: グリーン ヒル ゾーン
Contact:

Re: ♫ E2 99 AB beamed eighth notes

Post by AmigoJack »

markfilipak wrote: Mon Dec 23, 2024 8:10 pmUTF-8 character ... code point E2 99 AB (i.e., beamed eighth notes
That's the UTF-8 encoding of the actual Unicode code point U+266B.

Yes, you can do that:
Right click on the Clip Library combobox, then choose "New book...". As per the Save dialog you'll notice it will be a *.TCL file. You can see already existing clip libraries in TextPad's installation under \Samples\, f.e. "doschar.tcl". Insert the characters you want, adhere to the syntax standard, then save the file in UTF-8.

The help file explains the format under How To... > Use the Clip Library > Direct Editing:
Header:

Code: Select all

!TCL=<id>, <comment>
!TITLE=<title>
!SORT=<y|n>
!CHARSET=<charset>
where:
  • <id> is an identification number in the range 1-999 (numbers above that are reserved for our sample clip books). It must be unique for each clip book.
  • <comment> is any text, such as the author's name.
  • <title> is a short name that you will use to select this book.
  • <charset> is one of ANSI, ARABIC, BALTIC, CHINESEBIG5, DEFAULT, DOS, EASTEUROPE, GB2312, GREEK, HANGEUL, HANGUL, HEBREW, JOHAB, MAC, RUSSIAN, SHIFTJIS, SYMBOL, THAI, TURKISH, VIETNAMESE. If omitted, it defaults to ANSI. If set to DEFAULT, the default character set for Windows will be used. This value controls which font is used to display the list of clipping titles and will only have an effect if the corresponding code page is available in Windows.
Clippings:

Code: Select all

!TEXT=<title>
<clipping>
!
where:
  • <title> is a short name that you will use to select this clipping, and to sort them, if required.
  • <clipping> is any text, except for an "!" in column 1. If your own text must start with "!", escape it using "\!". The characters \^ will be interpreted as the hot spot. If you need to use \^ literally, escape it using \\^.
  • ! marks the end of a clipping. Precede it with a blank line, if you want the clipping to finish with a line break.
Maybe more up to date help files have added a hint to UTF-8. In any case: save the file in UTF-8 encoding. As for the !CHARSET= definition try multiple things:
  • omit it
  • use UTF-8 as <charset>
  • use UTF8 as <charset>
  • use DEFAULT as <charset>
Feel free to report back which variant works for you.
User avatar
bbadmin
Site Admin
Posts: 948
Joined: Mon Feb 17, 2003 8:54 pm
Contact:

Re: ♫ E2 99 AB beamed eighth notes

Post by bbadmin »

"E2 99 AB" is not a Unicode character, so I'm not sure what you mean by that. You can enter any Unicode character by typing its hex code point followed by Alt+X (assuming you have TextPad 9.6.0 or 8.20.0 and later). For the beamed eighth, you would type:

Code: Select all

266bAlt+X
You could create a clip library containing it as follows:

Code: Select all

!TCL=9835,
!TITLE=Music
!SORT=N
!CHARSET=UTF-8

!TEXT=♪ Single Eighth
♪
!
!TEXT=♫ Beamed Eighth
♫
!
Save that as %APPDATA%\Helios\TextPad\9\Music.tcl then restart TextPad.
markfilipak
Posts: 7
Joined: Sat Aug 09, 2014 8:08 pm

Re: ♫ E2 99 AB beamed eighth notes

Post by markfilipak »

Code: Select all

!TCL=2, 
!TITLE=UTF-8
!SORT=Y
!CHARSET=UTF-8

!TEXT=♫ beamed eighth notes
♫
!
That works. Thanks! To future readers, don't forget to close & reopen TP.

As a more convenient alternative, is it possible to bind ♫ to Ctrl+Alt+M?

Added note:
"E2 99 AB" is apparently the bytes. I found out via a binary editor. Then I searched the net for:
E2 99 AB
User avatar
bbadmin
Site Admin
Posts: 948
Joined: Mon Feb 17, 2003 8:54 pm
Contact:

Re: ♫ E2 99 AB beamed eighth notes

Post by bbadmin »

  1. Start the macro recorder.
  2. Type Alt+X, then 266b.
  3. Stop the recorder.
  4. Save the macro.
  5. Assign a shortcut using Configure » Preferences » Keyboard » Macros.
  6. Enjoy your holiday!
Last edited by AmigoJack on Thu Dec 26, 2024 8:15 am, edited 1 time in total.
Reason: correct Alt+X sequence
markfilipak
Posts: 7
Joined: Sat Aug 09, 2014 8:08 pm

Re: ♫ E2 99 AB beamed eighth notes

Post by markfilipak »

bbadmin wrote: Wed Dec 25, 2024 8:09 am
  • Type 266bAlt+X
It didn't work. When I typed "266b" with recorder ON, the letters "266b" went into the document. Then, when I typed Alt-X, I got a beep. When I play back the macro, "266b", not the UTF-8 music symbol, goes into the document.
Last edited by AmigoJack on Thu Dec 26, 2024 8:07 am, edited 1 time in total.
Reason: reducing full quote to relevant quote
User avatar
bbadmin
Site Admin
Posts: 948
Joined: Mon Feb 17, 2003 8:54 pm
Contact:

Re: ♫ E2 99 AB beamed eighth notes

Post by bbadmin »

Hmm, it seems that the Alt+X command is not being recorded. I should have checked that!

To work around this, edit the macro using:

Configure » Preferences » Macros » your-macro » Edit

Replace "266b" with "♫" and save it.
User avatar
AmigoJack
Posts: 568
Joined: Sun Oct 30, 2016 4:28 pm
Location: グリーン ヒル ゾーン
Contact:

Re: ♫ E2 99 AB beamed eighth notes

Post by AmigoJack »

That was a typo. Of course:
  1. press Alt+X (so a text edit appears at the text cursor)
  2. type the code point (f.e. "266b" without the quotes)
  3. press ENTER (so the text edit disappears and the appropriate character ♫ is inserted into the document).
Works for me on TextPad 8.4.0 (manually - I haven't tested the macro recording as such).

In the help file you find that under How To... > Edit Text > Type Multilingual Characters.
markfilipak
Posts: 7
Joined: Sat Aug 09, 2014 8:08 pm

Re: ♫ E2 99 AB beamed eighth notes

Post by markfilipak »

Well, first: The macro from yesterday didn't survive the night.
And second: All I get is "266b" inserted into the document.
Third: Alt-X just 'dongs'.
Fourth: If I edit the macro to just the letters 266b, I get an error: "Unexpected input near 266".

Confession: I've used TP every day, all day for well over 20 years but have never been happy with the way TWSes work. In this case, '_subtitles_chapters.tws' forgot the macro created yesterday.

AmigoJack, you wrote "That was a typo." What was a typo?

Running TP 8.20.2 in Win7.
markfilipak
Posts: 7
Joined: Sat Aug 09, 2014 8:08 pm

Re: ♫ E2 99 AB beamed eighth notes

Post by markfilipak »

I've noticed something else. If I insert the UTF-8 'beamed 8th notes' character via the Clip Library, it appears in the document I'm current editing. However, the document I'm currently editing is code space 1252 -- it's a Windows '.cmd' file. That a unicode character would be inserted into a code space 1252 document doesn't make sense to me.
markfilipak
Posts: 7
Joined: Sat Aug 09, 2014 8:08 pm

Re: ♫ E2 99 AB beamed eighth notes

Post by markfilipak »

I think that, maybe, the reason that '_subtitles_chapters.tws' did not remember the macro created yesterday is because I didn't update '_subtitles_chapters.tws'? If that's the case, it would be helpful if TP prompted to update the TWS when I quit TP with a TWS that has changed.
User avatar
AmigoJack
Posts: 568
Joined: Sun Oct 30, 2016 4:28 pm
Location: グリーン ヒル ゾーン
Contact:

Re: ♫ E2 99 AB beamed eighth notes

Post by AmigoJack »

markfilipak wrote: Thu Dec 26, 2024 6:23 pmyou wrote "That was a typo." What was a typo?
This can still be read in previous posts: the original instruction was "Type 266bAlt+X" and I clarified it to "press Alt+X first, then type "266b"".
markfilipak wrote: Thu Dec 26, 2024 6:40 pmthe document I'm currently editing is code space 1252 -- it's a Windows '.cmd' file
Batch files can also be saved in UTF-16.
markfilipak wrote: Thu Dec 26, 2024 6:40 pmThat a unicode character would be inserted into a code space 1252 document doesn't make sense to me
TextPad is a text editor - it cannot foresee in which code page (not "space") you will save the current document - it doesn't has to be the same as the currently detected one. Hence, it would be too restrictive to disallow all characters which are not known to the current code page/encoding. Also ♫ is not solely a Unicode character - it already existed in code page 437.
User avatar
bbadmin
Site Admin
Posts: 948
Joined: Mon Feb 17, 2003 8:54 pm
Contact:

Re: ♫ E2 99 AB beamed eighth notes

Post by bbadmin »

That a unicode character would be inserted into a code space 1252 document doesn't make sense to me.
If a character in a document can't be saved in its original code page, you'll be prompted to choose a different encoding when you save it.
The macro from yesterday didn't survive the night.
Assuming it wasn't the scratch macro, its TWS file would still exist and can be added to the Macros menu in the usual way. It may have been removed from the menu because you had more than one instance of TextPad running and the last one to close did not have it on the menu.
If I edit the macro to just the letters 266b, I get an error: "Unexpected input near 266".
If you edit it as I suggested above, that would not happen.
gurok
Posts: 12
Joined: Tue Apr 06, 2010 3:15 am

Re: ♫ E2 99 AB beamed eighth notes

Post by gurok »

AmigoJack wrote: Fri Dec 27, 2024 8:48 am TextPad is a text editor - it cannot foresee in which code page (not "space") you will save the current document - it doesn't has to be the same as the currently detected one. Hence, it would be too restrictive to disallow all characters which are not known to the current code page/encoding. Also ♫ is not solely a Unicode character - it already existed in code page 437.
That's incorrect. In code page 437, character 14 was originally displayed as beamed sixteenth notes (♬) and represented "two musical notes". MS and later Unicode mapped that character to beamed eighth notes (♫). Other standards map it differently.
Post Reply