Skip to content

Commit

Permalink
Use mouse keys for CW modulation in SSB modulator. Fixes f4exb#1948
Browse files Browse the repository at this point in the history
  • Loading branch information
f4exb committed Mar 13, 2024
1 parent af8d63e commit b0b4fa5
Show file tree
Hide file tree
Showing 19 changed files with 313 additions and 77 deletions.
Binary file modified doc/img/ModCWControls2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/img/ModCWControls2.xcf
Binary file not shown.
30 changes: 18 additions & 12 deletions plugins/channeltx/modam/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ Enter the text to be keyed when Morse input is active and in text mode

Clears the CW (Morse) text

<h3>12: Morse keyer controls</h3>
<h3>12a: Morse keyer controls (line 1)</h3>

![Morse keyer control GUI1](../../../doc/img/ModCWControls1.png)

<h4>12.1: CW keying speed</h4>
<h4>12a.1: CW keying speed</h4>

Sets the CW speed in Words Per Minute (WPM). This is based on the word "PARIS" sent 5 times. For 5 WPM the dot length is 240 ms. In other terms the dot length is calculated as 1.2 / WPM seconds. The dot length is used as the base to compute other timings:

Expand All @@ -85,43 +85,49 @@ Sets the CW speed in Words Per Minute (WPM). This is based on the word "PARIS" s
- Character silence separator: 3 dot lengths
- Word silence separator: 7 dot lengths

<h4>12.2: Dots keying</h4>
<h4>12a.2: Dots keying</h4>

Switch this button to send dots continuously

<h4>12.3: Dashes keying</h4>
<h4>12a.3: Dashes keying</h4>

Switch this button to send dashes continuously

<h4>12.4: Text keying</h4>
<h4>12a.4: Text keying</h4>

Switch this button to send the text typed into the text box (10)

<h4>12.5: Text auto repeat</h4>
<h4>12a.5: Text auto repeat</h4>

Switch this button to auto repeat the text keying

<h4>12.6: Text play/stop</h4>
<h4>12a.6: Text play/stop</h4>

Use this button to stop sending text. When resuming keying restarts at the start of text

<h3>12a: Morse keyer controls (line 2)</h3>

![Morse keyer control GUI2](../../../doc/img/ModCWControls2.png)

&#9888; WARNING: what follows is not really useful if you do not use a proper Morse keyer with direct audio feedback. There is a significant audio delay either with the direct monitoring or by monitoring the transmitted signal so keying with this audio as feedback is not practical

12.7: Activate morse keys keyboard control
12b.1: Activate morse keys keyboard and mouse control

This disables text or continuous dots or dashes. Toggle input from keyboard. Occasionally the focus may get lost and you will have to deactivate and reactivate it to recover the key bindings.
This disables text or continuous dots or dashes. Toggle input from keyboard or mouse (see 16b.3). Occasionally the focus may get lost and you will have to deactivate and reactivate it to recover the key bindings.

12.8: Iambic or straight
12b.2: Iambic or straight

Choose iambic or straight keying style. When straight is selected the dot or dash key may be used.

12.9: Register dot key
12b.3: Mouse control pad

When keyboard and mouse control is activated move the pointer to this area to use the left button as the dot paddle and the right button as the dash paddle. In straight mode both buttons have the same effect (key down).

12a.4: Register dot key

Click on the button and while selected type a character or character and modifier (Shift + key for example) to select which key is used for dots. The key or key sequence appears next (here dot `.`)

12.10: Register dash key
12a.5: Register dash key

Click on the button and while selected type a character or character and modifier (Shift + key for example) to select which key is used for dashes. The key or key sequence appears next (here dot `.`)

Expand Down
30 changes: 18 additions & 12 deletions plugins/channeltx/modfreedv/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ Enter the text to be keyed when Morse input is active and in text mode.

Clears the CW (Morse) text

<h3>10: Morse keyer controls</h3>
<h3>10a: Morse keyer controls (line 1)</h3>

![Morse keyer control GUI1](../../../doc/img/ModCWControls1.png)

<h4>10.1: CW keying speed</h4>
<h4>10a.1: CW keying speed</h4>

