Open heucuva opened 1 year ago
one of the major roadblocks I had previously hit was the poor accuracy of cv from the PWM output. I'm wondering if you had noticed the same issue and if your changes have helped improve the quality of PWM output?
The main concern is that the RP2040 likes 32bit sizes for its floating point and most of the code is built around that (general use case performance is actually a major consideration point on this project) - with 32bit floats, we run into a problem of gaps in PWM values. It's not an impossible thing to solve, but it does mean reworking how duty cycle is calculated, focusing more on accuracy than fast calculation. Maybe we can replace the calc with a partial lookup table instead? That would certainly help where accuracy is concerned, however it would eat a bit of available memory/storage space (not that I've ever come across that concern in my testing/hacking)
I am following some of the guidelines and conventions from the official EuroPi repo's contributing guide, so please take a look at this doc: https://github.com/Allen-Synthesis/EuroPi/blob/main/contributing.md#overview
One of the issues with the organization layout is that if we are going to eventually run CI pipelines on the codebase for unit tests, then we'll need to put module projects (which have main
package names) under the /internal
directory. Can't have more than one main
- as a hard and fast rule of Go - unless they live under /internal
somewhere.
Made a bunch of changes and improvements for memory utilization. Still need to make a pass on the documentation.
Preface
I'm really sorry this took so long to get ready for a real Pull Request. There were a lot of features I wanted to have available and things sort of spiraled out of hand a bit. I hope you understand and bear with me on this one, as I really do think this is the start of something great for the project. I promise that future PRs won't be behemoths like this one, but more pruned and targeted solutions.
Added
__debug_bin
to the.gitignore
so git doesn't try to add the VSCode debugging executable to the repo.GPIO6
..GPIO9
on Pico hardware.KnobBank
from the Python EuroPi SDK.hal
) system for interacting with hardware.Lerp
,InverseLerp
,Clamp
, andQuantizer
.units
to support:CV
- a normalized (0..1) representation of monopolar CV values ranging between 0 and 5 Volts.BipolarCV
- a normalized (-1..1) representation of bipolar CV values ranging between -5 and 5 Volts. Note: EuroPi (revision 1) does not support Bipolar CV inputs/outputs, so this is largely unused.VOct
- a representation of monopolar Volts per Octave values ranging between 0 and 10 Volts.Hertz
- a representation of frequency values with a useful conversion to their peak-to-peak time intervals.revision0
,europiproto
, oreuropiprototype
.context.Context
support to the various variants of the EuroPi hardware objects..Context()
from the EuroPi hardware object to get the context interface. You can extend it with the functions found within thecontext
package further, if you so choose.europi.Button(e europi.Hardware, idx int)
- Get the button of indexidx
from thee
EuroPi hardware object, if it exists.europi.Knob(e europi.Hardware, idx int)
- Get the knob of indexidx
from thee
EuroPi hardware object, if it exists.europi.Display(e europi.Hardware)
- Get the primary display from thee
EuroPi hardware object, if it exists.Remapper
interface to thelerp
package.TODO
comments throughout the code for adding EuroPi-X (revision2
- aka 'rev2') future functionality.Fixed or Changed
init()
.Pi
variable in the hardware revision subpackage becomes non-nil
, et voila!Notes