Debian Codegraph @

src/Scripts/LiveCoding/bytesong/bytesong.py

raw symbols SCIP
1
2 # First make sure you execute these lines first to have the 'bytesong'
3 #function available
4 import sys,os
5 import PythonQt.QtGui as pqt
6
7 sys.path.append(os.getcwd()) # trick to allow importing python files from the current directory
8
9 def bytesong(PAT):
10 stopsong()
11 q.loadDocument('bytesong.csd')
12 options = '-m0 -odac --omacro:PAT=' + PAT
13 q.setOptionsText(options)
14 q.stop()
15 q.play()
16 index = q.getDocument('bytesongs.py')
17 q.setDocument(index) # GO back to this document
18
19
20 def stopsong():
21 index = q.getDocument('bytesong.csd')
22 q.stop(index)
23
24 q.loadDocument('bytesongs.py')
25 q.setDocument(q.getDocument('bytesongs.py'))
26
27 pqt.QMessageBox.information(0, 'OK', 'Bytesong functions loaded.\n Now execute the bytesong lines.')
28
29 1/0 # To force stopping here!