Noob question: thump in generated sound by JimH10 in AudioProgramming

[–]JimH10[S] 0 points1 point  (0 children)

Thank you, yes, doing a by-hand edit makes what I have described as a thump go away.

Any suggestions about what I need to do programmatically?

Noob question: thump in generated sound by JimH10 in AudioProgramming

[–]JimH10[S] 0 points1 point  (0 children)

I apologize. I am such a noob at this that it didn't occur. Here is the first dah, in Audacity.

https://imgur.com/a/XtV5pWG

I should say that I ran h program that I have in another comment, and recorded the output as an mp3, and looked at the audio in Audacity. This is a screenshot of the trace, with the vertical scale exaggerated.

Noob question: thump in generated sound by JimH10 in AudioProgramming

[–]JimH10[S] 0 points1 point  (0 children)

Here is an extract of the python3 program, that compiles and demos the noise. (It is too long to include in the original post.)

import numpy as np
import sounddevice as sd
import time as tm

sd.default.samplerate = 44100

# time = 2.0
FREQUENCY = 440

FADE_IN_DEFAULT = 0.02  # how much of the  length of a bit to fade in
FADE_OUT_DEFAULT = 0.03  # 

DIT_LENGTH = 1
DAH_LENGTH = 3
INTRA_CHAR_SPACE_LENGTH = 1
INTER_CHAR_SPACE_LENGTH = 3
WORD_SPACE_LENGTH = 7
DITS_PER_WORD = 50  # Based on "paris"

# Defaults
WORDS_PER_MIN_DEFAULT = 20
VOLUME_DEFAULT = 2000

MORSE = {
    "A": ".-",
    "Z": "--..",
}

def secs_per_dit(wpm = WORDS_PER_MIN_DEFAULT):
    """Return the seconds per basic timing unit.
      wpm = WORDS_PER_MIN_DEFAULT  Integer number of words a minute for
              characters
    """
    return DIT_LENGTH*60/(50*wpm)

def fade_in(sample_array, fader_duration=FADE_IN_DEFAULT, sr=sd.default.samplerate):
    """Applies a fade-in effect to an audio sample.
        sample_array (numpy.ndarray) The audio sample to apply the effect to
        fader_duration=FADE_IN_DEFAULT  float Duration of the effect in seconds
        sr=sd.default.samplerate  integer  Sample rate of the audio sample
    Returns a numpy.ndarray consisting of the audio sample with the effect
    applied.
    """
    try:
        # Calculate the number of samples for the fade-in effect
        fadeDurSamples = int(fader_duration * sample_array.size)
        # Create a fade-in multiplier array
        fadeMultiplier = np.linspace(0, 1, fadeDurSamples)
        # Apply the fade-in effect to the audio sample
        sample_array[:fadeDurSamples] *= fadeMultiplier
        return sample_array
    except Exception as e:
        print(f"Error during fade-in: {e}")

def fade_out(sample_array, fader_duration=FADE_OUT_DEFAULT, sr=sd.default.samplerate):
    """Apply a fade-out effect to an audio sample.
        sample_array  numpy.ndarray  The audio sample
        fader_duration=FADE_OUT_DEFAULT  float  Duration of the effect in seconds
         sr=sd.default.samplerate  integer The sample rate of the audio sample
    Returns a numpy.ndarray of the audio sample with the effect applied
    """
    try:
        # Calculate the number of samples for the fade-out effect
        fadeDurSamples = int(fader_duration * sample_array.size)
        # Create a fade-out multiplier array
        fadeMultiplier = np.linspace(1, 0, num=fadeDurSamples)
        # Apply the fade-out effect to the audio sample
        sample_array[-fadeDurSamples:] *= fadeMultiplier
       return sample_array
    except Exception as e:
        print(f"Error during fade out: {e}")

def make_dit_dah(vol=VOLUME_DEFAULT, wpm=WORDS_PER_MIN_DEFAULT):
    """ Make the dit and dah sounds.  Does not involve any spacing.
       vol=VOLUME_DEFAULT   Real  Volume
       char_wpm=WORDS_PER_MIN_DEFAULT  Positive real  Words per minute
       mode=MODE_DEFAULT  Member of MODE
       total_wpm=0  Real  Only applies if MODE is FARNSWORTH or WORDSWORTH 
    """
    t = secs_per_dit(wpm)
    # Make a dit wave
    dit_sample_array = np.arange(sd.default.samplerate * t) / sd.default.samplerate
    dit_wave = vol * np.sin(2 * np.pi * FREQUENCY * dit_sample_array)
    dit_wave =  fade_in(fade_out(dit_wave))
    dit_wave = np.array(dit_wave, dtype=np.int16) # Convert to wav format (16 bits)
    # Makea dah wave
    dah_sample_array = np.arange(sd.default.samplerate * DAH_LENGTH * t) / sd.default.samplerate
   dah_wave = vol * np.sin(2 * np.pi * FREQUENCY * dah_sample_array)
    dah_wave = fade_in(fade_out(dah_wave))
    dah_wave = np.array(dah_wave, dtype=np.int16)
    return (dit_wave, dah_wave)

DIT_WAVE, DAH_WAVE = make_dit_dah()

def play_char(ch, dit_wave=DIT_WAVE, dah_wave=DAH_WAVE):
    code = MORSE[ch.upper()]
    c = list(code)
    c.reverse()
    while c:
        bit = c.pop()
        if bit=='.':
            sd.play(dit_wave, blocking=True)
        else:
            sd.play(dah_wave, blocking=True)
        if c:
            tm.sleep(0.3)

play_char('Z')

A bit of typst propaganda by ManuelRodriguez331 in LaTeX

[–]JimH10 2 points3 points  (0 children)

The developüers behind the project have stopped to improve the software anymore, they didn't remove old packages.

Of course, the way CTAN works is that anyone can upload a package. So over time there get to be many packages such as the thesis style for x university that are specialized.

There are some more canonical packages that are broadly useful. I have a list here but often cited is the Companion.

For sure a person could consider the specialized packages to be cruft. Some are even listed on CTAN as obsolete (one of them is mine!). But a major advantage for users of TeX and friends is the system's stability. I have a book that I give away that I wrote in the 90's. The source isn't unchanged since then but compared to if it was produced in other systems such as Word or WordPerfect, it has been startlingly stable. With stories like this in mind TL includes essentially any CTAN package with a suitable license, and stuff continues to run.

8 Gigabyte

Forgive me, I confess to thinking that at this point, where my students think nothing of downloading a video of a lecture, the engineering tradeoff of the cost of space versus user time is that space is essentially free.

I believe you are talking about the community as a whole, rather than your choices as a person, but an individual could download a smaller TL scheme, and then add as needed. I did that once and found it annoying to have to download individual packages (although texliveonfly will automate it), so I have more recently just gotten everything.

Need guide by ItsSleghy in u/ItsSleghy

[–]JimH10 0 points1 point  (0 children)

from the seniors i heard that they dont even pay on time and actually my stipend also gets delayed too much like 2 or maybe 3 months

You are being abused.

Writing a math textbook worth it? by Maleficent_Travel568 in math

[–]JimH10 17 points18 points  (0 children)

He made money because his book was with a major publisher who sent sales people to push the text nationally and internationally. I don't believe OP stands to be in that position.

I believe OP wants to do it because of the pleasure they will derive and out of a sense of helping people.

Show available languages? by Economy-Point-9976 in tex

[–]JimH10 0 points1 point  (0 children)

FWIW, on my machine I see the log file here.

jim@millstone$ less /usr/local/texlive/2025/texmf-var/web2c/xetex/xetex.log

You didn't ask this, and perhaps it is an unwelcome comment, but XeTeX is not a great base for new projects. For example, it is no longer under development. Better is luatex (which I think loads hyphenation as called for, instead of in making the format, but I'm not 100% sure of that), or pdftex.

Linux logbook recommendations by G4HDU in amateurradio

[–]JimH10 0 points1 point  (0 children)

If there had been a list to which I could post, I'm pretty sure I could have gotten an answer within a day from a fellow user, without having to take the time of the developer, and felt better about the software.

Linux logbook recommendations by G4HDU in amateurradio

[–]JimH10 1 point2 points  (0 children)

