Tunes v1

14 views
Skip to first unread message

Carlo Hogeveen

unread,
Jul 14, 2025, 12:21:15 PM7/14/25
to Semware @ GoogleGroups

I turned the quick hack I posted yesterday into a proper tool:
- Added documentation.
- Made the code readable.
- Improved the sound quality (on my computer, your mileage may vary).
- It should no longer be necessary to play a tune overly slow.
- Doubled the amount of predefined tunes. :-)
- Added a menu:
- It lets you set the duration in milliseconds of the shortest note:
You can set it higher/lower to play a tune slower/faster.
- It lets you pick a tune from all the predefined tunes.
- It lets you play the selected tune! :-)

Tune notation is based on real music notation.

https://ecarlo.nl/tse/ToolsAndExtensions.html#Tunes

Carlo



Knud van Eeden

unread,
Jul 16, 2025, 4:14:59 AM7/16/25
to sem...@googlegroups.com, Knud van Eeden
Interesting. 

FYI: 'Shortest note' still has to be 400 (instead of default 200) here to get recognizable music output.

with friendly greetings
Knud van Eeden



--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/semware/000001dbf4db%244f805ff0%24ee811fd0%24%40ecarlo.nl.

knud van eeden

unread,
Jul 16, 2025, 6:17:52 AM7/16/25
to sem...@googlegroups.com
> The tool cannot play notes below C2 and above B8.

Maybe this is something SemWare might be able to resolve?

with friendly greetings
Knud van Eeden

knud van eeden

unread,
Jul 16, 2025, 7:46:42 AM7/16/25
to sem...@googlegroups.com
>> From 'tunes.s': The tool cannot play notes below C2 and above B8.

> Maybe this is something SemWare might be able to resolve?

===

FYIO:

C2 corresponds to a frequency of 65.41 Hertz

B8 corresponds to a frequency of 7902.13 Hertz

===

 Q. TSE: About Sound():

Turns on the PC speaker and causes it to sound at a specified frequency, for
the specified duration.

Syntax:     Sound(INTEGER frequency, INTEGER duration)

            - frequency is the pitch of the tone to be issued, in hertz
              (cycles per second).

            - duration is the time, in milliseconds, for the tone to persist.

Returns:    Nothing.

Notes:      Under WINNT4/2000/XP, Sound() performs as stated.

            Under WIN95/98/Me, frequency and duration are ignored, and the
            following action occurs:

            If the system is configured with a sound card, the "default sound
            event" is played; otherwise, the "standard system beep" is sent
            to the PC speaker.

Examples:

            /********************************************************
             Sound the PC speaker with a 1000-Hz signal for about 1
             second (WINNT4/2000/XP ONLY)
             ********************************************************/
            Sound(1000, 18)


Reply all
Reply to author
Forward
0 new messages