\ io \ \ io_config \ configuration file for io. \ \ \ global data used to configure io's default state and behavior. Most of the \ data can be altered via the gui (see: io_screen). Some of the data is used \ to configure the io specific classes, thus this file loads before the \ modules (files in the io:modules: directory). \ \ \ see the file io_top for more information. \ \ \ constructor: Han-earl Park \ copyright 2008 buster & friends' C-ALTO Labs \ \ www.busterandfriends.com/io \ \ (Edinburgh, November 1996 - \ (London, August 1997 - \ (Den Haag, October 1997 - \ (Valencia, March 1999 - \ (Southampton, May 2000 - \ (Cork, April 2006 - \ \ (Cork, October 2008 - \ \ REV: 0.0.1 alpha (Southampton, October 2000) \ REV: 0.0.1 beta (Southampton, November 2000) \ REV: 0.0.1 alpha++ (Southampton, July 2004) \ REV: 0.0.1 beta++ (Cork, May 2010) \ \ \ MOD: HeP 03/05/99 Started project afresh! \ This version keeps most of the "intelligence" in the \ objects, while the piece specific elements are kept to a \ minimum. It is also a test for the "laurie" project. \ MOD: HeP 02/07/00 Get rid of conditional compilation of the multiple \ instrument objects -- they all get compiled now. \ Same goes for the input parsers. \ MOD: HeP 04/17/00 Load io_config before the modules. \ Move the constant hp_range to io_config. \ MOD: HeP 05/09/00 Renumber the _parser type constants in accordance with the \ order they appear in the config-screen. \ MOD: HeP 06/07/00 Add the io_file? constant for compiling the file stuff. \ Move hp_ constants to io_glob. \ MOD: HeP 06/26/00 Able to mute midi output testing. \ MOD: HeP 09/21/00 Set value of time-advance to io_rtc_rate. \ MOD: HeP 09/22/00 MIDI.SER.TERM disables MIDI instead of the manual way. \ MOD: HeP 10/01/00 Set if-debug to true if io_test? is true. \ MOD: HeP 10/11/00 Use dictionary space char array for default parser types. \ MOD: HeP 10/13/00 Value of constant io_#input is dependent on the number of \ elements defined for array io_parser. \ REV: 0.0.1 alpha __________________________________________________________ \ MOD: HeP 10/31/00 Use TEST" TOP" and SUB" for printout during testing. \ MOD: HeP 11/14/00 Add constant #parsers_enabled for default number of \ enabled parsers. \ MOD: HeP 11/18/00 Add INPUT.PARSER@ and INPUT.CHANNEL@ to make io_input and \ io_screen more readable. \ REV: 0.0.1 beta __________________________________________________________ \ MOD: HeP 03-30-04 Add constant use_reverb? to set reverb on output device. \ MOD: HeP 04-11-04 Current reverb and pan settings are stored in variables \ defined in io_output. The constants use_reverb? and \ use_pan? are just the default settings. \ Add constant io_output_device_id#. \ MOD: HeP 04-15-04 Trash io_script? which wasn't being used. \ REV: 0.0.1 a ++ __________________________________________________________ \ MOD: HeP 11-09-08 Make io_min_pulse and io_max_pulse dependent on \ io_rtc_rate. \ MOD: HeP 03-22-09 Setting of rtc.rate! and time-advance moved to io_glob. \ REV: 0.0.1 b ++ __________________________________________________________ \ Version for performance at Blackrock Castle Observatory, \ Cork, Ireland, May 25, 2010. anew task-io_config \ complication switches false constant io_test? \ compile testing code? false constant io_turnkey? \ tunkeying application? true constant io_screen? \ enable hmsl gui? false constant io_file? \ load "settings" file utilities? false constant io_4gel? \ 4GEL \ input & output false constant mute_output? \ for testing without midi output 01 constant io_input_chan# \ default input channel number 01 constant io_output_chan# \ default output channel (except dr_instr) 01 constant io_output_device_id# \ default output device id# \ input devices 12 constant io_input_bend \ default bend range 00 constant mono_parser 01 constant poly_parser 02 constant guitar_parser create io_parser here guitar_parser c, mono_parser c, mono_parser c, here swap - constant io_#input \ max number of input parsers 01 io_#input MIN constant #parsers_enabled \ number of enabled parsers : INPUT.PARSER@ ( indx -- p_type , retrieve default parser type ) io_parser + c@ ; : INPUT.CHANNEL@ ( indx -- chan# , retrieve default input channel# ) io_input_chan# 1- \ swap 0 DO i input.parser@ CASE mono_parser OF 1+ ENDOF poly_parser OF 1+ ENDOF guitar_parser OF 6 + ENDOF ENDCASE LOOP \ 16 mod 1+ ; \ output device 00 constant vl_instr 01 constant gm_instr 02 constant dr_instr vl_instr constant io_instr \ default output instrument true constant use_pan? \ use midi pan control? false constant use_reverb? \ option to bypass reverb on output device? \ user midi control 01 constant io_ui_chan# 64 constant io_ui_c1 67 constant io_ui_c2 00 constant io_ui_control \ use midi controller 01 constant io_ui_preset \ midi preset incr/decr messages 02 constant io_ui_song \ midi start, stop and continue messages io_ui_preset constant io_ui \ default function controller \ clock 400 constant io_rtc_rate io_rtc_rate 20 / 10 max constant io_min_pulse io_rtc_rate constant io_max_pulse 8 io_max_pulse * constant io_timeout \ solo if no input for this time \ performance duration 30 io_rtc_rate * constant min_pdur 600 io_rtc_rate * constant max_pdur \ maximum reasonable value 273 io_rtc_rate * constant io_pdur \ 4'33" \ testing io_test? .IF : top" ( -- , top level text ) compile >newline [compile] ." compile cr ; immediate : test" ( -- , print text on execution ) compile tab [compile] ." compile cr ; immediate : sub" ( -- , subroutine text ) compile tab [compile] test" ; immediate .ELSE : top" ( -- , top level text ) ascii " word drop \ hope this doesn't store text in dictionary! ; immediate : test" ( -- , ignore text ) [compile] top" ; immediate : sub" ( -- , subroutine text ) [compile] top" ; immediate .THEN \ setup & clearup : IO.CONFIG.INIT ( -- ) test" IO.CONFIG.INIT" \ [ io_test? .IF ] \ if-debug ON [ .THEN ] \ [ mute_output? .IF ] midi.ser.term time.init \ disable midi io [ .THEN ] ; : IO.CONFIG.TERM ( -- ) test" IO.CONFIG.TERM" \ [ io_test? .IF ] if-debug OFF [ .THEN ] ; if.forgotten io.config.term io_test? .IF : PRINT.ENABLED? ( flag -- ) IF ." on" ELSE ." --" THEN ; : PRINT.INPUT.DEVICES ( -- ) io_#input 0 DO io_parser i + c@ CASE mono_parser OF 'c mono_parser >name $. ENDOF poly_parser OF 'c poly_parser >name $. ENDOF guitar_parser OF 'c guitar_parser >name $. ENDOF \ ." Unrecognized" ENDCASE 2 spaces LOOP ; : PRINT.OUTPUT.DEVICE ( -- ) io_instr CASE vl_instr OF 'c vl_instr >name $. ENDOF gm_instr OF 'c gm_instr >name $. ENDOF dr_instr OF 'c dr_instr >name $. ENDOF \ ." Unrecognized" ENDCASE ; : PRINT.UI.TYPE ( -- ) io_ui CASE io_ui_control OF 'c io_ui_control >name $. ENDOF io_ui_preset OF 'c io_ui_preset >name $. ENDOF io_ui_song OF 'c io_ui_song >name $. ENDOF \ ." Unrecognized" ENDCASE ; : IO.CONFIG.PRINT ( -- ) >newline ." IO_CONFIG" cr ." Compilation" cr ." testing code =" io_test? print.enabled? tab ." turnkey app =" io_turnkey? print.enabled? cr ." gui screen =" io_screen? print.enabled? tab ." file system =" io_file? print.enabled? cr ." 4GEL? =" io_4gel? print.enabled? cr ." Input & Output" cr ." input chan# =" io_input_chan# 6 .r tab ." output chan# =" io_output_chan# 6 .r cr ." input bend =" io_input_bend 6 .r tab ." output pan? =" use_pan? print.enabled? cr ." max# parsers =" io_#input 6 .r cr ." input device = " print.input.devices cr ." output device = " print.output.device cr ." User Control" cr ." ui channel# =" io_ui_chan# 6 .r tab ." ctrl type = " print.ui.type cr ." ui ctrl #1 =" io_ui_c1 6 .r tab ." ui ctrl #2 =" io_ui_c2 6 .r cr ." Clock" cr ." rtc rate =" io_rtc_rate 6 .r tab ." time out =" io_timeout 6 .r cr ." minimum pulse =" io_min_pulse 6 .r tab ." maximum pulse =" io_max_pulse 6 .r cr ." Perf Duration" cr ." minimum pdur =" min_pdur 6 .r tab ." maximum pdur =" max_pdur 6 .r cr ." default pdur =" io_pdur 6 .r cr mute_output? IF ." *** Warning: MIDI output muted! ***" cr THEN ; .THEN