Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Action to find typos and lint Python code #493

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This Action uses minimal steps to run in ~5 seconds to rapidly:
# look for typos in the codebase using codespell, and
# lint Python code using ruff and provide intuitive GitHub Annotations to contributors.
# https://github.com/codespell-project/codespell#readme
# https://docs.astral.sh/ruff/
name: ci
on:
push:
# branches: [main, master]
pull_request:
# branches: [main, master]
jobs:
codespell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: codespell-project/actions-codespell@v2
with:
ignore_words_list: blockin,dout,ethe,fo,reson,rin,shiftin,siz
skip: "*.min.js"
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v3
2 changes: 1 addition & 1 deletion Resampler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ void Resampler::resample(float* input0, float* input1, uint16_t inputLength, uin
}
}
if(outputCount < outputLength){
//ouput vector not full -> we ran out of input samples
//output vector not full -> we ran out of input samples
processedLength=inputLength;
}
else{
Expand Down
2 changes: 1 addition & 1 deletion Resampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class Resampler {
}
}
if(outputCount < outputLength){
//ouput vector not full -> we ran out of input samples
//output vector not full -> we ran out of input samples
processedLength=inputLength;
}
else{
Expand Down
2 changes: 1 addition & 1 deletion analyze_fft1024.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void AudioAnalyzeFFT1024::update(void)
case 7:
blocklist[7] = block;
// TODO: perhaps distribute the work over multiple update() ??
// github pull requsts welcome......
// github pull requests welcome......
copy_to_fft_buffer(buffer+0x000, blocklist[0]->data);
copy_to_fft_buffer(buffer+0x100, blocklist[1]->data);
copy_to_fft_buffer(buffer+0x200, blocklist[2]->data);
Expand Down
2 changes: 1 addition & 1 deletion analyze_tonedetect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ AudioAnalyzeToneDetect::operator bool()

//Serial.printf("bool: power=%d, trig=%d\n", power, trigger);
return (power >= trigger);
// TODO: this should really remember if it's retuned true previously,
// TODO: this should really remember if it's returned true previously,
// so it can give a single true response each time a tone is seen.
}

Expand Down
2 changes: 1 addition & 1 deletion control_cs42448.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ bool AudioControlCS42448::inputLevelInteger(int32_t n)
return write(CS42448_DAC_Channel_Invert, data, 7);
}

bool AudioControlCS42448::inputLevelInteger(int chnnel, int32_t n)
bool AudioControlCS42448::inputLevelInteger(int channel, int32_t n)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code change! Careful review, please.

