Close
0%
0%

Pétomane ringard

A fantasy soundcard with wavetable based synthesis

Similar projects worth following
A synth/soundcard that uses precomputed wavetables in RAM to change timbre and amplitude.

This is a second installment in Pétomane series, the first being mostly a hybrid-analog synth with Polivoks filters. Here the main idea is just to play back waveforms from a RAM to achieve timbral diversity and dynamics.

For example: a sawtooth waveform with volume 1 is stored as a PCM sample in addresses 0..$ff.
Volume 2 is stored in addresses $100.$1ff, etc up to $f00..$fff. We've got 16 levels of volume and can change it by selecting the upper part of sample address, while the lower part is enumerated by a counter circuit.

Rough specs

  • 3 channels with hard mix Left = A + 1/2 B , Right = 1/2 B + C
  • 3 channels are time-multiplexed, SRAM is accessed in sequence
  • all sound generation is produced by reading PCM samples from SRAM into a DAC
  • all samples are 256-byte long and looped (but one channel can stop after one run)
  • low 8 bits of sample address are generated by a 8-bit address counter clocked by pitch timer/counter 82c54
  • upper 8 bits of a sample are defined by writing 8 bits to ports A, B, C of 82c55
  • the pitch clock is generated by 82c54, master clock 8MHz (possibly 10, but not every 82c54 can do that)

Sound generation principle by example

Play a pitch (256 different timbres)

  1. Generate a waveform sample (e.g. sawtooth) and write it to SRAM at addresses $0000.$00FF. It can be one period or a multiple. I think a 8x or 16x multiple would give better pitch control considering that we only divide a 8MHz master clock.
  2. Optionally fill entire SRAM, making up 256 waveform samples
  3. Set note pitch as a divider for 82c54 
  4. Set MSB in 82c55 = sample number

Create dynamics

Generate waveform samples for 16 volumes. Timbre 1 would occupy addresses $0000..$00FF, $0100..$01FF, ..., $0F00..0FFF. Same for other waveforms. Now MSB in 82c55 also selects modulated volume. 

It can be seen that there is no strict rule regarding how many levels per timbre there should be, it's all on the programmer's side. We can have 1 or 3 or 256 volume levels, or one timbre can have 3 levels and other 13.

One-shots

Channel B (centre) can optionally stop after playing one loop. This should help adding basic percussion sounds.

Notes

Of blinkenlightenings see audio level meter

  • Audio Meter

    svofski01/08/2025 at 21:58 0 comments

    I wanted to add a simple VU-meter at the edge of the board, but LM3915 wasn't available and it wouldn't fit anyway.

    So I went ahead and designed my own audio level meter based on CH32V003J4M6, a 8-pin RISC-V MCU. 10 LEDs didn't seem serious, so I went for 20.

    I documented the details of this build in a README on github: https://github.com/svofski/lepetomane-ringard/tree/master/wch-ch32v003/pio-arduino-ch32v003

    Here's a video about it:

    While it has only a tangential relationship with the main project, I feel like it has the potential to end up the most valuable result because it's simple and very easy to repeat.

View project log

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates