Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!bu.edu!att!att!drutx!druco!mab From: mab@druco.ATT.COM (Alan Bland) Newsgroups: comp.sys.amiga Subject: Re: Keynote (was Re: MIDI programming using midi.library) Message-ID: <6904@drutx.ATT.COM> Date: 7 Dec 90 18:01:42 GMT References: <9725@fy.sei.cmu.edu> <1990Dec4.134944.16669@cbnewsl.att.com> <4745@cvl.umd.edu> <34068@netnews.upenn.edu> Sender: news@drutx.ATT.COM Reply-To: mab@druco.ATT.COM (Alan Bland) Organization: AT&T, Denver, CO Lines: 50 In article <34068@netnews.upenn.edu> nichomax@cattell.psych.upenn.edu (Nicholas Maxwell) writes: >What's the language in which you must program keynote? C? > >nichomax@cattell.psych.upenn.edu The language itself is called Keynote, and is a derivative of AWK (a C-like language available on UNIX). Keynote is an interpreted language, so you don't have to go through the edit-compile-link-run cycle. As such you get immediate feedback on changes you make at the expense of some overhead during execution. It's terrific for musical "hacking!" The language includes some very powerful constructs for manipulating phrases of MIDI notes. For example, ph = 'c,d,e,f,g' sets the phrase variable ph to contain the first five notes of a C-major scale. To transpose the pitch of phrase up an octave (12 tones), just type ph.pitch += 12 You can play the phrase backwards by reverse(ph) Included below is the actual Keynote code to the "reverse" function so you can get a feel for what the language is like. Keynote comes with hundreds of functions like this, and of course you can write your own. func reverse(ph, leng,nt,r) { if ( nargs() == 0 ) { print "usage: reverse(phrase)" return ''; } leng = ph.length r = '' for ( nt in ph ) { nt.time = leng - nt.time - nt.dur r |= nt } return r; } -- -- Alan Bland -- att!drutx!mab == mab@drutx.ATT.COM -- AT&T Bell Laboratories, Denver CO -- (303)538-3510