Version 2 of Tclmod

Updated 2005-01-10 23:51:19 by Googie

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: http://scripts.one.pl/tclmod/Tclmod.html

Homepage of extension is: http://scripts.one.pl/tclmod/


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

Category Package Category Multimedia