⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.v30

📁 freebsd v4.4内核源码
💻 V30
字号:
VoxWare v3.0------------This is a late alpha/early beta of the VoxWare v3.0 to be relased May/June 95.All features of v2.90-2 should work as earlier. There could be someomissions but they are unintentional. I started this version threadafter v2.3 so all features implemented before it are there.New features============There are now two new device interfaces. The /dev/midi## is a rawtty like interface to MIDI ports. There is a device file for each MIDIport on your system. They are named (/dev/midi00 to /dev/midiNN).The second addition is the /dev/music which is higher level interface than the old /dev/sequencer. It's intended for writing device independentapplications like sequencers./dev/midi##-----------This interface should be usefull for applications like MIDI sysex librarians.There are (currently) no timing features so making music could be impossible.There are as many /dev/midi## devices as there are MIDI ports in the system. The /dev/midi00 is connected to the first one, /dev/midi01 to the second etc.These devices work like tty devices in raw mode. Everything written to them issent out to the MIDI port. There is currently an extra delay of at most 1/100th of sec but it will be removed later.The reading algorithm is little bit more complicated. There are two differentcases:1)	There is at least one byte in the input buffer.The read returns as many bytes as it can without waiting for more bytes.For example when a process reads 100 bytes and there are 10 bytes in the buffer, the read returns just 10 bytes.2)	The input buffer is empty when the process calls read.The read waits for the first byte and then continues as in case 1. Bydefault it waits infinitely but there is an ioctl for setting a timeoutfor this. The ioctl(fd, SNDCTL_MIDI_PRETIME, &time) changes the timeout.The time is given in 1/10th of seconds (10 means one second).Other ioctl calls:ioctl(fd, SNDCTL_MIDI_MPUMODE, &mode) is available for full MPU-401compatible devices such as MPU-IPC-T, MQ PC Midi Card or MQX-32.It's not available for the so called MPU UART ports of some soundcards(PAS16, SB16 etc). By default the MIDI port is in UART mode after open. If this ioctl is called with mode=1, the interface is put to the intelligent(coprocessor) mode. NOTE! The MIDI port will be reset when this ioctl is called.It could have some strange effects if not called immediately after open. Thisvall returns EINVAL if the midi port doesn't support the MPU-401 intelligentmode.ioctl(fd, SNDCTL_MIDI_MPUCMD, &cmdstruct) is valid only if the MIDI portis put to the coprocessor mode using ioctl(SNDCTL_MIDI_MPUMODE). It's used tosend commands to a MPU-401 compatible MIDI cards. Please refer to theMPU-401 Technical Reference Manual (or Music Quest Technical ReferenceManual) for descriptions of the commands.The argument of SNDCTL_MIDI_MPUCOMMAND is of type mpu_command_rec. Ithas the following fields:typedef struct {		unsigned char cmd;		char nr_args, nr_returns;		unsigned char data[30];	} mpu_command_rec;where:	cmd		Contains the command number.	nr_args		Number of arguments of the command.			MUST BE INITIALIZED BEFORE CALL	nr_returns	Number of bytes returned by the command.			MUST BE INITIALIZED BEFORE CALL	data		Buffer for the command arguments and returned			data.Be extremely carefull with the nr_args and nr_returns fields. Theymust match the command. An incorrect value will put the card andthe driver out of sync. Refer to the MPU-401/MQX-32M documentation for furtherdatails./dev/music (/dev/sequencer2)----------------------------This device file works much like the /dev/sequencer which has been presentsince the beginning. The main differences are the following:- /dev/sequencer makes the MIDI ports to look like the synth devices. In factthe result is somewhere between the MIDI specification and the synth devices of/dev/sequencer. Both kind of devices are accessed using the SEQ_START_NOTE()like macros. The voice number parameters of the API macros have been redefinedto denote MIDI channels. This means that the driver allocates voices forthe channels automaticly (this is a responsibility/right of an applicationwith /dev/sequencer). The result is that a SEQ_START_NOTE() macro hassimilar effects for a synth channel than on a MIDI port. This kind ofsolution provides better device independence than the /dev/sequencer. Thedrawback is that the new interface doesn't permit so low level access to thedevice as the /dev/sequencer does. An application developer must choose betweenthese two interfaces. I think the old /dev/sequencer is better for applicationslike module players while the new one is better for making generic sequencerprograms.- There are no separate MIDI devices with the /dev/sequencer2. Theioctl(SNDCTL_SEQ_NRMIDIS) returns always zero. Instead the MIDI ports areshown as synth devices. ioctl(SNDCTL_SEQ_NRSYNTHS) on /dev/sequencer2 will return sum of internal synthesizers (GUS, OPL3) and MIDI ports in the systems.- The new interface is used much like the ordinary /dev/sequencer. Theevent format is new so you have to use the API macros defined in the sys/soundcard.h. The interface is will propably change before the final 3.0release but using the API macros should ensure compatibility in source level.The new event format is not recognized by version 2.X so don't try to distribute binaries compiled with soundcard.h of v3.X.- The basic API useage is similar to the current one. There are some newmacros but the older ones should work as earlier. The most importantincompatibility is that the /dev/sequencer2 driver allocates voices itself.The other one is that the application must send SEQ_START_TIMER() as it'sfirst event. Otherwise the timer is not started and the application waitsinfinitely.There are several new features but I don't document them here. There aresome info in the soundcard.h (near the end). I have also included somesample code in the directory v30. Full documentation willappear in the Hacker's Guide later.Don't hesitate to contact me in case you have questions or comments.Hannu Savolainenhannu@voxware.pp.fi

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -