Category Archives: slippery chicken users

slippery chicken users discussion group. auto-imports from https://www.facebook.com/groups/slipperyc/

Music XML output on its way Been working…

Music XML output on its way. Been working really hard on this in my spare time for the past couple of weeks. Coupled with lilypond editing fatigue and a prod from Charles Gaskell I bit the bullet and wrote the code for this after looking at it again and deciding that it’s probably now worth it. Each bit of software seems to fail in its own way when importing XML, but finale seems to be pretty good. Just imported 90k+ lines of xml without error for the first time 🙂 (that’s about 100 times more code than Lilypond)

With the demise of the extended version of…

With the demise of the extended version of Pure Data, we’ve lost the seq object for reading/playing MIDI files. I know there are alternative libraries out there but I would like to play a MIDI file in PD for teaching purposes. Sequencing in PD vanilla is really done with the qlist object, which I love, though I do find it a little frustrating that PD can’t handle reading that most standard of files, the MIDI file. On a more positive note, qlist is also available in Max so it’s a really handy object/format in both environments.

Anyway, I’ve just added a new function (midi2qlist) to slippery chicken that converts from a MIDI file to a qlist text file format. I’ve tried it with a few different MIDI files and it seems to be working fine, but it wouldn’t hurt if other people took a poke. You can get the code via (update-app-src …) or from the svn-latest tag on the svn server.

When creating rthm seq palettes you can add…

When creating rthm-seq-palettes you can add empty bars with the requisite number of rests but the easiest thing to do is simply leave them blank:

(5 ((1 ((((3 4) { 7 (28/3) - 28/3 x 6 - })
         ((2 4) (q) g e (e)) ()
         ((5 8)))))))

Note that two empty bars are created there: the first by a simple empty list: (), the second by a change of time signature followed by no rhythms ((5 8))

Some of you might be interested in the…

Some of you might be interested in the following bit of code to get bass notes to play louder (not at all Fletcher-Munson curve correction but that could be implemented too by using the a-weighting function).

:force-velocity can either be a fixed number or a function. If the latter then each consecutive event is passed to the function automatically by midi-play. Below we subtract the degree (equivalent to MIDI note number when using the chromatic scale) from 127 to make lower notes louder than higher notes, but we do restrict this to between 70 and 110, so there’ll be a hard cut-off—notes above MIDI 55 will have a velocity of 70 and those < 18 will have 110. Note that we do randomise/humanise the velocities by 10% for a less mechanical feeling (assuming your synth/sampler will distinguish significantly there); also that get-degree will return an average for chords.

(midi-play +jitterbug+ :force-velocity
           #'(lambda (event)
               (let* ((d (get-degree event :average t))
                      (v (when d
                           (round
                            (randomise 
                             (min 110 (max 70 (- 127 d)))
                             10)))))
                 (format t “~&~a –> ~a” d v)
                 v)))