Skip to content

Commit

Permalink
More audio (#16)
Browse files Browse the repository at this point in the history
Adds 2 new patterns:

* Audio Intensity
* Audio virtual 3

And modifies Audio wave to include a triphase view
  • Loading branch information
CrashOverride85 authored Oct 18, 2022
1 parent 1e238dc commit 3f8e130
Show file tree
Hide file tree
Showing 34 changed files with 733 additions and 102 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ The primary reason for having separate PCBs for the main and output board is for

# TODO
## Firmware
- More audio patterns
- Combo pattern? Having, e.g., waves on channels 1+2 plus something like TENS on 3+4 would be good
- Save pattern settings on exit?

Expand Down
1 change: 0 additions & 1 deletion docs/AudioInput-Operation.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Disabling the mic preamp switches to line level input, and shows stereo input:

![Audio input line]

Note that at present, the single audio pattern only uses the left channel. One day soon....

### Hardware config
There are two relevant entries in the hardware config menu:
Expand Down
4 changes: 2 additions & 2 deletions docs/Build.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Finally, attach the front panel controls board using 20mm bolts. The completed a

* Slot the boards into the case, and screw in place: Screw Length (Excluding Head): 1/4" (6.5mm), Screw Size: No.6 (3.5mm)

* Stick the battery down. Suggest using 3M double sided tape (MNT-FT24MM-16FT)
* Stick the battery down. Suggest using 3M double sided tape (MNT-FT24MM-16FT)

* Connect front panel to main board using IDC cable

Expand Down Expand Up @@ -180,7 +180,7 @@ If any of the I2C devices aren't detected, you should see an error similar to th
![hw check fail]

Here, it can't find the two ICs on the front panel (in this case, the IDC cable was unplugged).
There is also serial debugging output on the 3.5mm serial connector on the front panel at RS232 levels.
There is serial debugging output on the "Accessory" DB9 connector (tx pin 3, ground pin 5) on the front panel at RS232 levels.

There is also debugging output from the ZC624 board on the serial header. Note that is at 3v3 level, and RS232 levels would damage it.

Expand Down
4 changes: 2 additions & 2 deletions docs/Operation.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ Buttons 1 - 4 are soft buttons and the purpose changes dependant on the screen.
| 4 | Softbutton - Usually scroll down
| 5 | Power. Left is off, right is on. Probably should have labelled that.
| 6 | Power in. Should be centre positive 15v DC
| 7 | Serial port. Currently only debugging output (RS232 level). Tip is TX / output from box, Sleeve is ground.
| 7 | Either Serial port, or if optional audio input board fitted, can be toggled between serial and audio input. In serial mode, Tip is TX / output from box, Sleeve is ground.
| 8 | Accessory port. Includes power, serial and 3x GPIO pins. See "Accessory port" in misc section. Currently not really used by much.
| 9 | Trigger input 1. Shorting either Sleeve or Ring to Tip registers trigger. The box can differentiate between S-T and R-T triggers (i.e. each trigger socket can react to two different inputs), however this capability is unused.
| 9 | Trigger input 1. Shorting either Sleeve or Ring to Tip registers trigger. The box can differentiate between S-T and R-T triggers (i.e. each trigger socket can react to two different inputs)
| 10 | Trigger input 2. As above, except currently unused.
| 11 | 2.5mm socket for channel 1 output
| 12 | 2.5mm socket for channel 2 output
Expand Down
50 changes: 47 additions & 3 deletions docs/Patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,51 @@ The left audio channel is output on channels 1+2, the right on 3+4. It probably
*Warning*: Enables triphase mode / disables channel isolation, so should not be used above the waist.

### Menu options
* Audio view - Shows two wave forms - for left and right channels. The adjust dial changes the gain, which is displayed on the thin yellow bar at the bottom.
* Stereo view - Shows two wave forms - for left and right channels.
* Triphase view - Shows three wave forms - left, right and a virtual / calculated triphase effect.

![Audio Wave]
Note that the selected view does not affect the output, and the indicated triphase effect will only be felt if channel 1+3 (or 2+4) have a common electrode. The adjust dial changes the gain, which is displayed on the thin yellow bar at the bottom of the waveform display.

![Audio Wave Stereo]

### Extra hardware required?:
Audio output board fitted and audio source

------------------------------------------------------------

## Audio intensity
Only available if audio enabled.

Intended for use with a microphone (see [audio config](./AudioInput-Operation.md) to switch to mic mode), but also allows for stereo input.

The louder the sound, the greater the output. Not much more to this pattern.

### Menu options
* Mono - Shows one waveform corresponding to the left channel, and all output channels are the same intensity depending on the input from the left channel
* Stereo - Shows two waveform corresponding to the left and right channels. Output channels 1+2 have an intensity corresponding to the left channel, and channels 3+4 have an intensity corresponding to the right channel

The adjust dial changes the gain, which is displayed on the thin yellow bar at the bottom.

![Audio intensity mono]

### Extra hardware required?:
Audio output board fitted and audio source

------------------------------------------------------------

## Audio virtual 3
Only available if audio enabled.

Well suited to estim audio tracks, with the audio [configured](./AudioInput-Operation.md) for line level input. Generates a 3rd channel from the difference between the left and right channels, and outputs it on channel 3 (channel 4 is not used).

Unlike the "Audio Wave" pattern, this does not disable channel isolation, so could be used above the waist with suitable electrode placement (usual warnings still apply). This also means the channels should *not* be connected with a common electrode.

### Menu options
* Audio view - Shows three wave forms - left (channel 1), right (channel 2) and simulated "triphase" effect (channel 3).

The adjust dial changes the gain, which is displayed on the thin yellow bar at the bottom.

![Audio virtual 3]

### Extra hardware required?:
Audio output board fitted and audio source
Expand Down Expand Up @@ -245,4 +287,6 @@ Yes! Trigger input 1 needs a stereo Tip, Ring, Sleeve (TRS) 3.5mm plug wired as

[Buzz wire game]: images/BuzzGame.jpg "Buzz wire game"
[Audio Threshold]: images/screen_pattern_audioThreshold.jpg "Audio Threshold"
[Audio Wave]: images/screen_pattern_audioWave.jpg "Audio Wave"
[Audio Wave Stereo]: images/screen_pattern_audioWave.jpg "Audio Wave"
[Audio virtual 3]: images/screen_pattern_audioVirtual3.jpg "Audio virtual 3"
[Audio intensity mono]: images/screen_pattern_audioIntensity.jpg "Audio intensity mono"
Binary file added docs/images/screen_pattern_audioIntensity.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/screen_pattern_audioVirtual3.jpg
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 docs/images/screen_pattern_audioWave.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions source/zc95/AudioInput/AudioTypes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#ifndef _AUDIOTYPES_H
#define _AUDIOTYPES_H

enum class audio_mode_t
{
OFF,
THRESHOLD_CROSS_FFT,
AUDIO3,
AUDIO_INTENSITY
};

enum class audio_hardware_state_t
{
NOT_PRESENT,
PRESENT_NO_GAIN,
PRESENT
};

enum audio_channel_t
{
AUDIO_LEFT = 0,
AUDIO_RIGHT = 1,
AUDIO_VIRT = 2
};

#endif
Loading

0 comments on commit 3f8e130

Please sign in to comment.