{

return true;
Expand Down
2 changes: 1 addition & 1 deletion control_cs42448.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class AudioControlCS42448 : public AudioControl
bool volumeInteger(uint32_t n);
bool volumeInteger(int channel, uint32_t n);
bool inputLevelInteger(int32_t n);
bool inputLevelInteger(int chnnel, int32_t n);
bool inputLevelInteger(int channel, int32_t n);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code change! Careful review, please.

// convert level to volume byte, section 6.9.1, page 50
uint32_t volumebyte(float level) {
if (level >= 1.0f) return 0;
Expand Down
2 changes: 1 addition & 1 deletion control_tlv320aic3206.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ bool AudioControlTLV320AIC3206::setMicBias(int n) {
}

void AudioControlTLV320AIC3206::aic_reset() {
if (debugToSerial) Serial.println("INFO: Reseting AIC");
if (debugToSerial) Serial.println("INFO: Resetting AIC");
aic_writePage(0x00, 0x01, 0x01);
// aic_writeAddress(0x0001, 0x01);

Expand Down
2 changes: 1 addition & 1 deletion effect_delay.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class AudioEffectDelay : public AudioStream
}
void disable(uint8_t channel) {
if (channel >= 8) return;
// diable this channel
// disable this channel
activemask &= ~(1<<channel);
// recompute maxblocks for remaining enabled channels
recompute_maxblocks();
Expand Down
4 changes: 2 additions & 2 deletions effect_granular.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ void AudioEffectGranular::update(void)
sample_req = false;
allow_len_change = true; // Reduces noise by not allowing the
// length to change after the sample has been
// recored. Kind of not too much though
// recorded. Kind of not too much though
if (write_head >= glitch_len) {
write_head = 0;
sample_loaded = true;
Expand All @@ -166,7 +166,7 @@ void AudioEffectGranular::update(void)

if (sample_loaded) {
//move it to the middle third of the bank.
//3 "seperate" banks are used
//3 "separate" banks are used
float fade_len = 20.00;
int16_t m2 = fade_len;

Expand Down
2 changes: 1 addition & 1 deletion effect_midside.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void AudioEffectMidSide::update(void)
// R[i] = mid[i] - side[i]);
// Because the /2 has already been applied in the encoding,
// we shouldn't have to add it here.
// However... because of the posibility that the user has
// However... because of the possibility that the user has
// modified mid or side such that
// it could overflow, we have to:
// a) preventively do a (x/2+y/2)*2 again, causing bit reduction
Expand Down
2 changes: 1 addition & 1 deletion effect_reverb.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Author: Joao Rossi Filho
* [email protected]
*
* Soon I'll make a commit with nice comments and discription
* Soon I'll make a commit with nice comments and description
*
* Copyright (c) 2016 Joao Rossi FIlho
*
Expand Down
2 changes: 1 addition & 1 deletion examples/Analysis/NoteFrequency/NoteFrequency.ino
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void setup() {
*/
notefreq.begin(.15);
pinMode(LED_BUILTIN, OUTPUT);
// Audio library isr allways gets priority
// Audio library isr always gets priority
playNoteTimer.priority(144);
playNoteTimer.begin(playNote, 1000);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/Dynamic/DynamicPatching/DynamicPatching.ino
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void loop()
{
audioUpdates++;
audioUpdated = true; // audio engine just updated
queue.readBuffer(); // not intereseted in contents,
queue.readBuffer(); // not interested in contents,
queue.freeBuffer(); // just that
}

Expand Down
2 changes: 1 addition & 1 deletion examples/Effects/Bitcrusher/Bitcrusher.ino
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void setup() {

// Audio connections require memory to work. For more
// detailed information, see the MemoryAndCpuUsage example
AudioMemory(40); //this is WAY more tha nwe need
AudioMemory(40); //this is WAY more than we need

// turn on the output
audioShield.enable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void loop() {
Serial.print("anti-aliasing attenuation: ");
Serial.println(spdifIn.getAttenuation());

Serial.print("resampling goup delay [milli seconds]: ");
Serial.print("resampling group delay [milli seconds]: ");
Serial.println(spdifIn.getHalfFilterLength()/inputFrequency*1e3,2);

Serial.print("half filter length: ");
Expand Down
2 changes: 1 addition & 1 deletion examples/Queues/PlayQueueDemo/PlayQueueDemo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* can be changed to modify the usage of audio blocks, and an
* ability to execute the loop() function more slowly, with
* simple waveform generation, or more efficiently / faster,
* but requring some programmer effort to re-try if sending
* but requiring some programmer effort to re-try if sending
* waveform data fails due to a lack of buffer or queue space.
*
* This example code is in the public domain.
Expand Down
4 changes: 2 additions & 2 deletions examples/Synthesis/Waveforms/Waveforms.ino
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void setup() {
sgtl5000_1.enable();
sgtl5000_1.volume(0.8); // caution: very loud - use oscilloscope only!

// Confirgure both to use "myWaveform" for WAVEFORM_ARBITRARY
// Configure both to use "myWaveform" for WAVEFORM_ARBITRARY
waveform1.arbitraryWaveform(myWaveform, 172.0);
waveform2.arbitraryWaveform(myWaveform, 172.0);

Expand Down Expand Up @@ -114,7 +114,7 @@ void loop() {
break;
case WAVEFORM_TRIANGLE_VARIABLE:
current_waveform = WAVEFORM_ARBITRARY;
Serial.println("Arbitary Waveform");
Serial.println("Arbitrary Waveform");
break;
case WAVEFORM_ARBITRARY:
current_waveform = WAVEFORM_PULSE;
Expand Down
4 changes: 2 additions & 2 deletions examples/Synthesis/WaveformsModulated/WaveformsModulated.ino
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void setup() {
sgtl5000_1.enable();
sgtl5000_1.volume(0.8); // caution: very loud - use oscilloscope only!

// Confirgure both to use "myWaveform" for WAVEFORM_ARBITRARY
// Configure both to use "myWaveform" for WAVEFORM_ARBITRARY
waveformMod1.arbitraryWaveform(myWaveform, 172.0);

// Configure for middle C note without modulation
Expand Down Expand Up @@ -114,7 +114,7 @@ void loop() {
break;
case WAVEFORM_TRIANGLE_VARIABLE:
current_waveform = WAVEFORM_ARBITRARY;
Serial.println("Arbitary Waveform");
Serial.println("Arbitrary Waveform");
break;
case WAVEFORM_ARBITRARY:
current_waveform = WAVEFORM_PULSE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ void loop() {
}

// after 4 seconds of inactivity, go back to
// steady listening intead of the envelope
// steady listening instead of the envelope
if (mixer2_envelope == true && timeout > 4000) {
mixer2.gain(0, 0.15);
mixer2.gain(1, 0.0);
Expand Down
8 changes: 4 additions & 4 deletions extras/miditones/miditones.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
* tone generators without any volume or tone controls.
*
* Volume ("velocity") and instrument specifications in the MIDI files are discarded.
* All the tracks are prcoessed and merged into a single time-ordered stream of
* All the tracks are processed and merged into a single time-ordered stream of
* "note on", "note off", and "delay" commands.
*
* This was written for the "Playtune" Arduino library, which plays polyphonic music
Expand Down Expand Up @@ -101,7 +101,7 @@
* miditones chopin
*
* It will create a file in the same directory called "chopin.c" which contains
* the C-language statement to intiialize an array called "score" with the bytestream.
* the C-language statement to initialize an array called "score" with the bytestream.
*
*
* The general form for command line execution is this:
Expand Down Expand Up @@ -134,7 +134,7 @@
* The default is 6 tone generators, and the maximum is 16.
* The program will report how many notes had to be discarded because there
* weren't enough tone generators. Note that for the Arduino Playtunes
* library, it's ok to have the bytestream use more tone genreators than
* library, it's ok to have the bytestream use more tone generators than
* exist on your processor because any extra notes will be ignored, although
* it does make the file bigger than necessary . Of course, too many ignored
* notes will make the music sound really strange!
Expand Down Expand Up @@ -811,7 +811,7 @@ int main(int argc,char *argv[]) {
}

/* Continue processing all tracks, in an order based on the simulated time.
This is not unlike multiway merging used for tape sorting algoritms in the 50's! */
This is not unlike multiway merging used for tape sorting algorithms in the 50's! */

tracknum = 0;
if (!parseonly) do { /* while there are still track notes to process */
Expand Down
30 changes: 15 additions & 15 deletions gui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ <h3>Functions</h3>
<p class=desc>Returns the sample rate of incoming data, if the PLL has locked, or returns 0 if the audio sample rate is unknown.
</p>
<p class=func><span class=keyword>getTargetLantency</span>();</p>
<p class=desc>Returns the target latency in seconds. The latency is the time from the moment a sample is received by the Teensy SPDIF hardware receiver until it is transmitted by the asrc intput. The audio samples arrive at the asrc input in chunks of 32 samples per channel. The target latency consists of these 32 samples + some buffer that is needed to compensate for timing variations.
<p class=desc>Returns the target latency in seconds. The latency is the time from the moment a sample is received by the Teensy SPDIF hardware receiver until it is transmitted by the asrc input. The audio samples arrive at the asrc input in chunks of 32 samples per channel. The target latency consists of these 32 samples + some buffer that is needed to compensate for timing variations.
</p>
<p class=func><span class=keyword>getAttenuation</span>();</p>
<p class=desc>
Expand All @@ -955,7 +955,7 @@ <h3>Examples</h3>
<p class=exam>File &gt; Examples &gt; Audio &gt; HardwareTesting &gt; PassThroughAsyncSpdif
</p>
<h3>Notes</h3>
<p>AsyncAudioInputSPDIF3 is not able to clock the audio pipline (never has the 'update_responsibility'). At least 1 other input or output must be used to cause the entire Audio library to update.
<p>AsyncAudioInputSPDIF3 is not able to clock the audio pipeline (never has the 'update_responsibility'). At least 1 other input or output must be used to cause the entire Audio library to update.
</p>

<p>AsyncAudioInputSPDIF3 can optionally take parameters to alter its resampling behavior.
Expand Down Expand Up @@ -1055,7 +1055,7 @@ <h3>Notes</h3>
<p>Algorithm for automatic DC bias tracking</p>
<p>Noise coupling from digital circuitry inside the chip is always a problem when using
ADC inputs pin. It's never as quiet as the audio shield and any good quality
audio ADC chip. Stong low impedance drive to the analog input pin is critical
audio ADC chip. Strong low impedance drive to the analog input pin is critical
to minimizing noise coupling. If an opamp is used, connect a low value resistor
(eg, 100 to 1000 ohms)
between the opamp output and ADC input pin, and a 1nF capacitor from the ADC pin
Expand Down Expand Up @@ -1824,7 +1824,7 @@ <h3>Examples</h3>
<h3>Credits</h3>
<p><a href="https://github.com/FrankBoesing" target="_blank">Frank Boesing</a>
developed the AudioOutputSPDIF code. The original
<a href="https://forum.pjrc.com/threads/28639-S-pdif" target="_blank">forum disussion</a>
<a href="https://forum.pjrc.com/threads/28639-S-pdif" target="_blank">forum discussion</a>
included valuable input and code from "kpc".
<h3>Notes</h3>
<p>S/PDIF output uses the I2S hardware. This object can not be used
Expand Down Expand Up @@ -1876,7 +1876,7 @@ <h3>Examples</h3>
<h3>Credits</h3>
<p><a href="https://github.com/FrankBoesing" target="_blank">Frank Boesing</a>
developed the AudioOutputSPDIF code. The original
<a href="https://forum.pjrc.com/threads/28639-S-pdif" target="_blank">forum disussion</a>
<a href="https://forum.pjrc.com/threads/28639-S-pdif" target="_blank">forum discussion</a>
included valuable input and code from "kpc".
<h3>Notes</h3>
<p>S/PDIF output uses the I2S2 hardware. This object can not be used
Expand Down Expand Up @@ -1979,7 +1979,7 @@ <h3>Examples</h3>
<h3>Credits</h3>
<p>Frank Boesing and Benjamin developed this PT8211 object. Details can be
found on this
<a href="https://forum.pjrc.com/threads/29284-Dual-channel-16bit-dac-PT8211/page3" target="_blank">forum disussion</a>.
<a href="https://forum.pjrc.com/threads/29284-Dual-channel-16bit-dac-PT8211/page3" target="_blank">forum discussion</a>.
<h3>Notes</h3>
<p>
</p>
Expand Down Expand Up @@ -2025,7 +2025,7 @@ <h3>Examples</h3>
<h3>Credits</h3>
<p>Frank Boesing and Benjamin developed this PT8211 object. Details can be
found on this
<a href="https://forum.pjrc.com/threads/29284-Dual-channel-16bit-dac-PT8211/page3" target="_blank">forum disussion</a>.
<a href="https://forum.pjrc.com/threads/29284-Dual-channel-16bit-dac-PT8211/page3" target="_blank">forum discussion</a>.
<h3>Notes</h3>
<p>
</p>
Expand Down Expand Up @@ -4229,7 +4229,7 @@ <h3>Hardware</h3>
</table>
</p>
<p>When <span class=literal>AUDIO_MEMORY_CY15B104</span> is used, a single
CY15B104 FRAM chip is used, with these pins:
CY15B104 F-RAM chip is used, with these pins:
<table class=doc align=center cellpadding=3>
<tr class=top><th>Pin</th><th>Signal</th></tr>
<tr class=odd><td align=center>6</td><td>CS</td></tr>
Expand Down Expand Up @@ -4641,7 +4641,7 @@ <h3>Known Issues</h3>
the length to 4.
</p>
<p>The impulse response must be given in reverse order. Many filters have
symetrical impluse response, making this a non-issue. If your filter has
symmetrical impluse response, making this a non-issue. If your filter has
a non-symetrical response, make sure the data is in reverse time order.
</p>
<h3>Notes</h3>
Expand Down Expand Up @@ -5278,7 +5278,7 @@ <h3>Signal Levels</h3>
31: 1.16 Volts p-p
</pre>
<p class=func><span class=keyword>lineOutLevel</span>(left, right);</p>
<p class=desc>Adjust the line level outout voltage range, with separate
<p class=desc>Adjust the line level output voltage range, with separate
settings for left and right. The same settings (13 to 31) are available.
</p>

Expand All @@ -5292,7 +5292,7 @@ <h3>Signal Conditioning</h3>
<p class=func><span class=keyword>adcHighPassFilterFreeze</span>();</p>
<p class=desc>By default, the analog input (either line-level inputs or mic)
is high-pass filtered, to remove any DC component. This function
freezes the filter, so the current DC component is still substracted, but
freezes the filter, so the current DC component is still subtracted, but
the filter stops tracking any DC or low frequency changes.
</p>
<p class=func><span class=keyword>adcHighPassFilterDisable</span>();</p>
Expand Down Expand Up @@ -5375,12 +5375,12 @@ <h3>Audio Processor</h3>
</p>
<p class=desc>If <em>hardLimit</em> is 0, a 'soft
knee' compressor is used to progressively compress louder values which are near to or above the
threashold (the louder they are, the greater the compression). If it is 1, a hard compressor
is used (all values above the threashold are the same loudness). The <em>threashold</em> is specified
threshold (the louder they are, the greater the compression). If it is 1, a hard compressor
is used (all values above the threshold are the same loudness). The <em>threshold</em> is specified
as a float in the range 0dBFS to -96dBFS, where -18dBFS is a typical value.
<em>attack</em> is a float controlling the rate of decrease in gain when the signal is over
threashold, in dB/s. <em>decay</em> controls how fast gain is restored once the level
drops below threashold, again in dB/s. It is typically set to a longer value than attack.
threshold, in dB/s. <em>decay</em> controls how fast gain is restored once the level
drops below threshold, again in dB/s. It is typically set to a longer value than attack.
</p>
<p class=func><span class=keyword>autoVolumeEnable</span>();</p>
<p class=desc>Enables auto volume control, using the previously specified settings.
Expand Down
Loading