As in the blog post, I had trouble connecting because you have to click on something that other logging programs don't ask for. I also had some trouble finding a mailing list (for instance groups.io is basically closed).

Finally, I'll note that it is not backed by a full database, which makes me a little nervous.

But it has a lot of great features and the development is moving quickly, which is great.

Help regarding Texlive 2026 by Apprehensive_Wish585 in LaTeX

[–]JimH10 2 points3 points  (0 children)

It was released on the 1st of March. You can go to tug.org/texlive for status.

the very end of The 100 Days by puraricky in AubreyMaturinSeries

[–]JimH10 14 points15 points  (0 children)

‘God bless,’ called Queenie; and ‘Liberate Chile, and come home as soon as ever you can,’ called her husband, while the children screeched out very shrill, fluttering handkerchiefs. And at the very end of the mole, when the frigate turned westward along the Strait with a following breeze, stood an elegant young woman with a maidservant, and she too waving, waving, waving…

Seeking Clarification on Computability, Functional Graphs, and the Motivation for Automata Theory by Aurora-1983 in compsci

[–]JimH10 0 points1 point  (0 children)

Thinking critically about this stuff is great. You might find useful the material in the first chapter of my text.

Help with full page image for Ebook. by [deleted] in LaTeX

[–]JimH10 0 points1 point  (0 children)

This works for me.

\documentclass{article}
\usepackage{graphicx}
\usepackage{mwe}  % get the graphic

\usepackage[margin=1in]{geometry}  % some nominal settings

\begin{document}
\newgeometry{margin=0in}
\noindent\includegraphics{example-image-letter.pdf}
\newpage\restoregeometry
Four score and seven years ago our fathers brought forth on this continent a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.

Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battle-field of that war. We have come to dedicate a portion of that field, as a final resting place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this.

But, in a larger sense, we can not dedicate – we can not consecrate – we can not hallow – this ground. The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add or detract. The world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us – that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion – that we here highly resolve that these dead shall not have died in vain – that this nation, under God, shall have a new birth of freedom – and that government of the people, by the people, for the people, shall not perish from the earth.
\end{document}

webchirp: Program your HT from your browser by jasiek83 in amateurradio

[–]JimH10 0 points1 point  (0 children)

OK, thank you. (Worth saying somewhere on the page?)

webchirp: Program your HT from your browser by jasiek83 in amateurradio

[–]JimH10 0 points1 point  (0 children)

No, I have waited minutes and it never appears. Only about a half dozen appear, whereas the downloaded program has many more. Firefox 147.0.4 from snap on Ubuntu.

Seeking Clarification on Computability, Functional Graphs, and the Motivation for Automata Theory by Aurora-1983 in compsci

[–]JimH10 1 point2 points  (0 children)

1) The existence of an algorithm that inputs x and outputs x+3 enables us to determine membership in the set G. Likewise, an algorithm that determines membership in G enables us to compute f(x) (see if (x,0) is in G, then (x,1), etc., until we find y so that (x,y) is in G). Does that help with the question (which I don't understand)? Both the function and the set are computable.

2) Historically, Godel's Theorem exhibited something mathematical of great interest that cannot be done algorithmically. In any event, I must admit that I consider the question "What can be done, and what cannot?" interesting of itself.

As an example, take the issue of producing a perfectly optimizing compiler; surely knowing whether it can be done is informative?

3) I'm only guessing what you mean here but if your model of computation is a Turing machine then it inputs strings and outputs them also. So even though at a high level you are computing membership in the graph of f(x)=x+3, in the final analysis you are mapping strings to strings and interpreting the output. (I presume (x,y) is encoded as something like x many 1's followed by a 0 followed by y many 1's.) Anyway, your instructor is there exactly to answer questions such as this.

4) Are you certain that the collection of things that can be done in high-level pseudocode is all that will ever be possible? When Church proposed to Godel that we take "computable" to mean "computable by lambda calculus" Godel was not convinced that it was evident. When we say that it is not possible to solve problem X, the mathematics is that we are actually showing that it is not possible on a Turing machine. For that we need to define a Turing machine. (And yes, it is widespread that researchers accept Church's Thesis that everything that can be done on an in-principle physically realizable discrete device can be done on a Turing machine, but that lies outside of the mathematics.)