Lines Matching +full:channel +full:- +full:spacing

1 /*-
2 * spkr.c -- device driver for console speaker
46 * PPI controls whether sound is passed through at all; the PIT's channel 2 is
118 * M[LNS] are missing; the ~ synonym and the _ slur mark and the octave-
124 #define dtoi(c) ((c) - '0')
127 static int whole; /* whole-note time at current tempo, in ticks */
129 static int fill; /* controls spacing of notes */
130 static bool octtrack; /* octave-tracking on? */
131 static bool octprefix; /* override current octave-tracking state? */
139 #define DFLT_VALUE 4 /* default value (quarter-note) */
151 /* letter to half-tone: A B C D E F G */
155 * This is the American Standard A440 Equal-Tempered scale with frequencies
191 /* this weirdness avoids floating-point arithmetic */ in playtone()
192 for (; sustain; sustain--) { in playtone()
201 if (pitch == -1) in playtone()
205 - (whole * (FILLTIME - fill)) / (value * FILLTIME); in playtone()
206 silence = whole * (FILLTIME-fill) * snum / (FILLTIME * value * sdenom); in playtone()
228 {v = v * 10 + (*++cp - '0'); slen--;} in playstring()
229 for (; slen--; cp++) { in playstring()
246 pitch = notetab[c - 'A'] + octave * OCTAVE_NOTES; in playstring()
252 slen--; in playstring()
253 } else if (cp[1] == '-') { in playstring()
254 --pitch; in playstring()
256 slen--; in playstring()
260 * If octave-tracking mode is on, and there has been no octave- in playstring()
265 if (abs(pitch-lastpitch) > abs(pitch+OCTAVE_NOTES - in playstring()
271 if (abs(pitch-lastpitch) > abs((pitch-OCTAVE_NOTES) - in playstring()
273 --octave; in playstring()
274 pitch -= OCTAVE_NOTES; in playstring()
287 slen--; in playstring()
296 slen--; in playstring()
308 slen--; in playstring()
312 slen--; in playstring()
321 if (octave < nitems(pitchtab) / OCTAVE_NOTES - 1) in playstring()
327 octave--; in playstring()
333 slen--; in playstring()
340 slen--; in playstring()
342 playtone(pitch - 1, value, sustain); in playstring()
357 slen--; in playstring()
360 playtone(-1, timeval, sustain); in playstring()
372 slen--; in playstring()
376 slen--; in playstring()
380 slen--; in playstring()
421 devtoname(dev), uio->uio_resid); in spkrwrite()
424 if (uio->uio_resid > (DEV_BSIZE - 1)) /* prevent system crashes */ in spkrwrite()
431 n = uio->uio_resid; in spkrwrite()
468 if (tp->frequency == 0) in spkrioctl()
469 rest(tp->duration); in spkrioctl()
471 tone(tp->frequency, tp->duration); in spkrioctl()