Sets the CW speed in Words Per Minute (WPM). This is based on the word "PARIS" sent 5 times. For 5 WPM the dot length is 240 ms. In other terms the dot length is calculated as 1.2 / WPM seconds. The dot length is used as the base to compute other timings:

Expand All @@ -94,43 +94,49 @@ Sets the CW speed in Words Per Minute (WPM). This is based on the word "PARIS" s
- Character silence separator: 3 dot lengths
- Word silence separator: 7 dot lengths

<h4>10.2: Dots keying</h4>
<h4>10a.2: Dots keying</h4>

Switch this button to send dots continuously

<h4>10.3: Dashes keying</h4>
<h4>10a.3: Dashes keying</h4>

Switch this button to send dashes continuously

<h4>10.4: Text keying</h4>
<h4>10a.4: Text keying</h4>

Switch this button to send the text typed into the text box (13)

<h4>10.5: Text auto repeat</h4>
<h4>10a.5: Text auto repeat</h4>

Switch this button to auto repeat the text keying

<h4>10.6: Text play/stop</h4>
<h4>10a.6: Text play/stop</h4>

Use this button to stop sending text. When resuming keying restarts at the start of text

<h4>10b.1: CW keying speed</h4>

![Morse keyer control GUI2](../../../doc/img/ModCWControls2.png)

&#9888; WARNING: what follows is not really useful if you do not use a proper Morse keyer with direct audio feedback. There is a significant audio delay either with the direct monitoring or by monitoring the transmitted signal so keying with this audio as feedback is not practical

10.7: Activate morse keys keyboard control
10b.1: Activate morse keys keyboard and mouse control

This disables text or continuous dots or dashes. Toggle input from keyboard. Occasionally the focus may get lost and you will have to deactivate and reactivate it to recover the key bindings.
This disables text or continuous dots or dashes. Toggle input from keyboard or mouse (see 16b.3). Occasionally the focus may get lost and you will have to deactivate and reactivate it to recover the key bindings.

10.8: Iambic or straight
10b.2: Iambic or straight

Choose iambic or straight keying style. When straight is selected the dot or dash key may be used.

10.9: Register dot key
10b.3: Mouse control pad

When keyboard and mouse control is activated move the pointer to this area to use the left button as the dot paddle and the right button as the dash paddle. In straight mode both buttons have the same effect (key down).

10a.4: Register dot key

Click on the button and while selected type a character or character and modifier (Shift + key for example) to select which key is used for dots. The key or key sequence appears next (here dot `.`)

10.10: Register dash key
10a.5: Register dash key

Click on the button and while selected type a character or character and modifier (Shift + key for example) to select which key is used for dashes. The key or key sequence appears next (here dot `.`)

Expand Down
30 changes: 17 additions & 13 deletions plugins/channeltx/modnfm/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ Enter the text to be keyed when Morse input is active and in text mode

Clears the CW (Morse) text

<h3>17: Morse keyer controls</h3>
<h3>17a: Morse keyer controls (line 1)</h3>

![Morse keyer control GUI1](../../../doc/img/ModCWControls1.png)

<h4>17.1: CW keying speed</h4>
<h4>17a.1: CW keying speed</h4>

Sets the CW speed in Words Per Minute (WPM). This is based on the word "PARIS" sent 5 times. For 5 WPM the dot length is 240 ms. In other terms the dot length is calculated as 1.2 / WPM seconds. The dot length is used as the base to compute other timings:

Expand All @@ -183,45 +183,49 @@ Sets the CW speed in Words Per Minute (WPM). This is based on the word "PARIS" s
- Character silence separator: 3 dot lengths
- Word silence separator: 7 dot lengths

<h4>17.2: Dots keying</h4>
<h4>17a.2: Dots keying</h4>

Switch this button to send dots continuously

<h4>17.3: Dashes keying</h4>
<h4>17a.3: Dashes keying</h4>

Switch this button to send dashes continuously

<h4>17.4: Text keying</h4>
<h4>17a.4: Text keying</h4>

Switch this button to send the text typed into the text box (14)

<h4>17.5: Text auto repeat</h4>
<h4>17a.5: Text auto repeat</h4>

Switch this button to auto repeat the text keying

<h4>17.6: Text play/stop</h4>
<h4>17a.6: Text play/stop</h4>

