Hallo, David Powers hat gesagt: // David Powers wrote:
I'm wondering if I should use something like PyExt to do some of the mapping, as I don't know of any simple way to do hash dictionaries in PD itself. As a test last night, I built a simple abstraction to take notes C C# D etc. and output pitch numbers 0-11, and i found it quite tedius to do compared to a function in code such as (this is in PHP because that is what I do all day long at my day job): function note2number($note) { $num = array ('C'=>0,'C#'=>1,'Db'=>1); return $num[$note]; }
Well, Pd doesn't have proper hash dictionaries. OTOH Lua has hash dictionaries as its *only* data structure (called "tables" in Lua), so to me it's an ideal complement to Pd.
Attached is a quick [note2num] object for pdlua. It also handles multiple modifiers like "Gbbbb" or mixed ones like "Gb#bbb#b". ;)
Frank Barknecht _ ______footils.org__