コード例 #1
0
ファイル: main.py プロジェクト: alchy/ithaca
    def __init__(self):
        self.dco_list = i2c_detect.i2c_detect_dco()
        print "[i] dcos installed %d" % len(self.dco_list)
        if len(self.dco_list) == 0:
            print "[!] no dco found, exitting..."
            sys.exit(1)
        
        self.gain_list = i2c_detect.i2c_detect_gain()        
        print "[i] gains installed %d" % len(self.gain_list)
        #sys.exit(0)

        self.voice = {}
        self.voice_list = []
        self.global_pitch_lfo = 0
        
        self.reset_voices(len(self.dco_list))
            
        print "[i] voices inicialized %d" % len(self.voice)
        print "[i] voice 0 dco 0 i2c address: %s" % self.voice[0].dco_list[0].i2c_address
コード例 #2
0
ファイル: i2c_dco_test.py プロジェクト: alchy/ithaca
import sys
import time

import frequencies
import i2c_device as device
import i2c_dco_write as device_dco
import i2c_adsr_write as device_adsr
import i2c_detect as device_detect


DEBUG = True

dco = []
adsr = []
dco = device_detect.i2c_detect_dco()

print dco
print adsr

my_dco = dco[0]

operation = 0
my_f = frequencies.Frequencies()

for frequency in range(0, 16511, 1):
    (r2r, divider, counter) = my_f.get_frequency(frequency)
    my_dco.set_r2r(r2r)
    my_dco.set_divider(divider)
    my_dco.set_counter(counter)
    my_dco.set_gate(True)