Use this button to stop sending text. When resuming keying restarts at the start of text

<h3>18: Use keyboard for morse keying</h3>
<h3>17b: Morse keyer controls (line 2)</h3>

![Morse keyer control GUI2](../../../doc/img/ModCWControls2.png)

&#9888; WARNING: this is not really useful if you do not use a proper Morse keyer with direct audio feedback. There is a significant audio delay either with the direct monitoring or by monitoring the transmitted signal so keying with this audio as feedback is not practical

18.7: Activate morse keys keyboard control
17b.1: Activate morse keys keyboard and mouse control

This disables text or continuous dots or dashes. Toggle input from keyboard. Occasionally the focus may get lost and you will have to deactivate and reactivate it to recover the key bindings.
This disables text or continuous dots or dashes. Toggle input from keyboard or mouse (see 16b.3). Occasionally the focus may get lost and you will have to deactivate and reactivate it to recover the key bindings.

18.8: Iambic or straight
17b.2: Iambic or straight

Choose iambic or straight keying style. When straight is selected the dot or dash key may be used.

18.9: Register dot key
17b.3: Mouse control pad

When keyboard and mouse control is activated move the pointer to this area to use the left button as the dot paddle and the right button as the dash paddle. In straight mode both buttons have the same effect (key down).

17a.4: Register dot key

Click on the button and while selected type a character or character and modifier (Shift + key for example) to select which key is used for dots. The key or key sequence appears next (here dot `.`)

18.10: Register dash key
17a.5: Register dash key

Click on the button and while selected type a character or character and modifier (Shift + key for example) to select which key is used for dashes. The key or key sequence appears next (here dot `.`)

Expand Down
30 changes: 18 additions & 12 deletions plugins/channeltx/modssb/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ Enter the text to be keyed when Morse input is active and in text mode

Clears the CW (Morse) text

<h3>16: Morse keyer controls</h3>
<h3>16a: Morse keyer controls (line1)</h3>

![Morse keyer control GUI1](../../../doc/img/ModCWControls1.png)

<h4>16.1: CW keying speed</h4>
<h4>16a.1: CW keying speed</h4>

Sets the CW speed in Words Per Minute (WPM). This is based on the word "PARIS" sent 5 times. For 5 WPM the dot length is 240 ms. In other terms the dot length is calculated as 1.2 / WPM seconds. The dot length is used as the base to compute other timings:

Expand All @@ -174,43 +174,49 @@ Sets the CW speed in Words Per Minute (WPM). This is based on the word "PARIS" s
- Character silence separator: 3 dot lengths
- Word silence separator: 7 dot lengths

<h4>16.2: Dots keying</h4>
<h4>16a.2: Dots keying</h4>

Switch this button to send dots continuously

<h4>16.3: Dashes keying</h4>
<h4>16a.3: Dashes keying</h4>

Switch this button to send dashes continuously

<h4>16.4: Text keying</h4>
<h4>16a.4: Text keying</h4>

Switch this button to send the text typed into the text box (13)

<h4>16.5: Text auto repeat</h4>
<h4>16a.5: Text auto repeat</h4>

Switch this button to auto repeat the text keying

<h4>16.6: Text play/stop</h4>
<h4>16a.6: Text play/stop</h4>

Use this button to stop sending text. When resuming keying restarts at the start of text

<h3>16b: Morse keyer controls (line2)</h3>

![Morse keyer control GUI2](../../../doc/img/ModCWControls2.png)

&#9888; WARNING: what follows is not really useful if you do not use a proper Morse keyer with direct audio feedback. There is a significant audio delay either with the direct monitoring or by monitoring the transmitted signal so keying with this audio as feedback is not practical

16.7: Activate morse keys keyboard control
16b.1: Activate morse keys keyboard and mouse control

This disables text or continuous dots or dashes. Toggle input from keyboard. Occasionally the focus may get lost and you will have to deactivate and reactivate it to recover the key bindings.
This disables text or continuous dots or dashes. Toggle input from keyboard or mouse (see 16b.3). Occasionally the focus may get lost and you will have to deactivate and reactivate it to recover the key bindings.

16.8: Iambic or straight
16b.2: Iambic or straight

Choose iambic or straight keying style. When straight is selected the dot or dash key may be used.

