Esempio n. 1
0
 def update(self):
     cbox.call_on_idle()
     master = cbox.Transport.status()
     if master.tempo is not None:
         self.master_info.set_markup('%s (%s)' % (master.pos, master.pos_ppqn))
         self.timesig_info.set_markup("%s/%s" % tuple(master.timesig))
         self.tempo_adj.set_value(master.tempo)
     state = cbox.Document.get_rt().status().state
     self.status_bar.update(state[1], master.sample_rate)
     return True
Esempio n. 2
0
# Add an instance (clip) of the pattern to the track at position 0
# The clip will contain the whole pattern (it is also possible to insert
# a single slice of the pattern)
clip = trk.add_clip(0, 0, pattern_len, pattern)

# Stop the song at the end
song.set_loop(pattern_len, pattern_len)

# Set tempo - the argument must be a float
Transport.set_tempo(160.0)

# Send the updated song data to the realtime thread
song.update_playback()

print ("Song length (seconds) is %f" % (cbox.Transport.ppqn_to_samples(pattern_len) * 1.0 / Transport.status().sample_rate))

# The /master object API doesn't have any nice Python wrapper yet, so accessing
# it is a bit ugly, still - it works

# Start playback
Transport.play()
print ("Playing")

while True:
    # Get transport information - current position (samples and pulses), current tempo etc.
    master = Transport.status()
    print (master.pos_ppqn)
    # Query JACK ports, new USB devices etc.
    cbox.call_on_idle()
    time.sleep(0.1)
Esempio n. 3
0
#song.set_loop(pattern_len, pattern_len)
song.set_loop(pattern_len, pattern_len)

# Set tempo - the argument must be a float
Transport.set_tempo(160.0)

# Send the updated song data to the realtime thread
song.update_playback()

# Flush
Transport.stop()

print("Song length (seconds) is %f" %
      (cbox.Transport.ppqn_to_samples(pattern_len) * 1.0 /
       Transport.status().sample_rate))

# The /master object API doesn't have any nice Python wrapper yet, so accessing
# it is a bit ugly, still - it works

# Start playback
Transport.play()
print("Playing")

while True:
    # Get transport information - current position (samples and pulses), current tempo etc.
    master = Transport.status()
    print(master.pos_ppqn)
    # Query JACK ports, new USB devices etc.
    cbox.call_on_idle()
    time.sleep(0.1)
Esempio n. 4
0
g1.set_param("fileg_depth", "5400")
g1.set_param("fileg_release", "10")
g1.set_param("ampeg_release", "0.1")
g1.set_param("amp_veltrack", "0")
g1.set_param("volume", "-12")
g1.set_param("fileg_depthcc14", "-5400")

#g1.set_param("cutoff", "1000")
#g1.set_param("fillfo_freq", "4")
#g1.set_param("fillfo_depth", "2400")
#g1.set_param("fillfo_wave", "12")
#g1.set_param("fillfo_freqcc2", "4")

r1 = g1.new_child()
r1.set_param("sample", "*saw")
r1.set_param("transpose", "0")
r1.set_param("tune", "5")
r1.set_param("gain_cc17", "12")

r2 = g1.new_child()
r2.set_param("sample", "*sqr")
r2.set_param("transpose", "12")
r2.set_param("gain_cc17", "-12")

print(instrument.engine.status())

print("Ready!")

while True:
    cbox.call_on_idle(cmd_dumper)