[clam-devel] ipyclam + pyqt + qtbinders !

David Garcia Garzon david.garcia at barcelonamedia.org
Tue Sep 6 16:45:16 PDT 2011


http://vokicodder.blogspot.com/2011/09/clam-binders-ipyclam-and-pyqt.html

Some notes on today achievements with Xavi Serra (the student, no the MTG director)
for the demo of his Final Career Project, featuring combining ipyclam, pyqt, 
clam qt widgets and the new QtBinder interface which extends to any CLAM 
application Prototyper's facility to bind unknown interfaces and networks.

The presentation of his PFC is on Friday wish him the best luck.

I recommend compile and install ipyclam and give the example below a try.

David.

------------------
$ ipython

import ipyclam
n=ipyclam.Network(ipyclam.Clam_NetworkProxy())
n.file = n.types.MonoAudioFileReader
n.out = n.types.AudioSink
n.file.Loop = 1
n.file.SourceFile = "../NetworkEditor/example-data/jaume-voice.mp3" # or any file
n.file > n.out

n # see, the connection is between ports although we conected processings

n.backend="PortAudio" # bug: 'backend' does not work with completition
n.play()
n.pause()
n.stop()

from PyQt4 import QtCore, QtGui
a=QtGui.QApplication([])

w=n.createWidget("Oscilloscope")
w.show()

# you can obtain the file output port name by typing n.file.[tab], deleting 'n.' and adding the quotes
w.setProperty("clamOutPort", "file.Samples Read")
n.bindUi(w)

n # you can see that bindUi has added an extra processing

n.play()

n.stop()

n.tonal=n.types.TonalAnalysis
n.file > n.tonal

w2 = n.createWidget("CLAM::VM::KeySpace")
w2.show()

w2.setProperty("clamOutPort", "tonal.Chord Correlation")
n.bindUi(w2)

n.play()

m=QtGui.QDialog()
m.show()
m.setLayout(QtGui.QVBoxLayout())
m.layout().addWidget(w)
m.layout().addWidget(w2)


David.



More information about the clam-devel mailing list