16.9: Register dot key
16b.3: Mouse control pad

When keyboard and mouse control is activated move the pointer to this area to use the left button as the dot paddle and the right button as the dash paddle. In straight mode both buttons have the same effect (key down).

16b.4: Register dot key

Click on the button and while selected type a character or character and modifier (Shift + key for example) to select which key is used for dots. The key or key sequence appears next (here dot `.`)

16.10: Register dash key
16b.5: Register dash key

Click on the button and while selected type a character or character and modifier (Shift + key for example) to select which key is used for dashes. The key or key sequence appears next (here dot `.`)

Expand Down
2 changes: 1 addition & 1 deletion plugins/channeltx/modssb/ssbmodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ void SSBModGUI::audioSelect(const QPoint& p)
void SSBModGUI::audioFeedbackSelect(const QPoint& p)
{
qDebug("SSBModGUI::audioFeedbackSelect");
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName, false); // false for output
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_feedbackAudioDeviceName, false); // false for output
audioSelect.move(p);
new DialogPositioner(&audioSelect, false);
audioSelect.exec();
Expand Down
37 changes: 23 additions & 14 deletions plugins/channeltx/modssb/ssbmodsource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ SSBModSource::SSBModSource() :
m_spectrumSink(nullptr),
m_audioSampleRate(48000),
m_audioFifo(12000),
m_feedbackAudioFifo(48000),
m_feedbackAudioFifo(12000),
m_levelCalcCount(0),
m_peakLevel(0.0f),
m_levelSum(0.0f),
Expand All @@ -55,7 +55,7 @@ SSBModSource::SSBModSource() :
m_audioReadBuffer.resize(24000);
m_audioReadBufferFill = 0;

m_feedbackAudioBuffer.resize(1<<14);
m_feedbackAudioBuffer.resize(4800);
m_feedbackAudioBufferFill = 0;

m_demodBuffer.resize(1<<12);
Expand Down Expand Up @@ -538,22 +538,31 @@ void SSBModSource::pushFeedback(Complex c)

void SSBModSource::processOneSample(Complex& ci)
{
m_feedbackAudioBuffer[m_feedbackAudioBufferFill].l = ci.real();
m_feedbackAudioBuffer[m_feedbackAudioBufferFill].r = ci.imag();
++m_feedbackAudioBufferFill;

if (m_feedbackAudioBufferFill >= m_feedbackAudioBuffer.size())
if (m_settings.m_modAFInput == SSBModSettings::SSBModInputCWTone) // minimize latency for CW
{
uint res = m_feedbackAudioFifo.write((const quint8*)&m_feedbackAudioBuffer[0], m_feedbackAudioBufferFill);
m_feedbackAudioBuffer[0].l = ci.real();
m_feedbackAudioBuffer[0].r = ci.imag();
m_feedbackAudioFifo.writeOne((const quint8*) &m_feedbackAudioBuffer[0]);
}
else
{
m_feedbackAudioBuffer[m_feedbackAudioBufferFill].l = ci.real();
m_feedbackAudioBuffer[m_feedbackAudioBufferFill].r = ci.imag();
++m_feedbackAudioBufferFill;

if (res != m_feedbackAudioBufferFill)
if (m_feedbackAudioBufferFill >= m_feedbackAudioBuffer.size())
{
qDebug("SSBModSource::pushFeedback: %u/%u audio samples written m_feedbackInterpolatorDistance: %f",
res, m_feedbackAudioBufferFill, m_feedbackInterpolatorDistance);
m_feedbackAudioFifo.clear();
}
uint res = m_feedbackAudioFifo.write((const quint8*)&m_feedbackAudioBuffer[0], m_feedbackAudioBufferFill);

m_feedbackAudioBufferFill = 0;
if (res != m_feedbackAudioBufferFill)
{
qDebug("SSBModSource::pushFeedback: %u/%u audio samples written m_feedbackInterpolatorDistance: %f",
res, m_feedbackAudioBufferFill, m_feedbackInterpolatorDistance);
m_feedbackAudioFifo.clear();
}

m_feedbackAudioBufferFill = 0;
}
}
}

Expand Down
Loading

0 comments on commit b0b4fa5

Please sign in to comment.