Re: [PD] Creating music notation with GEM
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 G or mixed ones like Gb#bbb#b. ;) Ciao -- Frank Barknecht _ __footils.org__ note2num-help.pd Description: application/puredata --[[ note2num: convert note names like C# or Bb or Ab#bb to midi note numbers -- fbar 2008 --]] local M = pd.Class:new():register(note2num) local n2n = { c = 0, d = 2, e = 4, f = 5, g = 7, a = 9, b = 11, } function M:initialize(name, atoms) self.inlets = 1 self.outlets = 1 return true end function M:in_1(sel, atoms) local s if not atoms[1] then s = sel else s = atoms[1] end assert(type(s) == string, only symbols allowed) s = string.lower(s) local n, mods = s:match(^([cdefgab])([#b]*)$) local val = n2n[n] if mods and val then local _, b = string.gsub(mods, b, b) local _, h = string.gsub(mods, #, #) val = val + h - b end if val then self:outlet(1, float, {val}) end end ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] Creating music notation with GEM
Hi all, This is a very interesting discussion, I have been thinking of generating directives/instructions/scores (mostly in that order) for performers (definitely in the context of improvised music) but had not (yet?) got around to implementing anything. One thing that I did consider, though, was to use LilyPond to generate a .png file of a score snippet and place it in [insert your favorite gfx package here]. This would add a little bit of latency needed for LP to generate the thing (for small fragments it would probably be negligible) but to me it does not seem like a big issue because if I generate scores/instructions it is mainly for form consideration and not note-for-note exchange between the performer and the computer. Just needed to get it off my chest :) ./MiS ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
[PD] Creating music notation with GEM
Hello, I have a question, how hard do you think it would be create a notation engine for GEM? What considerations would go into the design? On the simplest level, I'm imagining doing non-rhythmic notation to display chords and cells for improvisors. Since the number of notes on a chord would be determined on the fly, would it be better to create the max amount of objects and turn off unwanted ones, or better to use dynamic patching? This would simply be to create circles representing noteheads Here's my imaginary prototype: [gemhead] | | | [cell G Ab F# F ( or [chords c4 e4 g4 , F#4 G4 B4 ( or [cell 0 4 3 5 2 1 ( | / | / [treble_clef] Anybody have any idea what kind of messages I might send such an object? ~David ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] Creating music notation with GEM
This sounds interesting, I will take a look at it when I get out of work... As far as what improvisors need, I'm working in the more 'experimental' improv scene right now, which means: 1. They won't be playing 'Cmajor7' but rather collections of pitch cells such as (0 3 5 1 2 4) in some specific key 2. There will be additional types of symbols and data, or poetic instructions 3. There will be instructions for some improvisors to lead and others to follow the leader at various points 4. The ultimate idea for a current project is that there will be a conductor coordinating improvisors, able to send commands across a network to multiple improvisors on the fly. Of course, this opens the way for a computer to take the role of conductor also. But in either case, there is not a score but rather the structure if the work itself is also improvised anew at every performance, out of a collection of potential cells and potential instructions that define the space of possibilities that any given work inhabits. In other words, don't think that 'improvisors' means that this is in any way going to be 'jazz'. Think more along the lines of the music of Webern + Morton Feldman + Cecil Taylor + John Cage... ~David On Thu, Jul 17, 2008 at 4:31 AM, patrice colet [EMAIL PROTECTED] wrote: Sayonara, How do you display the chords in GEM? I personaly use a jazzfont ttf and curves, the attached patch is an attempt to display a score that any reader would understand because it's written like in the Realbook. Unfortunately I didn't finish this project (like many ones), but it might give a clue I hope. I really don't think that an improvisator will enjoy to have single notes packets to read for each chord, in fact I don't know any improvisator that need to read something else than jazzchords and melodies for playing, unless they have a notice given with the score where the composer has explained all his weird symbols, quite annoying to make, to play, to read, and to hear...for me. Also I've started a project for writting scores with datastructures, attached archive is an old sample of this datastructure project, done with the help of F. Barkneicht, I've done something more sophisticated, but the purpose wasn't really about reading/playing/learning music but it's just a 'proof of the concept' game, maybe you will see it through the publication of the PureCorps game started last year... I think that the advantage of scores displayed by a computer is about having pages (or even better the first line) updated automatically when the reader is at the last line. I will be need of something functionnal for playing in concerts soon, then will certainly make something that will fit my use and reading abilities, I'll also need to write strange tuplets like the ones you can find in FZ's Black Page... If someone is interested I could update this work in pd-announce ? Anyway, all this stuff won't be as powerful as some lilypond external or something similar... Jaa. David Powers a écrit : Hello, I have a question, how hard do you think it would be create a notation engine for GEM? What considerations would go into the design? On the simplest level, I'm imagining doing non-rhythmic notation to display chords and cells for improvisors. Since the number of notes on a chord would be determined on the fly, would it be better to create the max amount of objects and turn off unwanted ones, or better to use dynamic patching? This would simply be to create circles representing noteheads Here's my imaginary prototype: [gemhead] | | | [cell G Ab F# F ( or [chords c4 e4 g4 , F#4 G4 B4 ( or [cell 0 4 3 5 2 1 ( | / | / [treble_clef] Anybody have any idea what kind of messages I might send such an object? ~David ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list #N canvas 333 338 624 320 10; #X obj 16 77 gemwin; #X msg 27 54 0 \, destroy; #X obj 17 10 loadbang; #N canvas 349 55 555 403 text 0; #X obj 95 33 inlet; #X obj 199 37 inlet; #X obj 129 300 outlet; #X obj 17 220 text2d; #X obj 74 222 text3d; #X obj 131 221 textextruded; #X obj 237 222 textoutline; #X obj 110 144 demux 0 1 2 3; #X obj 236 153 r \$0-text; #X obj 320 154 r \$0-size; #X floatatom 408 129 5 0 0 0 - - -; #X msg 409 162 depth \$1; #X connect 0 0 7 0; #X connect 1 0 7 1; #X connect 3 0 2 0; #X connect 4 0 2 0; #X connect 5 0 2 0; #X connect 6 0 2 0; #X connect 7 0 3 0; #X connect 7 1 4 0; #X connect 7 2 5 0; #X connect 7 3 6 0; #X connect 8 0 6 0; #X connect 8 0 5 0; #X connect 8 0 4 0; #X connect 8 0 3 0; #X connect 9 0 6 1; #X connect 9 0 5 1; #X connect 9 0 4 1; #X connect 9 0 3 1; #X connect 10 0 11 0; #X connect 11 0 5 0; #X restore 425 113 pd text; #X obj 462 83 hradio 15 1 0 4 empty empty empty 0 -8 0 10 -262144 -1 -1 1; #X obj 425
Re: [PD] Creating music notation with GEM
David Powers a écrit : This sounds interesting, I will take a look at it when I get out of work... As far as what improvisors need, I'm working in the more 'experimental' improv scene right now, which means: 1. They won't be playing 'Cmajor7' but rather collections of pitch cells such as (0 3 5 1 2 4) in some specific key 2. There will be additional types of symbols and data, or poetic instructions 3. There will be instructions for some improvisors to lead and others to follow the leader at various points 4. The ultimate idea for a current project is that there will be a conductor coordinating improvisors, able to send commands across a network to multiple improvisors on the fly. Of course, this opens the way for a computer to take the role of conductor also. But in either case, there is not a score but rather the structure if the work itself is also improvised anew at every performance, out of a collection of potential cells and potential instructions that define the space of possibilities that any given work inhabits. In other words, don't think that 'improvisors' means that this is in any way going to be 'jazz'. Think more along the lines of the music of Webern + Morton Feldman + Cecil Taylor + John Cage... ~David I was more thinking about K. Stockhausen, but anyway if this sounds out of tune, or smells funny, there always will be people that say 'it's jazz'. 1. (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... 2.3. I've played a piece long time ago (so long I don't remember the title), with other improvisators, where notes on the musical score were replaced by different symbols that give instructions differents than time and pitch, but also the tone, or pick a note, or replay the other voice's pitch or rythm, or tone, or play same fast, go slow... That was funny, and sure it would be more funny if it's a computer that conducts everyone! 4. 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? yes I ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] Creating music notation with GEM
1. (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]; } 4. 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 ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] Creating music notation with GEM
Okay, I guess I need to check out the pdmtl stuff, I don't have pd2ascii and ascii2pd but it definitely looks useful. (It took me a second to realize you wrote a note explaining where pd2ascii was from, I thought my pd-ext was missing something at first...) In fact, I definitely better revisit both pdmtl and the RTC-lib before I spend hours stupidly reinventing the wheel. One point, you missed the note 'B' on the right hand side of your patch. Anyway thanks, you just allowed me to cross off an item from my todo list! ~David On Thu, Jul 17, 2008 at 4:00 PM, Luigi Rensinghoff [EMAIL PROTECTED] wrote: Well.. not terribly tedious ;-) Am 17.07.2008 um 21:55 schrieb David Powers: 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]; --- Luigi Rensinghoff [EMAIL PROTECTED] skype:gigischinke ichat:gigicarlo ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] Creating music notation with GEM
David Powers a écrit : 1. (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... 4. 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
Re: [PD] Creating music notation with GEM
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 : 1. (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... 4. 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
Re: [PD] Creating music notation with GEM
Hi David list, I did a project at Stanford/ccrma, for which my pal Rob designed a system that used Lilypond to display the output of a patch, and that worked beautifully, from the performer's (my) point of view. Here's a link to his paper, see section 2.7. http://nime.org/2006/proc/nime2006_338.pdf Collin ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list