File: soundbug.py

package info (click to toggle)
solfege 3.23.4-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 29,744 kB
  • sloc: python: 26,939; xml: 4,380; ansic: 1,544; sh: 807; makefile: 655; perl: 8; exp: 7
file content (49 lines) | stat: -rwxr-xr-x 1,182 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/python
"""
This script demonstrates a bug or something I don't understand about
the old OSS (not 4.1). 
"""

import sys, os
if os.getcwdu()[-4:] == "test":
    sys.path.insert(0, "..")
else:
    sys.path.insert(0, ".")
import src.i18n
src.i18n.setup(".", "C")
import soundcard
soundcard.initialise_devicefile("/dev/sequencer2", 2)
s = soundcard.solfege_c_midi

devnum = soundcard.synth.m_devnum
s.seq_start_timer()
for x in range(16):
    s.seq_set_patch(devnum, x, 48)

# these two lines are necessary to make the first tone stop.
# another solution is to use channel 0 for the first note and
# channel 1 for the second. Not that this i big deal, but it
# is not mentioned in any documentation I have read.

#s.seq_start_note(devnum, 0, 60, 90)
#s.seq_stop_note(devnum, 0, 60, 90)

s.seq_start_note(devnum, 1, 60, 90)
s.seq_delta_time(100)
s.seq_stop_note(devnum, 1, 60, 90)

s.seq_start_note(devnum, 0, 61, 90)
s.seq_delta_time(100)
s.seq_stop_note(devnum, 0, 61, 90)

s.seq_start_note(devnum, 0, 62, 90)
s.seq_delta_time(100)
s.seq_stop_note(devnum, 0, 62, 90)


s.seqbuf_dump()

import sys
print "press ENTER to continue"
sys.stdin.readline()
soundcard.synth.close()