Just remember I've made an abstraction for that long ago, it won't be as fast as DS but it works and it's attached
patrice colet a écrit :
David Powers a écrit :
- (0 3 5 1 2 4) might make sense for an engineer because zero for him would
be the first note, but a musician uses to start with one, not zero. If this notation is for expressing some voicings, that is a lot easier and free to read under jazz notation for a human, unless the numbers represents guitar tablatures.
It almost sounds like the machine will help classical musicians or mathemusicians to do like if they were improvising, interesting...
Ah, yes, well I only meant that is the internal representation. The interface would take that input and generate an appropriate output for a given instrument in the correct transposition, so a flute player would see the cell as noteheads on a treble clef.
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]; }
with python it would be very simple as well, AFAIU you would just need to declare a dictionnary and read it through a defined function or a class exactly like you did in php ( http://docs.python.org/tut/node7.html ) , explicitely it's called "Data Structure" in python documentation...
It' possible to use data structure in pure data as well, with using array elements for note names, and a pointer index value for the number. This kind of stuff is a lot easier to do with data structures, I've been able to do things very simply with, while it seemed impossible with list objects, for example a custom [poly] that is able to manage more than two arguments (I could extract and post it if it's necessary) and well it's a big advantage in regard of other dataflow applications...
- I imagine that puredata will have to transpose for each instrument, but
if only the key (or key modulation) is given it would be easy to do.
A dictionnary of symbols is so easier to read than numbers for expressing musical events, that's why I've asked if you used font files, but maybe using gem geos or texture files would make it more elegant or versatile?
I'm not sure about fonts, I guess I don't know whether that would work on multiple operating systems... I just thought that GEM would allow it to work on any OS. I agree it might be nice to use already built musical symbols rather than reinventing the wheel. Then I would only need GEM to draw the staff lines and position the noteheads and symbols in relation to it.
~David
Well I think that all the project wouldn't even need externals but Gem will certainly give it a nice look and might have better performances. Also, ttf files would work on any OS if I'm not mistaken, but maybe it would be less complicated with using image files, I've only tried to draw musical score on Gem with [text] objects.
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
#N canvas 493 443 466 227 12; #X msg 175 32 A#5; #X floatatom 174 124 5 0 0 0 - - -; #X msg 134 36 A#4; #X obj 176 95 note2f; #X msg 307 29 C0; #X msg 223 34 C1; #X msg 263 33 C-1; #X msg 349 30 C-2; #X msg 92 40 A4; #X symbolatom 30 75 10 0 0 0 - - -; #X msg 312 70 C#-1; #X connect 0 0 3 0; #X connect 2 0 3 0; #X connect 3 0 1 0; #X connect 4 0 3 0; #X connect 5 0 3 0; #X connect 6 0 3 0; #X connect 7 0 3 0; #X connect 8 0 3 0; #X connect 9 0 3 0; #X connect 10 0 3 0;
#N canvas 489 6 482 377 10; #N canvas 404 9 518 432 note 0; #X obj 212 143 s2l; #X msg 248 119 symbol; #X obj 210 66 symbol; #X obj 203 11 inlet; #X obj 185 321 outlet; #X obj 352 272 outlet; #N canvas 0 0 537 411 drip 0; #X obj 64 206 list split 1; #X obj 64 123 until; #X obj 64 181 list append; #X obj 194 206 bang; #X text 146 90 First store list , then start the loop; #X text 163 118 "until" bangs its output until told to stop by a "bang" to its right inlet.; #X text 182 160 Store the remaining list.; #X text 239 205 third outlet of "split" tells us to stop.; #X obj 64 243 outlet; #X obj 64 57 inlet; #X text 237 44 From list-help.pd; #X obj 143 243 outlet; #X obj 64 86 t b a; #X connect 0 0 8 0; #X connect 0 1 2 1; #X connect 0 2 3 0; #X connect 0 2 11 0; #X connect 1 0 2 0; #X connect 2 0 0 0; #X connect 3 0 1 1; #X connect 9 0 12 0; #X connect 12 0 1 0; #X connect 12 1 2 1; #X restore 212 195 pd drip; #X obj 212 169 route list; #X obj 212 222 route symbol float; #X obj 212 271 list prepend; #X obj 212 92 t a b; #X obj 317 274 t l; #X obj 169 37 t b a; #X connect 0 0 7 0; #X connect 1 0 0 1; #X connect 2 0 10 0; #X connect 3 0 12 0; #X connect 6 0 8 0; #X connect 7 0 6 0; #X connect 8 0 4 0; #X connect 8 1 5 0; #X connect 9 0 11 0; #X connect 9 0 4 0; #X connect 10 0 0 0; #X connect 10 1 1 0; #X connect 11 0 9 1; #X connect 12 0 9 1; #X connect 12 1 2 0; #X restore 73 54 pd note name split; #X msg 32 121 1; #X msg 59 122 3; #X msg 78 143 5; #X msg 93 121 6; #X msg 106 144 8; #X msg 123 121 10; #X msg 134 146 12; #X obj 90 191 i; #X obj 212 0 inlet; #X obj 127 323 outlet; #X obj 166 215 + 1; #X obj 153 236 i; #X obj 128 260 i; #X obj 153 119 b; #X obj 128 281 +; #X obj 271 199 * 12; #X obj 128 304 + 23; #X obj 69 81 sel C D E F G A B # -; #X obj 198 241 i; #X obj 211 23 t b b a b; #X obj 288 165 demux; #X msg 290 117 0; #X msg 263 123 1; #X obj 311 200 * -12; #X connect 0 0 18 0; #X connect 0 1 21 0; #X connect 1 0 8 0; #X connect 2 0 8 0; #X connect 3 0 8 0; #X connect 4 0 8 0; #X connect 5 0 8 0; #X connect 6 0 8 0; #X connect 7 0 8 0; #X connect 8 0 11 0; #X connect 8 0 13 1; #X connect 9 0 20 0; #X connect 11 0 12 1; #X connect 12 0 13 1; #X connect 13 0 15 0; #X connect 14 0 12 0; #X connect 15 0 17 0; #X connect 16 0 19 1; #X connect 17 0 10 0; #X connect 18 0 1 0; #X connect 18 1 2 0; #X connect 18 2 3 0; #X connect 18 3 4 0; #X connect 18 4 5 0; #X connect 18 5 6 0; #X connect 18 6 7 0; #X connect 18 7 14 0; #X connect 18 8 23 0; #X connect 19 0 15 1; #X connect 20 0 13 0; #X connect 20 1 19 0; #X connect 20 2 0 0; #X connect 20 3 22 0; #X connect 21 0 16 0; #X connect 21 1 24 0; #X connect 22 0 21 1; #X connect 23 0 21 1; #X connect 24 0 19 1;