Version 4 of Tclmod

Updated 2005-01-11 00:07:45 by dkf

Googie Tcl extension which provides support for music modules under Tcl.

Music modules are usually files with extensions *.mod, *.s3m, *.it, *.xm but also many others.

Full manual page is placed here:

Homepage of extension is:

Some examples.

Simply playing modules is pretty easy:

 package require Tclmod
 set mod [::tclmod::player load music.mod]
 ::tclmod::player start $mod

and here is little more advanced code, which builds simple GUI module player:

 package require Tk
 package require Tclmod

 wm title . "Modules player"

 entry .module -textvariable mod -width 50 -state disabled -bd 1
 button .browse -text "Browse" -bd 1 -command {
     set types {
         {{Module} {.mod .s3m .xm .it .669 .apun .dsm .far .amf 
         .gdm .imf .med .mtm .okt .stm .stx .ult .uni}}
     set mod [tk_getOpenFile -filetypes $types \
             -title "Choose module file"]
     .module configure -state normal
     .module configure -state disabled
     if {[info exists module]} {
         ::tclmod::player stop
         ::tclmod::player unload $module
     set module [::tclmod::player load $mod]

 button .play -text "Play!" -bd 1 -command {
     if {[info exists module]} {
         ::tclmod::player start $module
 button .stop -text "Stop" -bd 1 -command {::tclmod::player stop}

 grid .module -column 0 -row 0 -sticky we -columnspan 3
 grid .browse -column 3 -row 0
 grid .play -column 2 -row 1 -sticky we
 grid .stop -column 3 -row 1 -sticky we

DKF: They originated on the Amiga, and are basically like a combination of a MIDI instrument bank (sample set) and a MIDI file in one. (Well, the formats are completely different, but they are conceptually very similar). The formats are very good at representing complex pieces of instrumental music, but are really quite hostile to "consumer" use. They've fallen a lot out of favour due to being used a lot for doing knock-offs of copyrighted music, even though that was usually a really poor use of the format's power.

[ Category Package | Category Multimedia ]