[PD] [Pd] OT: floating-point note numbers in other FOSS

Chuckk Hubbard badmuthahubbard at gmail.com
Tue Mar 12 10:36:33 CET 2019


Hello.
Many years ago, when I first went through some Pd tutorials, I noticed how
the mtof, ftom, et al objects, as well as the audio/MIDI testing patch,
allowed for floats in place of integer MIDI note numbers, interpreted the
same way, and found that really interesting.
The main reason I've ever been drawn to programming is to facilitate
microtonal composition (I wrote a microtonal sequencer in Pd in college,
got an A*, *thanks, later rewrote it in Python using Csound, now it's
broken due to Csound API changes). Now that I know C and C++ at least a
little better, I'm wondering if it would be feasible to implement such
treatment of MIDI(-style) note numbers in other open source music programs,
e.g. simply by overloading functions written with byte or int8 arguments
and offering float versions alongside them, leaving the same midi-cps
algorithms.

One of the Ardour devs discouraged this (well, several, but one had this
argument) complaining of floating-point rounding. From what I've
researched, typical single floats ,IEEE something, can represent any real
number accurate to 6 digits. For 0-127, at least 3 digits after the decimal
point means at least 1/1000 of a semitone, or 0.1 cents. I call that
definitely good enough. Or doubles, for the picky.
I bring this up here because Pd is the only software I've ever found that
implemented such a thing, and I think it's brilliant. I'd like to slowly go
through various open source MIDI programs and make versions that allow
floating-point note numbers and still support the original byte/int8
arguments. A DAW and a couple of plugins to start. Maybe a piano roll that
allows disabling snap-to for pitch; or my own sequencer could easily be
made to send these numbers. Ardour has 32 bits internal audio samples,
still 7 bits of polyphonic pitch control. I think this would be
revolutionary for microtonal music, and simple to implement, though the
authors of these programs might not have thought of it.

Anyone in? Anyone more familiar with MIDI coding give me a hint in what
sections of code to search? Any open-source devs who'd be open to it?

NB For all the alternative suggestions, I have tried them. Pitch bend is
one value per channel, so you'd need a separate sound gen for each channel*
(I'm *wor*king *on this with* IEM's Pd *vstplugin~, but e.g. 10 voices per
channel times 4 instruments is already 40 running plugins). Scala .scl
files have a finite set of pitches that, in most cases, cannot be changed
during performance - you can only change the scale with mouse clicks.
Directly sending frequency instead of note numbers involves more code
changes. There are lots of possible ways to make software
microtone-friendly. I think this would be the best mix of versatile and
easy to do.

Thanks!
Chuckk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20190312/9baa0e59/attachment.html>


More information about the Pd-list mailing list