~ubuntu-branches/ubuntu/quantal/muse/quantal

« back to all changes in this revision

Viewing changes to share/pybridge/examples/addpartexample.py

  • Committer: Package Import Robot
  • Author(s): Alessio Treglia
  • Date: 2011-08-12 11:16:41 UTC
  • mfrom: (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 26.
  • Revision ID: package-import@ubuntu.com-20110812111641-sg7bj019yhh91mpl
Tags: upstream-2.0~beta2
ImportĀ upstreamĀ versionĀ 2.0~beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""
 
2
//=========================================================
 
3
//  MusE
 
4
//  Linux Music Editor
 
5
//  (C) Copyright 2009 Mathias Gyllengahm (lunar_shuttle@users.sf.net)
 
6
//=========================================================
 
7
"""
 
8
 
 
9
import Pyro.core
 
10
muse=Pyro.core.getProxyForURI('PYRONAME://:Default.muse')
 
11
 
 
12
#
 
13
# Example on how to insert a new note, outcommented since I run the script several times and it inserts so many notes :-)
 
14
# But it works!
 
15
#
 
16
 
 
17
 
 
18
rpos = muse.getRPos()
 
19
lpos = muse.getLPos()
 
20
 
 
21
event = {'data':[61,100,0],
 
22
      'tick':0, # Relative offset of part - 0 = beginning of part
 
23
      'type':"note",
 
24
      'len':rpos - lpos}
 
25
 
 
26
part = {'events': [event],
 
27
         'tick': lpos}
 
28
muse.createPart("Track 1", lpos, rpos - lpos, part)
 
29