diff options
author | Walter Bender <walter@walter-laptop.(none)> | 2009-11-05 22:27:18 (GMT) |
---|---|---|
committer | Walter Bender <walter@walter-laptop.(none)> | 2009-11-05 22:27:18 (GMT) |
commit | 33734906724a0f9bf8c61b4e602a4cacc66951bb (patch) | |
tree | 2a0e9f2f55d983e8bb56285e3995158f71608c93 |
new project
-rw-r--r-- | COPYING | 20 | ||||
-rw-r--r-- | ErikosActivity.py | 149 | ||||
-rw-r--r-- | MANIFEST | 27 | ||||
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | Sounds/acguit | bin | 0 -> 32360 bytes | |||
-rw-r--r-- | Sounds/alarm | bin | 0 -> 71140 bytes | |||
-rw-r--r-- | Sounds/armbone | bin | 0 -> 5154 bytes | |||
-rw-r--r-- | Sounds/babylaugh | bin | 0 -> 55724 bytes | |||
-rw-r--r-- | Sounds/babyuhoh | bin | 0 -> 37630 bytes | |||
-rw-r--r-- | Sounds/banjo | bin | 0 -> 69260 bytes | |||
-rw-r--r-- | Sounds/basse | bin | 0 -> 32516 bytes | |||
-rw-r--r-- | Sounds/basse2 | bin | 0 -> 11206 bytes | |||
-rw-r--r-- | Sounds/bird | bin | 0 -> 32804 bytes | |||
-rw-r--r-- | Sounds/bottle | bin | 0 -> 19206 bytes | |||
-rw-r--r-- | Sounds/bubbles | bin | 0 -> 40364 bytes | |||
-rw-r--r-- | Sounds/byke | bin | 0 -> 32726 bytes | |||
-rw-r--r-- | Sounds/camera | bin | 0 -> 22564 bytes | |||
-rw-r--r-- | Sounds/car | bin | 0 -> 63940 bytes | |||
-rw-r--r-- | Sounds/carhorn | bin | 0 -> 79844 bytes | |||
-rw-r--r-- | Sounds/cat | bin | 0 -> 18160 bytes | |||
-rw-r--r-- | Sounds/cello | bin | 0 -> 152352 bytes | |||
-rw-r--r-- | Sounds/chiken | bin | 0 -> 31554 bytes | |||
-rw-r--r-- | Sounds/chimes | bin | 0 -> 218924 bytes | |||
-rw-r--r-- | Sounds/clang | bin | 0 -> 41150 bytes | |||
-rw-r--r-- | Sounds/clang2 | bin | 0 -> 46210 bytes | |||
-rw-r--r-- | Sounds/clarinette | bin | 0 -> 105078 bytes | |||
-rw-r--r-- | Sounds/clavinet | bin | 0 -> 33428 bytes | |||
-rw-r--r-- | Sounds/cling | bin | 0 -> 31758 bytes | |||
-rw-r--r-- | Sounds/cow | bin | 0 -> 52060 bytes | |||
-rw-r--r-- | Sounds/crash | bin | 0 -> 20352 bytes | |||
-rw-r--r-- | Sounds/cricket | bin | 0 -> 5304 bytes | |||
-rw-r--r-- | Sounds/diceinst | bin | 0 -> 12658 bytes | |||
-rw-r--r-- | Sounds/didjeridu | bin | 0 -> 60788 bytes | |||
-rw-r--r-- | Sounds/dog | bin | 0 -> 22332 bytes | |||
-rw-r--r-- | Sounds/door | bin | 0 -> 33640 bytes | |||
-rw-r--r-- | Sounds/drum1chine | bin | 0 -> 20480 bytes | |||
-rw-r--r-- | Sounds/drum1crash | bin | 0 -> 64044 bytes | |||
-rw-r--r-- | Sounds/drum1floortom | bin | 0 -> 38498 bytes | |||
-rw-r--r-- | Sounds/drum1hardride | bin | 0 -> 80044 bytes | |||
-rw-r--r-- | Sounds/drum1hatpedal | bin | 0 -> 23022 bytes | |||
-rw-r--r-- | Sounds/drum1hatshoulder | bin | 0 -> 28508 bytes | |||
-rw-r--r-- | Sounds/drum1kick | bin | 0 -> 32044 bytes | |||
-rw-r--r-- | Sounds/drum1kit | bin | 0 -> 32044 bytes | |||
-rw-r--r-- | Sounds/drum1ridebell | bin | 0 -> 80044 bytes | |||
-rw-r--r-- | Sounds/drum1snare | bin | 0 -> 32044 bytes | |||
-rw-r--r-- | Sounds/drum1snaresidestick | bin | 0 -> 5726 bytes | |||
-rw-r--r-- | Sounds/drum1splash | bin | 0 -> 48044 bytes | |||
-rw-r--r-- | Sounds/drum1tom | bin | 0 -> 37152 bytes | |||
-rw-r--r-- | Sounds/drum2darbukadoom | bin | 0 -> 38652 bytes | |||
-rw-r--r-- | Sounds/drum2darbukafinger | bin | 0 -> 22470 bytes | |||
-rw-r--r-- | Sounds/drum2darbukapied | bin | 0 -> 32106 bytes | |||
-rw-r--r-- | Sounds/drum2darbukapiedsoft | bin | 0 -> 24454 bytes | |||
-rw-r--r-- | Sounds/drum2darbukaroll | bin | 0 -> 27176 bytes | |||
-rw-r--r-- | Sounds/drum2darbukaslap | bin | 0 -> 25672 bytes | |||
-rw-r--r-- | Sounds/drum2darbukatak | bin | 0 -> 12882 bytes | |||
-rw-r--r-- | Sounds/drum2hatflanger | bin | 0 -> 64246 bytes | |||
-rw-r--r-- | Sounds/drum2hatpied | bin | 0 -> 14638 bytes | |||
-rw-r--r-- | Sounds/drum2hatpied2 | bin | 0 -> 14460 bytes | |||
-rw-r--r-- | Sounds/drum2kit | bin | 0 -> 38652 bytes | |||
-rw-r--r-- | Sounds/drum2tambourinepied | bin | 0 -> 33262 bytes | |||
-rw-r--r-- | Sounds/drum2tambourinepiedsoft | bin | 0 -> 19470 bytes | |||
-rw-r--r-- | Sounds/drum3cowbell | bin | 0 -> 15950 bytes | |||
-rw-r--r-- | Sounds/drum3cowbelltip | bin | 0 -> 12872 bytes | |||
-rw-r--r-- | Sounds/drum3cup | bin | 0 -> 15926 bytes | |||
-rw-r--r-- | Sounds/drum3djembelow | bin | 0 -> 32080 bytes | |||
-rw-r--r-- | Sounds/drum3djembemid | bin | 0 -> 15050 bytes | |||
-rw-r--r-- | Sounds/drum3djembesidestick | bin | 0 -> 13602 bytes | |||
-rw-r--r-- | Sounds/drum3djembeslap | bin | 0 -> 24090 bytes | |||
-rw-r--r-- | Sounds/drum3djembestickmid | bin | 0 -> 25722 bytes | |||
-rw-r--r-- | Sounds/drum3kit | bin | 0 -> 13602 bytes | |||
-rw-r--r-- | Sounds/drum3metalstand | bin | 0 -> 16108 bytes | |||
-rw-r--r-- | Sounds/drum3pedalperc | bin | 0 -> 16160 bytes | |||
-rw-r--r-- | Sounds/drum3rainstick | bin | 0 -> 56454 bytes | |||
-rw-r--r-- | Sounds/drum3tambourinehigh | bin | 0 -> 15996 bytes | |||
-rw-r--r-- | Sounds/drum3tambourinelow | bin | 0 -> 15506 bytes | |||
-rw-r--r-- | Sounds/drum4afrofeet | bin | 0 -> 23774 bytes | |||
-rw-r--r-- | Sounds/drum4fingersn | bin | 0 -> 33644 bytes | |||
-rw-r--r-- | Sounds/drum4kit | bin | 0 -> 20920 bytes | |||
-rw-r--r-- | Sounds/drum4mutecuic | bin | 0 -> 12738 bytes | |||
-rw-r--r-- | Sounds/drum4stompbass | bin | 0 -> 22026 bytes | |||
-rw-r--r-- | Sounds/drum4tambouri | bin | 0 -> 21382 bytes | |||
-rw-r--r-- | Sounds/drum4tr707clap | bin | 0 -> 11456 bytes | |||
-rw-r--r-- | Sounds/drum4tr707open | bin | 0 -> 29702 bytes | |||
-rw-r--r-- | Sounds/drum4tr808closed | bin | 0 -> 7530 bytes | |||
-rw-r--r-- | Sounds/drum4tr808sn | bin | 0 -> 17474 bytes | |||
-rw-r--r-- | Sounds/drum4tr909bass | bin | 0 -> 61846 bytes | |||
-rw-r--r-- | Sounds/drum4tr909kick | bin | 0 -> 27516 bytes | |||
-rw-r--r-- | Sounds/drum4tr909sn | bin | 0 -> 20920 bytes | |||
-rw-r--r-- | Sounds/drum5agogoaigu | bin | 0 -> 22366 bytes | |||
-rw-r--r-- | Sounds/drum5agogograve | bin | 0 -> 19796 bytes | |||
-rw-r--r-- | Sounds/drum5bongoaiguouvert | bin | 0 -> 11418 bytes | |||
-rw-r--r-- | Sounds/drum5bongograveouvert | bin | 0 -> 14442 bytes | |||
-rw-r--r-- | Sounds/drum5congaaiguouvert | bin | 0 -> 16146 bytes | |||
-rw-r--r-- | Sounds/drum5congagraveferme | bin | 0 -> 9674 bytes | |||
-rw-r--r-- | Sounds/drum5congagraveouvert | bin | 0 -> 14490 bytes | |||
-rw-r--r-- | Sounds/drum5guiroretour | bin | 0 -> 14462 bytes | |||
-rw-r--r-- | Sounds/drum5kit | bin | 0 -> 11418 bytes | |||
-rw-r--r-- | Sounds/drum5quicaaigu | bin | 0 -> 10410 bytes | |||
-rw-r--r-- | Sounds/drum5quicamedium | bin | 0 -> 11398 bytes | |||
-rw-r--r-- | Sounds/drum5timablesaiguslap | bin | 0 -> 33698 bytes | |||
-rw-r--r-- | Sounds/drum5timablesslap | bin | 0 -> 37170 bytes | |||
-rw-r--r-- | Sounds/drum5vibraslap | bin | 0 -> 52238 bytes | |||
-rw-r--r-- | Sounds/drum6kit | bin | 0 -> 21504 bytes | |||
-rw-r--r-- | Sounds/drum6kit.orig | bin | 0 -> 172794 bytes | |||
-rw-r--r-- | Sounds/drum6madal00 | bin | 0 -> 14382 bytes | |||
-rw-r--r-- | Sounds/drum6madal01 | bin | 0 -> 11532 bytes | |||
-rw-r--r-- | Sounds/drum6madal02 | bin | 0 -> 10530 bytes | |||
-rw-r--r-- | Sounds/drum6madal03 | bin | 0 -> 8982 bytes | |||
-rw-r--r-- | Sounds/drum6madal04 | bin | 0 -> 11852 bytes | |||
-rw-r--r-- | Sounds/drum6madal05 | bin | 0 -> 21504 bytes | |||
-rw-r--r-- | Sounds/drum6madal06 | bin | 0 -> 16148 bytes | |||
-rw-r--r-- | Sounds/drum6madal07 | bin | 0 -> 16090 bytes | |||
-rw-r--r-- | Sounds/drum6madal08 | bin | 0 -> 11878 bytes | |||
-rw-r--r-- | Sounds/drum6madal09 | bin | 0 -> 21474 bytes | |||
-rw-r--r-- | Sounds/drum6madal10 | bin | 0 -> 11352 bytes | |||
-rw-r--r-- | Sounds/drum6madal11 | bin | 0 -> 15914 bytes | |||
-rw-r--r-- | Sounds/drum6madal12 | bin | 0 -> 32700 bytes | |||
-rw-r--r-- | Sounds/duck | bin | 0 -> 12942 bytes | |||
-rw-r--r-- | Sounds/duck2 | bin | 0 -> 7840 bytes | |||
-rw-r--r-- | Sounds/fingercymbals | bin | 0 -> 68426 bytes | |||
-rw-r--r-- | Sounds/flugel | bin | 0 -> 118102 bytes | |||
-rw-r--r-- | Sounds/flute | bin | 0 -> 26902 bytes | |||
-rw-r--r-- | Sounds/foghorn | bin | 0 -> 139456 bytes | |||
-rw-r--r-- | Sounds/frogs | bin | 0 -> 161400 bytes | |||
-rw-r--r-- | Sounds/gam | bin | 0 -> 31848 bytes | |||
-rw-r--r-- | Sounds/guidice1 | bin | 0 -> 10610 bytes | |||
-rw-r--r-- | Sounds/guidice10 | bin | 0 -> 12298 bytes | |||
-rw-r--r-- | Sounds/guidice2 | bin | 0 -> 16130 bytes | |||
-rw-r--r-- | Sounds/guidice3 | bin | 0 -> 14980 bytes | |||
-rw-r--r-- | Sounds/guidice4 | bin | 0 -> 14128 bytes | |||
-rw-r--r-- | Sounds/guidice5 | bin | 0 -> 9760 bytes | |||
-rw-r--r-- | Sounds/guidice6 | bin | 0 -> 12658 bytes | |||
-rw-r--r-- | Sounds/guidice7 | bin | 0 -> 11148 bytes | |||
-rw-r--r-- | Sounds/guidice8 | bin | 0 -> 11720 bytes | |||
-rw-r--r-- | Sounds/guidice9 | bin | 0 -> 12376 bytes | |||
-rw-r--r-- | Sounds/guit | bin | 0 -> 32432 bytes | |||
-rw-r--r-- | Sounds/guit2 | bin | 0 -> 82082 bytes | |||
-rw-r--r-- | Sounds/guitmute | bin | 0 -> 15700 bytes | |||
-rw-r--r-- | Sounds/guitshort | bin | 0 -> 8666 bytes | |||
-rw-r--r-- | Sounds/harmonica | bin | 0 -> 10396 bytes | |||
-rw-r--r-- | Sounds/harmonium | bin | 0 -> 34576 bytes | |||
-rw-r--r-- | Sounds/harpsichord | bin | 0 -> 49924 bytes | |||
-rw-r--r-- | Sounds/hey | bin | 0 -> 14508 bytes | |||
-rw-r--r-- | Sounds/horse | bin | 0 -> 36966 bytes | |||
-rw-r--r-- | Sounds/kalimba | bin | 0 -> 14496 bytes | |||
-rw-r--r-- | Sounds/koto | bin | 0 -> 29288 bytes | |||
-rw-r--r-- | Sounds/laugh | bin | 0 -> 18112 bytes | |||
-rw-r--r-- | Sounds/mando | bin | 0 -> 68326 bytes | |||
-rw-r--r-- | Sounds/marimba | bin | 0 -> 15850 bytes | |||
-rw-r--r-- | Sounds/mic1 | bin | 0 -> 44 bytes | |||
-rw-r--r-- | Sounds/mic2 | bin | 0 -> 44 bytes | |||
-rw-r--r-- | Sounds/mic3 | bin | 0 -> 44 bytes | |||
-rw-r--r-- | Sounds/mic4 | bin | 0 -> 44 bytes | |||
-rw-r--r-- | Sounds/ocarina | bin | 0 -> 8610 bytes | |||
-rw-r--r-- | Sounds/ounk | bin | 0 -> 15232 bytes | |||
-rw-r--r-- | Sounds/ow | bin | 0 -> 20300 bytes | |||
-rw-r--r-- | Sounds/piano | bin | 0 -> 96828 bytes | |||
-rw-r--r-- | Sounds/plane | bin | 0 -> 69662 bytes | |||
-rw-r--r-- | Sounds/rhodes | bin | 0 -> 30080 bytes | |||
-rw-r--r-- | Sounds/sarangi | bin | 0 -> 49132 bytes | |||
-rw-r--r-- | Sounds/sarangi.orig | bin | 0 -> 164992 bytes | |||
-rw-r--r-- | Sounds/saxo | bin | 0 -> 29702 bytes | |||
-rw-r--r-- | Sounds/saxsoprano | bin | 0 -> 74918 bytes | |||
-rw-r--r-- | Sounds/sheep | bin | 0 -> 39768 bytes | |||
-rw-r--r-- | Sounds/shenai | bin | 0 -> 14716 bytes | |||
-rw-r--r-- | Sounds/sitar | bin | 0 -> 66104 bytes | |||
-rw-r--r-- | Sounds/slap | bin | 0 -> 17534 bytes | |||
-rw-r--r-- | Sounds/templebell | bin | 0 -> 23804 bytes | |||
-rw-r--r-- | Sounds/templebell.orig | bin | 0 -> 86973 bytes | |||
-rw-r--r-- | Sounds/triangle | bin | 0 -> 127866 bytes | |||
-rw-r--r-- | Sounds/trumpet | bin | 0 -> 72956 bytes | |||
-rw-r--r-- | Sounds/tuba | bin | 0 -> 25876 bytes | |||
-rw-r--r-- | Sounds/ukulele | bin | 0 -> 60594 bytes | |||
-rw-r--r-- | Sounds/violin | bin | 0 -> 21884 bytes | |||
-rw-r--r-- | Sounds/voix | bin | 0 -> 39052 bytes | |||
-rw-r--r-- | Sounds/water | bin | 0 -> 19512 bytes | |||
-rw-r--r-- | Sounds/zap | bin | 0 -> 24218 bytes | |||
-rw-r--r-- | activity/activity-erikos.svg | 43 | ||||
-rw-r--r-- | activity/activity.info | 8 | ||||
-rw-r--r-- | constants.py | 23 | ||||
-rw-r--r-- | images/Aoff.svg | 20 | ||||
-rw-r--r-- | images/Aon.svg | 20 | ||||
-rw-r--r-- | images/Boff.svg | 20 | ||||
-rw-r--r-- | images/Bon.svg | 20 | ||||
-rw-r--r-- | images/Coff.svg | 20 | ||||
-rw-r--r-- | images/Con.svg | 20 | ||||
-rw-r--r-- | images/Doff.svg | 20 | ||||
-rw-r--r-- | images/Don.svg | 20 | ||||
-rwxr-xr-x | setup.py | 5 | ||||
-rwxr-xr-x | sound.py | 268 | ||||
-rw-r--r-- | sprite_factory.py | 51 | ||||
-rw-r--r-- | sprites.py | 153 | ||||
-rw-r--r-- | window.py | 223 |
193 files changed, 1134 insertions, 0 deletions
@@ -0,0 +1,20 @@ +Copyright (c) 2007-9, Playful Invention Company, Sugar Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/ErikosActivity.py b/ErikosActivity.py new file mode 100644 index 0000000..213cccb --- /dev/null +++ b/ErikosActivity.py @@ -0,0 +1,149 @@ +# -*- coding: utf-8 -*- +#Copyright (c) 2009, Walter Bender + +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: + +#The above copyright notice and this permission notice shall be included in +#all copies or substantial portions of the Software. + +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +#THE SOFTWARE. + +import pygtk +pygtk.require('2.0') +import gtk +import gobject + +import sugar +from sugar.activity import activity +try: # 0.86+ toolbar widgets + from sugar.bundle.activitybundle import ActivityBundle + from sugar.activity.widgets import ActivityToolbarButton + from sugar.activity.widgets import StopButton + from sugar.graphics.toolbarbox import ToolbarBox + from sugar.graphics.toolbarbox import ToolbarButton +except ImportError: + pass +from sugar.graphics.toolbutton import ToolButton +from sugar.graphics.menuitem import MenuItem +from sugar.graphics.icon import Icon +from sugar.datastore import datastore + +from gettext import gettext as _ +import locale +import os.path + +import logging +_logger = logging.getLogger("erikos-activity") + +from sprites import * +import window + +# +# Sugar activity +# +class ErikosActivity(activity.Activity): + + def __init__(self, handle): + super(ErikosActivity,self).__init__(handle) + + try: + # Use 0.86 toolbar design + toolbar_box = ToolbarBox() + + # Buttons added to the Activity toolbar + activity_button = ActivityToolbarButton(self) + toolbar_box.toolbar.insert(activity_button, 0) + activity_button.show() + + # Play Button + self.play = ToolButton( "media-playback-start" ) + self.play.set_tooltip(_('Play')) + self.play.props.sensitive = True + self.play.connect('clicked', self._play_cb) + toolbar_box.toolbar.insert(self.play, -1) + self.play.show() + + separator = gtk.SeparatorToolItem() + separator.props.draw = False + separator.set_expand(True) + separator.show() + toolbar_box.toolbar.insert(separator, -1) + + # The ever-present Stop Button + stop_button = StopButton(self) + stop_button.props.accelerator = '<Ctrl>Q' + toolbar_box.toolbar.insert(stop_button, -1) + stop_button.show() + + self.set_toolbar_box(toolbar_box) + toolbar_box.show() + + except NameError: + # Use pre-0.86 toolbar design + self.toolbox = activity.ActivityToolbox(self) + self.set_toolbox(self.toolbox) + + self.projectToolbar = ProjectToolbar(self) + self.toolbox.add_toolbar( _('Project'), self.projectToolbar ) + + self.toolbox.show() + + # Create a canvas + canvas = gtk.DrawingArea() + canvas.set_size_request(gtk.gdk.screen_width(), \ + gtk.gdk.screen_height()) + self.set_canvas(canvas) + canvas.show() + self.show_all() + + # Initialize the canvas + self.tw = window.new_window(canvas, \ + os.path.join(activity.get_bundle_path(), \ + 'images/'), \ + self) + + # Read the level from the Journal + try: + tw,level = int(self.metadata['level']) + except: + pass + + def _play_cb(self, button): + window._play_the_game(self.tw) + return True + + """ + Write the slider positions to the Journal + """ + def write_file(self, file_path): + _logger.debug("Write level: " + str(self.tw.level)) + self.metadata['level'] = self.tw.level + +# +# Project toolbar for pre-0.86 toolbars +# +class ProjectToolbar(gtk.Toolbar): + + def __init__(self, pc): + gtk.Toolbar.__init__(self) + self.activity = pc + + # Play button + self.activity.play = ToolButton( "media-playback-start" ) + self.activity.play.set_tooltip(_('Play')) + self.activity.play.props.sensitive = True + self.activity.play.connect('clicked', self.activity._play_cb) + self.insert(self.activity.play, -1) + self.activity.play.show() + diff --git a/MANIFEST b/MANIFEST new file mode 100644 index 0000000..a27ca74 --- /dev/null +++ b/MANIFEST @@ -0,0 +1,27 @@ +C.py +SlideruleActivity.py +NEWS + +COPYING +sprites.py +window.py +D.py + +setup.py +activity/activity-sliderule.svg +activity/activity.info +images/D.svg +images/reticule.svg +images/C.svg +po/Sliderule.pot + + + +constants.py +sprite_factory.py +activity/activity-sliderule.png +images/tab.svg +A.py +images/A.svg +icons/A.svg +icons/C.svg @@ -0,0 +1,4 @@ +1 + +* new project + diff --git a/Sounds/acguit b/Sounds/acguit Binary files differnew file mode 100644 index 0000000..2e28014 --- /dev/null +++ b/Sounds/acguit diff --git a/Sounds/alarm b/Sounds/alarm Binary files differnew file mode 100644 index 0000000..73b7628 --- /dev/null +++ b/Sounds/alarm diff --git a/Sounds/armbone b/Sounds/armbone Binary files differnew file mode 100644 index 0000000..38fc68a --- /dev/null +++ b/Sounds/armbone diff --git a/Sounds/babylaugh b/Sounds/babylaugh Binary files differnew file mode 100644 index 0000000..9c72bd3 --- /dev/null +++ b/Sounds/babylaugh diff --git a/Sounds/babyuhoh b/Sounds/babyuhoh Binary files differnew file mode 100644 index 0000000..705f61a --- /dev/null +++ b/Sounds/babyuhoh diff --git a/Sounds/banjo b/Sounds/banjo Binary files differnew file mode 100644 index 0000000..f15278d --- /dev/null +++ b/Sounds/banjo diff --git a/Sounds/basse b/Sounds/basse Binary files differnew file mode 100644 index 0000000..2bc1571 --- /dev/null +++ b/Sounds/basse diff --git a/Sounds/basse2 b/Sounds/basse2 Binary files differnew file mode 100644 index 0000000..744d196 --- /dev/null +++ b/Sounds/basse2 diff --git a/Sounds/bird b/Sounds/bird Binary files differnew file mode 100644 index 0000000..fbe8a29 --- /dev/null +++ b/Sounds/bird diff --git a/Sounds/bottle b/Sounds/bottle Binary files differnew file mode 100644 index 0000000..8f3d680 --- /dev/null +++ b/Sounds/bottle diff --git a/Sounds/bubbles b/Sounds/bubbles Binary files differnew file mode 100644 index 0000000..849ff02 --- /dev/null +++ b/Sounds/bubbles diff --git a/Sounds/byke b/Sounds/byke Binary files differnew file mode 100644 index 0000000..6f428b8 --- /dev/null +++ b/Sounds/byke diff --git a/Sounds/camera b/Sounds/camera Binary files differnew file mode 100644 index 0000000..8eaa5b5 --- /dev/null +++ b/Sounds/camera diff --git a/Sounds/car b/Sounds/car Binary files differnew file mode 100644 index 0000000..66e42ae --- /dev/null +++ b/Sounds/car diff --git a/Sounds/carhorn b/Sounds/carhorn Binary files differnew file mode 100644 index 0000000..fbbd02b --- /dev/null +++ b/Sounds/carhorn diff --git a/Sounds/cat b/Sounds/cat Binary files differnew file mode 100644 index 0000000..845ee8e --- /dev/null +++ b/Sounds/cat diff --git a/Sounds/cello b/Sounds/cello Binary files differnew file mode 100644 index 0000000..31720df --- /dev/null +++ b/Sounds/cello diff --git a/Sounds/chiken b/Sounds/chiken Binary files differnew file mode 100644 index 0000000..736bfd0 --- /dev/null +++ b/Sounds/chiken diff --git a/Sounds/chimes b/Sounds/chimes Binary files differnew file mode 100644 index 0000000..01c80e4 --- /dev/null +++ b/Sounds/chimes diff --git a/Sounds/clang b/Sounds/clang Binary files differnew file mode 100644 index 0000000..01476fc --- /dev/null +++ b/Sounds/clang diff --git a/Sounds/clang2 b/Sounds/clang2 Binary files differnew file mode 100644 index 0000000..cb1fed2 --- /dev/null +++ b/Sounds/clang2 diff --git a/Sounds/clarinette b/Sounds/clarinette Binary files differnew file mode 100644 index 0000000..5ed08c2 --- /dev/null +++ b/Sounds/clarinette diff --git a/Sounds/clavinet b/Sounds/clavinet Binary files differnew file mode 100644 index 0000000..db88314 --- /dev/null +++ b/Sounds/clavinet diff --git a/Sounds/cling b/Sounds/cling Binary files differnew file mode 100644 index 0000000..db3525f --- /dev/null +++ b/Sounds/cling diff --git a/Sounds/cow b/Sounds/cow Binary files differnew file mode 100644 index 0000000..5d31cf5 --- /dev/null +++ b/Sounds/cow diff --git a/Sounds/crash b/Sounds/crash Binary files differnew file mode 100644 index 0000000..8408175 --- /dev/null +++ b/Sounds/crash diff --git a/Sounds/cricket b/Sounds/cricket Binary files differnew file mode 100644 index 0000000..cb3504c --- /dev/null +++ b/Sounds/cricket diff --git a/Sounds/diceinst b/Sounds/diceinst Binary files differnew file mode 100644 index 0000000..5a41341 --- /dev/null +++ b/Sounds/diceinst diff --git a/Sounds/didjeridu b/Sounds/didjeridu Binary files differnew file mode 100644 index 0000000..d7556e7 --- /dev/null +++ b/Sounds/didjeridu diff --git a/Sounds/dog b/Sounds/dog Binary files differnew file mode 100644 index 0000000..c1e8e22 --- /dev/null +++ b/Sounds/dog diff --git a/Sounds/door b/Sounds/door Binary files differnew file mode 100644 index 0000000..2b3b21a --- /dev/null +++ b/Sounds/door diff --git a/Sounds/drum1chine b/Sounds/drum1chine Binary files differnew file mode 100644 index 0000000..bb29f18 --- /dev/null +++ b/Sounds/drum1chine diff --git a/Sounds/drum1crash b/Sounds/drum1crash Binary files differnew file mode 100644 index 0000000..5f520c2 --- /dev/null +++ b/Sounds/drum1crash diff --git a/Sounds/drum1floortom b/Sounds/drum1floortom Binary files differnew file mode 100644 index 0000000..f43cb2b --- /dev/null +++ b/Sounds/drum1floortom diff --git a/Sounds/drum1hardride b/Sounds/drum1hardride Binary files differnew file mode 100644 index 0000000..94f052f --- /dev/null +++ b/Sounds/drum1hardride diff --git a/Sounds/drum1hatpedal b/Sounds/drum1hatpedal Binary files differnew file mode 100644 index 0000000..0c0afe6 --- /dev/null +++ b/Sounds/drum1hatpedal diff --git a/Sounds/drum1hatshoulder b/Sounds/drum1hatshoulder Binary files differnew file mode 100644 index 0000000..395ef0b --- /dev/null +++ b/Sounds/drum1hatshoulder diff --git a/Sounds/drum1kick b/Sounds/drum1kick Binary files differnew file mode 100644 index 0000000..0acfb56 --- /dev/null +++ b/Sounds/drum1kick diff --git a/Sounds/drum1kit b/Sounds/drum1kit Binary files differnew file mode 100644 index 0000000..0acfb56 --- /dev/null +++ b/Sounds/drum1kit diff --git a/Sounds/drum1ridebell b/Sounds/drum1ridebell Binary files differnew file mode 100644 index 0000000..6f6b6ce --- /dev/null +++ b/Sounds/drum1ridebell diff --git a/Sounds/drum1snare b/Sounds/drum1snare Binary files differnew file mode 100644 index 0000000..54a6372 --- /dev/null +++ b/Sounds/drum1snare diff --git a/Sounds/drum1snaresidestick b/Sounds/drum1snaresidestick Binary files differnew file mode 100644 index 0000000..a99e846 --- /dev/null +++ b/Sounds/drum1snaresidestick diff --git a/Sounds/drum1splash b/Sounds/drum1splash Binary files differnew file mode 100644 index 0000000..49a334e --- /dev/null +++ b/Sounds/drum1splash diff --git a/Sounds/drum1tom b/Sounds/drum1tom Binary files differnew file mode 100644 index 0000000..ed1464c --- /dev/null +++ b/Sounds/drum1tom diff --git a/Sounds/drum2darbukadoom b/Sounds/drum2darbukadoom Binary files differnew file mode 100644 index 0000000..5a90725 --- /dev/null +++ b/Sounds/drum2darbukadoom diff --git a/Sounds/drum2darbukafinger b/Sounds/drum2darbukafinger Binary files differnew file mode 100644 index 0000000..163aa3c --- /dev/null +++ b/Sounds/drum2darbukafinger diff --git a/Sounds/drum2darbukapied b/Sounds/drum2darbukapied Binary files differnew file mode 100644 index 0000000..006586a --- /dev/null +++ b/Sounds/drum2darbukapied diff --git a/Sounds/drum2darbukapiedsoft b/Sounds/drum2darbukapiedsoft Binary files differnew file mode 100644 index 0000000..cf2aaa8 --- /dev/null +++ b/Sounds/drum2darbukapiedsoft diff --git a/Sounds/drum2darbukaroll b/Sounds/drum2darbukaroll Binary files differnew file mode 100644 index 0000000..ded7a31 --- /dev/null +++ b/Sounds/drum2darbukaroll diff --git a/Sounds/drum2darbukaslap b/Sounds/drum2darbukaslap Binary files differnew file mode 100644 index 0000000..fd70b88 --- /dev/null +++ b/Sounds/drum2darbukaslap diff --git a/Sounds/drum2darbukatak b/Sounds/drum2darbukatak Binary files differnew file mode 100644 index 0000000..329f619 --- /dev/null +++ b/Sounds/drum2darbukatak diff --git a/Sounds/drum2hatflanger b/Sounds/drum2hatflanger Binary files differnew file mode 100644 index 0000000..9dd9389 --- /dev/null +++ b/Sounds/drum2hatflanger diff --git a/Sounds/drum2hatpied b/Sounds/drum2hatpied Binary files differnew file mode 100644 index 0000000..84e774e --- /dev/null +++ b/Sounds/drum2hatpied diff --git a/Sounds/drum2hatpied2 b/Sounds/drum2hatpied2 Binary files differnew file mode 100644 index 0000000..cd21b17 --- /dev/null +++ b/Sounds/drum2hatpied2 diff --git a/Sounds/drum2kit b/Sounds/drum2kit Binary files differnew file mode 100644 index 0000000..5a90725 --- /dev/null +++ b/Sounds/drum2kit diff --git a/Sounds/drum2tambourinepied b/Sounds/drum2tambourinepied Binary files differnew file mode 100644 index 0000000..d6b566a --- /dev/null +++ b/Sounds/drum2tambourinepied diff --git a/Sounds/drum2tambourinepiedsoft b/Sounds/drum2tambourinepiedsoft Binary files differnew file mode 100644 index 0000000..4da2ea6 --- /dev/null +++ b/Sounds/drum2tambourinepiedsoft diff --git a/Sounds/drum3cowbell b/Sounds/drum3cowbell Binary files differnew file mode 100644 index 0000000..3c52687 --- /dev/null +++ b/Sounds/drum3cowbell diff --git a/Sounds/drum3cowbelltip b/Sounds/drum3cowbelltip Binary files differnew file mode 100644 index 0000000..7b79fe2 --- /dev/null +++ b/Sounds/drum3cowbelltip diff --git a/Sounds/drum3cup b/Sounds/drum3cup Binary files differnew file mode 100644 index 0000000..6cf6da2 --- /dev/null +++ b/Sounds/drum3cup diff --git a/Sounds/drum3djembelow b/Sounds/drum3djembelow Binary files differnew file mode 100644 index 0000000..ad5fd0a --- /dev/null +++ b/Sounds/drum3djembelow diff --git a/Sounds/drum3djembemid b/Sounds/drum3djembemid Binary files differnew file mode 100644 index 0000000..55b6d9f --- /dev/null +++ b/Sounds/drum3djembemid diff --git a/Sounds/drum3djembesidestick b/Sounds/drum3djembesidestick Binary files differnew file mode 100644 index 0000000..94c29e6 --- /dev/null +++ b/Sounds/drum3djembesidestick diff --git a/Sounds/drum3djembeslap b/Sounds/drum3djembeslap Binary files differnew file mode 100644 index 0000000..d201e52 --- /dev/null +++ b/Sounds/drum3djembeslap diff --git a/Sounds/drum3djembestickmid b/Sounds/drum3djembestickmid Binary files differnew file mode 100644 index 0000000..9da83ba --- /dev/null +++ b/Sounds/drum3djembestickmid diff --git a/Sounds/drum3kit b/Sounds/drum3kit Binary files differnew file mode 100644 index 0000000..94c29e6 --- /dev/null +++ b/Sounds/drum3kit diff --git a/Sounds/drum3metalstand b/Sounds/drum3metalstand Binary files differnew file mode 100644 index 0000000..059efcc --- /dev/null +++ b/Sounds/drum3metalstand diff --git a/Sounds/drum3pedalperc b/Sounds/drum3pedalperc Binary files differnew file mode 100644 index 0000000..c271d66 --- /dev/null +++ b/Sounds/drum3pedalperc diff --git a/Sounds/drum3rainstick b/Sounds/drum3rainstick Binary files differnew file mode 100644 index 0000000..561d0d9 --- /dev/null +++ b/Sounds/drum3rainstick diff --git a/Sounds/drum3tambourinehigh b/Sounds/drum3tambourinehigh Binary files differnew file mode 100644 index 0000000..cf2c61e --- /dev/null +++ b/Sounds/drum3tambourinehigh diff --git a/Sounds/drum3tambourinelow b/Sounds/drum3tambourinelow Binary files differnew file mode 100644 index 0000000..ff8e278 --- /dev/null +++ b/Sounds/drum3tambourinelow diff --git a/Sounds/drum4afrofeet b/Sounds/drum4afrofeet Binary files differnew file mode 100644 index 0000000..b2044da --- /dev/null +++ b/Sounds/drum4afrofeet diff --git a/Sounds/drum4fingersn b/Sounds/drum4fingersn Binary files differnew file mode 100644 index 0000000..e6b60a5 --- /dev/null +++ b/Sounds/drum4fingersn diff --git a/Sounds/drum4kit b/Sounds/drum4kit Binary files differnew file mode 100644 index 0000000..486ed42 --- /dev/null +++ b/Sounds/drum4kit diff --git a/Sounds/drum4mutecuic b/Sounds/drum4mutecuic Binary files differnew file mode 100644 index 0000000..ef0c0c0 --- /dev/null +++ b/Sounds/drum4mutecuic diff --git a/Sounds/drum4stompbass b/Sounds/drum4stompbass Binary files differnew file mode 100644 index 0000000..68dd316 --- /dev/null +++ b/Sounds/drum4stompbass diff --git a/Sounds/drum4tambouri b/Sounds/drum4tambouri Binary files differnew file mode 100644 index 0000000..5b32be2 --- /dev/null +++ b/Sounds/drum4tambouri diff --git a/Sounds/drum4tr707clap b/Sounds/drum4tr707clap Binary files differnew file mode 100644 index 0000000..f9ea03e --- /dev/null +++ b/Sounds/drum4tr707clap diff --git a/Sounds/drum4tr707open b/Sounds/drum4tr707open Binary files differnew file mode 100644 index 0000000..f7d54bf --- /dev/null +++ b/Sounds/drum4tr707open diff --git a/Sounds/drum4tr808closed b/Sounds/drum4tr808closed Binary files differnew file mode 100644 index 0000000..8995edd --- /dev/null +++ b/Sounds/drum4tr808closed diff --git a/Sounds/drum4tr808sn b/Sounds/drum4tr808sn Binary files differnew file mode 100644 index 0000000..adde850 --- /dev/null +++ b/Sounds/drum4tr808sn diff --git a/Sounds/drum4tr909bass b/Sounds/drum4tr909bass Binary files differnew file mode 100644 index 0000000..6420213 --- /dev/null +++ b/Sounds/drum4tr909bass diff --git a/Sounds/drum4tr909kick b/Sounds/drum4tr909kick Binary files differnew file mode 100644 index 0000000..6e33dd3 --- /dev/null +++ b/Sounds/drum4tr909kick diff --git a/Sounds/drum4tr909sn b/Sounds/drum4tr909sn Binary files differnew file mode 100644 index 0000000..486ed42 --- /dev/null +++ b/Sounds/drum4tr909sn diff --git a/Sounds/drum5agogoaigu b/Sounds/drum5agogoaigu Binary files differnew file mode 100644 index 0000000..3889332 --- /dev/null +++ b/Sounds/drum5agogoaigu diff --git a/Sounds/drum5agogograve b/Sounds/drum5agogograve Binary files differnew file mode 100644 index 0000000..5717751 --- /dev/null +++ b/Sounds/drum5agogograve diff --git a/Sounds/drum5bongoaiguouvert b/Sounds/drum5bongoaiguouvert Binary files differnew file mode 100644 index 0000000..95aba33 --- /dev/null +++ b/Sounds/drum5bongoaiguouvert diff --git a/Sounds/drum5bongograveouvert b/Sounds/drum5bongograveouvert Binary files differnew file mode 100644 index 0000000..d7d1e58 --- /dev/null +++ b/Sounds/drum5bongograveouvert diff --git a/Sounds/drum5congaaiguouvert b/Sounds/drum5congaaiguouvert Binary files differnew file mode 100644 index 0000000..a59ce75 --- /dev/null +++ b/Sounds/drum5congaaiguouvert diff --git a/Sounds/drum5congagraveferme b/Sounds/drum5congagraveferme Binary files differnew file mode 100644 index 0000000..a49c459 --- /dev/null +++ b/Sounds/drum5congagraveferme diff --git a/Sounds/drum5congagraveouvert b/Sounds/drum5congagraveouvert Binary files differnew file mode 100644 index 0000000..3b9503c --- /dev/null +++ b/Sounds/drum5congagraveouvert diff --git a/Sounds/drum5guiroretour b/Sounds/drum5guiroretour Binary files differnew file mode 100644 index 0000000..025ebfb --- /dev/null +++ b/Sounds/drum5guiroretour diff --git a/Sounds/drum5kit b/Sounds/drum5kit Binary files differnew file mode 100644 index 0000000..95aba33 --- /dev/null +++ b/Sounds/drum5kit diff --git a/Sounds/drum5quicaaigu b/Sounds/drum5quicaaigu Binary files differnew file mode 100644 index 0000000..d952c8c --- /dev/null +++ b/Sounds/drum5quicaaigu diff --git a/Sounds/drum5quicamedium b/Sounds/drum5quicamedium Binary files differnew file mode 100644 index 0000000..57e92e6 --- /dev/null +++ b/Sounds/drum5quicamedium diff --git a/Sounds/drum5timablesaiguslap b/Sounds/drum5timablesaiguslap Binary files differnew file mode 100644 index 0000000..1b531b0 --- /dev/null +++ b/Sounds/drum5timablesaiguslap diff --git a/Sounds/drum5timablesslap b/Sounds/drum5timablesslap Binary files differnew file mode 100644 index 0000000..1e5ec3e --- /dev/null +++ b/Sounds/drum5timablesslap diff --git a/Sounds/drum5vibraslap b/Sounds/drum5vibraslap Binary files differnew file mode 100644 index 0000000..e539891 --- /dev/null +++ b/Sounds/drum5vibraslap diff --git a/Sounds/drum6kit b/Sounds/drum6kit Binary files differnew file mode 100644 index 0000000..a409f6c --- /dev/null +++ b/Sounds/drum6kit diff --git a/Sounds/drum6kit.orig b/Sounds/drum6kit.orig Binary files differnew file mode 100644 index 0000000..8bfe82c --- /dev/null +++ b/Sounds/drum6kit.orig diff --git a/Sounds/drum6madal00 b/Sounds/drum6madal00 Binary files differnew file mode 100644 index 0000000..6af692f --- /dev/null +++ b/Sounds/drum6madal00 diff --git a/Sounds/drum6madal01 b/Sounds/drum6madal01 Binary files differnew file mode 100644 index 0000000..0a7dbdb --- /dev/null +++ b/Sounds/drum6madal01 diff --git a/Sounds/drum6madal02 b/Sounds/drum6madal02 Binary files differnew file mode 100644 index 0000000..e12a412 --- /dev/null +++ b/Sounds/drum6madal02 diff --git a/Sounds/drum6madal03 b/Sounds/drum6madal03 Binary files differnew file mode 100644 index 0000000..b3a210e --- /dev/null +++ b/Sounds/drum6madal03 diff --git a/Sounds/drum6madal04 b/Sounds/drum6madal04 Binary files differnew file mode 100644 index 0000000..fcef18f --- /dev/null +++ b/Sounds/drum6madal04 diff --git a/Sounds/drum6madal05 b/Sounds/drum6madal05 Binary files differnew file mode 100644 index 0000000..a409f6c --- /dev/null +++ b/Sounds/drum6madal05 diff --git a/Sounds/drum6madal06 b/Sounds/drum6madal06 Binary files differnew file mode 100644 index 0000000..e7c307d --- /dev/null +++ b/Sounds/drum6madal06 diff --git a/Sounds/drum6madal07 b/Sounds/drum6madal07 Binary files differnew file mode 100644 index 0000000..25bf251 --- /dev/null +++ b/Sounds/drum6madal07 diff --git a/Sounds/drum6madal08 b/Sounds/drum6madal08 Binary files differnew file mode 100644 index 0000000..4bcba5a --- /dev/null +++ b/Sounds/drum6madal08 diff --git a/Sounds/drum6madal09 b/Sounds/drum6madal09 Binary files differnew file mode 100644 index 0000000..3cb92ee --- /dev/null +++ b/Sounds/drum6madal09 diff --git a/Sounds/drum6madal10 b/Sounds/drum6madal10 Binary files differnew file mode 100644 index 0000000..af6f451 --- /dev/null +++ b/Sounds/drum6madal10 diff --git a/Sounds/drum6madal11 b/Sounds/drum6madal11 Binary files differnew file mode 100644 index 0000000..cddcf4a --- /dev/null +++ b/Sounds/drum6madal11 diff --git a/Sounds/drum6madal12 b/Sounds/drum6madal12 Binary files differnew file mode 100644 index 0000000..1b3dc5b --- /dev/null +++ b/Sounds/drum6madal12 diff --git a/Sounds/duck b/Sounds/duck Binary files differnew file mode 100644 index 0000000..37b5f85 --- /dev/null +++ b/Sounds/duck diff --git a/Sounds/duck2 b/Sounds/duck2 Binary files differnew file mode 100644 index 0000000..1c62622 --- /dev/null +++ b/Sounds/duck2 diff --git a/Sounds/fingercymbals b/Sounds/fingercymbals Binary files differnew file mode 100644 index 0000000..aa1f221 --- /dev/null +++ b/Sounds/fingercymbals diff --git a/Sounds/flugel b/Sounds/flugel Binary files differnew file mode 100644 index 0000000..4367cc2 --- /dev/null +++ b/Sounds/flugel diff --git a/Sounds/flute b/Sounds/flute Binary files differnew file mode 100644 index 0000000..68a2580 --- /dev/null +++ b/Sounds/flute diff --git a/Sounds/foghorn b/Sounds/foghorn Binary files differnew file mode 100644 index 0000000..65549e6 --- /dev/null +++ b/Sounds/foghorn diff --git a/Sounds/frogs b/Sounds/frogs Binary files differnew file mode 100644 index 0000000..9b2831a --- /dev/null +++ b/Sounds/frogs diff --git a/Sounds/gam b/Sounds/gam Binary files differnew file mode 100644 index 0000000..dca077b --- /dev/null +++ b/Sounds/gam diff --git a/Sounds/guidice1 b/Sounds/guidice1 Binary files differnew file mode 100644 index 0000000..9e48310 --- /dev/null +++ b/Sounds/guidice1 diff --git a/Sounds/guidice10 b/Sounds/guidice10 Binary files differnew file mode 100644 index 0000000..8da4267 --- /dev/null +++ b/Sounds/guidice10 diff --git a/Sounds/guidice2 b/Sounds/guidice2 Binary files differnew file mode 100644 index 0000000..7b12043 --- /dev/null +++ b/Sounds/guidice2 diff --git a/Sounds/guidice3 b/Sounds/guidice3 Binary files differnew file mode 100644 index 0000000..68d1f45 --- /dev/null +++ b/Sounds/guidice3 diff --git a/Sounds/guidice4 b/Sounds/guidice4 Binary files differnew file mode 100644 index 0000000..3d72119 --- /dev/null +++ b/Sounds/guidice4 diff --git a/Sounds/guidice5 b/Sounds/guidice5 Binary files differnew file mode 100644 index 0000000..79cc786 --- /dev/null +++ b/Sounds/guidice5 diff --git a/Sounds/guidice6 b/Sounds/guidice6 Binary files differnew file mode 100644 index 0000000..dc2f756 --- /dev/null +++ b/Sounds/guidice6 diff --git a/Sounds/guidice7 b/Sounds/guidice7 Binary files differnew file mode 100644 index 0000000..af341b7 --- /dev/null +++ b/Sounds/guidice7 diff --git a/Sounds/guidice8 b/Sounds/guidice8 Binary files differnew file mode 100644 index 0000000..9901020 --- /dev/null +++ b/Sounds/guidice8 diff --git a/Sounds/guidice9 b/Sounds/guidice9 Binary files differnew file mode 100644 index 0000000..8798781 --- /dev/null +++ b/Sounds/guidice9 diff --git a/Sounds/guit b/Sounds/guit Binary files differnew file mode 100644 index 0000000..dfb1866 --- /dev/null +++ b/Sounds/guit diff --git a/Sounds/guit2 b/Sounds/guit2 Binary files differnew file mode 100644 index 0000000..fcb9163 --- /dev/null +++ b/Sounds/guit2 diff --git a/Sounds/guitmute b/Sounds/guitmute Binary files differnew file mode 100644 index 0000000..93026d6 --- /dev/null +++ b/Sounds/guitmute diff --git a/Sounds/guitshort b/Sounds/guitshort Binary files differnew file mode 100644 index 0000000..698364b --- /dev/null +++ b/Sounds/guitshort diff --git a/Sounds/harmonica b/Sounds/harmonica Binary files differnew file mode 100644 index 0000000..7b0af9f --- /dev/null +++ b/Sounds/harmonica diff --git a/Sounds/harmonium b/Sounds/harmonium Binary files differnew file mode 100644 index 0000000..5bc5fcb --- /dev/null +++ b/Sounds/harmonium diff --git a/Sounds/harpsichord b/Sounds/harpsichord Binary files differnew file mode 100644 index 0000000..dac451f --- /dev/null +++ b/Sounds/harpsichord diff --git a/Sounds/hey b/Sounds/hey Binary files differnew file mode 100644 index 0000000..0bd7b20 --- /dev/null +++ b/Sounds/hey diff --git a/Sounds/horse b/Sounds/horse Binary files differnew file mode 100644 index 0000000..b7756a3 --- /dev/null +++ b/Sounds/horse diff --git a/Sounds/kalimba b/Sounds/kalimba Binary files differnew file mode 100644 index 0000000..2e02b48 --- /dev/null +++ b/Sounds/kalimba diff --git a/Sounds/koto b/Sounds/koto Binary files differnew file mode 100644 index 0000000..9279a7f --- /dev/null +++ b/Sounds/koto diff --git a/Sounds/laugh b/Sounds/laugh Binary files differnew file mode 100644 index 0000000..05483ce --- /dev/null +++ b/Sounds/laugh diff --git a/Sounds/mando b/Sounds/mando Binary files differnew file mode 100644 index 0000000..092125b --- /dev/null +++ b/Sounds/mando diff --git a/Sounds/marimba b/Sounds/marimba Binary files differnew file mode 100644 index 0000000..489ba71 --- /dev/null +++ b/Sounds/marimba diff --git a/Sounds/mic1 b/Sounds/mic1 Binary files differnew file mode 100644 index 0000000..d26b87b --- /dev/null +++ b/Sounds/mic1 diff --git a/Sounds/mic2 b/Sounds/mic2 Binary files differnew file mode 100644 index 0000000..d26b87b --- /dev/null +++ b/Sounds/mic2 diff --git a/Sounds/mic3 b/Sounds/mic3 Binary files differnew file mode 100644 index 0000000..d26b87b --- /dev/null +++ b/Sounds/mic3 diff --git a/Sounds/mic4 b/Sounds/mic4 Binary files differnew file mode 100644 index 0000000..d26b87b --- /dev/null +++ b/Sounds/mic4 diff --git a/Sounds/ocarina b/Sounds/ocarina Binary files differnew file mode 100644 index 0000000..7b00cc6 --- /dev/null +++ b/Sounds/ocarina diff --git a/Sounds/ounk b/Sounds/ounk Binary files differnew file mode 100644 index 0000000..1272c5f --- /dev/null +++ b/Sounds/ounk diff --git a/Sounds/ow b/Sounds/ow Binary files differnew file mode 100644 index 0000000..8270199 --- /dev/null +++ b/Sounds/ow diff --git a/Sounds/piano b/Sounds/piano Binary files differnew file mode 100644 index 0000000..f98a513 --- /dev/null +++ b/Sounds/piano diff --git a/Sounds/plane b/Sounds/plane Binary files differnew file mode 100644 index 0000000..d20142a --- /dev/null +++ b/Sounds/plane diff --git a/Sounds/rhodes b/Sounds/rhodes Binary files differnew file mode 100644 index 0000000..16cd8ec --- /dev/null +++ b/Sounds/rhodes diff --git a/Sounds/sarangi b/Sounds/sarangi Binary files differnew file mode 100644 index 0000000..69bde54 --- /dev/null +++ b/Sounds/sarangi diff --git a/Sounds/sarangi.orig b/Sounds/sarangi.orig Binary files differnew file mode 100644 index 0000000..4fb94da --- /dev/null +++ b/Sounds/sarangi.orig diff --git a/Sounds/saxo b/Sounds/saxo Binary files differnew file mode 100644 index 0000000..16de921 --- /dev/null +++ b/Sounds/saxo diff --git a/Sounds/saxsoprano b/Sounds/saxsoprano Binary files differnew file mode 100644 index 0000000..b9f63e9 --- /dev/null +++ b/Sounds/saxsoprano diff --git a/Sounds/sheep b/Sounds/sheep Binary files differnew file mode 100644 index 0000000..178bb43 --- /dev/null +++ b/Sounds/sheep diff --git a/Sounds/shenai b/Sounds/shenai Binary files differnew file mode 100644 index 0000000..115f125 --- /dev/null +++ b/Sounds/shenai diff --git a/Sounds/sitar b/Sounds/sitar Binary files differnew file mode 100644 index 0000000..6fdc321 --- /dev/null +++ b/Sounds/sitar diff --git a/Sounds/slap b/Sounds/slap Binary files differnew file mode 100644 index 0000000..6e1f375 --- /dev/null +++ b/Sounds/slap diff --git a/Sounds/templebell b/Sounds/templebell Binary files differnew file mode 100644 index 0000000..705fbbc --- /dev/null +++ b/Sounds/templebell diff --git a/Sounds/templebell.orig b/Sounds/templebell.orig Binary files differnew file mode 100644 index 0000000..0790114 --- /dev/null +++ b/Sounds/templebell.orig diff --git a/Sounds/triangle b/Sounds/triangle Binary files differnew file mode 100644 index 0000000..8c3c1b9 --- /dev/null +++ b/Sounds/triangle diff --git a/Sounds/trumpet b/Sounds/trumpet Binary files differnew file mode 100644 index 0000000..3ce006d --- /dev/null +++ b/Sounds/trumpet diff --git a/Sounds/tuba b/Sounds/tuba Binary files differnew file mode 100644 index 0000000..9e47196 --- /dev/null +++ b/Sounds/tuba diff --git a/Sounds/ukulele b/Sounds/ukulele Binary files differnew file mode 100644 index 0000000..bfacc40 --- /dev/null +++ b/Sounds/ukulele diff --git a/Sounds/violin b/Sounds/violin Binary files differnew file mode 100644 index 0000000..f89733c --- /dev/null +++ b/Sounds/violin diff --git a/Sounds/voix b/Sounds/voix Binary files differnew file mode 100644 index 0000000..87f6ca6 --- /dev/null +++ b/Sounds/voix diff --git a/Sounds/water b/Sounds/water Binary files differnew file mode 100644 index 0000000..c6cee2e --- /dev/null +++ b/Sounds/water diff --git a/Sounds/zap b/Sounds/zap Binary files differnew file mode 100644 index 0000000..e401f6b --- /dev/null +++ b/Sounds/zap diff --git a/activity/activity-erikos.svg b/activity/activity-erikos.svg new file mode 100644 index 0000000..5dc6159 --- /dev/null +++ b/activity/activity-erikos.svg @@ -0,0 +1,43 @@ +<?xml version="1.0" ?> +<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd' [ + <!ENTITY stroke_color "#000"> + <!ENTITY fill_color "#eee"> +]> +<svg height="45px" viewBox="0 0 45 45" width="45px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.5" stroke="&stroke_color;" fill="&fill_color;"> + <g + id="g2390" + transform="translate(2.5,2.4999985)"> + <rect + style="fill:&fill_color;;stroke:&stroke_color;;stroke-width:1.45688474" + id="rect4" + transform="matrix(-0.7071068,-0.7071068,0.7071068,-0.7071068,0,0)" + y="-13.627049" + x="-27.769184" + height="13.111962" + width="13.111962" /> + <rect + style="fill:&fill_color;;stroke:&stroke_color;;stroke-width:1.45688474" + id="rect2384" + transform="matrix(-0.7071068,-0.7071068,0.7071068,-0.7071068,0,0)" + y="0.51508725" + x="-27.769186" + height="13.111962" + width="13.111962" /> + <rect + style="fill:&fill_color;;stroke:&stroke_color;;stroke-width:1.45688474" + id="rect2386" + transform="matrix(-0.7071068,-0.7071068,0.7071068,-0.7071068,0,0)" + y="0.51508671" + x="-41.91132" + height="13.111962" + width="13.111962" /> + <rect + style="fill:&fill_color;;stroke:&stroke_color;;stroke-width:1.45688474" + id="rect2388" + transform="matrix(-0.7071068,-0.7071068,0.7071068,-0.7071068,0,0)" + y="-13.627048" + x="-41.911324" + height="13.111962" + width="13.111962" /> + </g> +</svg> diff --git a/activity/activity.info b/activity/activity.info new file mode 100644 index 0000000..5a83843 --- /dev/null +++ b/activity/activity.info @@ -0,0 +1,8 @@ +[Activity] +name = Erikos +activity_version = 1 +license = GPLv3 +bundle_id = org.sugarlabs.ErikosActivity +exec = sugar-activity ErikosActivity.ErikosActivity +icon = activity-erikos +show_launcher = yes diff --git a/constants.py b/constants.py new file mode 100644 index 0000000..1e7987a --- /dev/null +++ b/constants.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +#Copyright (c) 2009, Walter Bender + +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: + +#The above copyright notice and this permission notice shall be included in +#all copies or substantial portions of the Software. + +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +#THE SOFTWARE. + +W = 156 +H = 156 diff --git a/images/Aoff.svg b/images/Aoff.svg new file mode 100644 index 0000000..8ecae2a --- /dev/null +++ b/images/Aoff.svg @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + version="1.0" + width="77.781746" + height="77.781746" + id="svg2"> + <defs + id="defs7" /> + <rect + width="55" + height="55" + x="-27.5" + y="27.5" + transform="matrix(0.7071068,-0.7071068,0.7071068,0.7071068,0,0)" + id="rect4" + style="opacity:1;fill:#c08080;fill-opacity:1" /> +</svg> diff --git a/images/Aon.svg b/images/Aon.svg new file mode 100644 index 0000000..c9abef6 --- /dev/null +++ b/images/Aon.svg @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + version="1.0" + width="77.781746" + height="77.781746" + id="svg2"> + <defs + id="defs7" /> + <rect + width="55" + height="55" + x="-27.5" + y="27.5" + transform="matrix(0.7071068,-0.7071068,0.7071068,0.7071068,0,0)" + id="rect4" + style="opacity:1;fill:#ff0000;fill-opacity:1" /> +</svg> diff --git a/images/Boff.svg b/images/Boff.svg new file mode 100644 index 0000000..7a544c0 --- /dev/null +++ b/images/Boff.svg @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + version="1.0" + width="77.781746" + height="77.781746" + id="svg2"> + <defs + id="defs7" /> + <rect + width="55" + height="55" + x="-27.5" + y="27.5" + transform="matrix(0.7071068,-0.7071068,0.7071068,0.7071068,0,0)" + id="rect4" + style="opacity:1;fill:#80C080;fill-opacity:1" /> +</svg> diff --git a/images/Bon.svg b/images/Bon.svg new file mode 100644 index 0000000..db77081 --- /dev/null +++ b/images/Bon.svg @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + version="1.0" + width="77.781746" + height="77.781746" + id="svg2"> + <defs + id="defs7" /> + <rect + width="55" + height="55" + x="-27.5" + y="27.5" + transform="matrix(0.7071068,-0.7071068,0.7071068,0.7071068,0,0)" + id="rect4" + style="opacity:1;fill:#00ff00;fill-opacity:1" /> +</svg> diff --git a/images/Coff.svg b/images/Coff.svg new file mode 100644 index 0000000..141b200 --- /dev/null +++ b/images/Coff.svg @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + version="1.0" + width="77.781746" + height="77.781746" + id="svg2"> + <defs + id="defs7" /> + <rect + width="55" + height="55" + x="-27.5" + y="27.5" + transform="matrix(0.7071068,-0.7071068,0.7071068,0.7071068,0,0)" + id="rect4" + style="opacity:1;fill:#8080C0;fill-opacity:1" /> +</svg> diff --git a/images/Con.svg b/images/Con.svg new file mode 100644 index 0000000..1a84d2b --- /dev/null +++ b/images/Con.svg @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + version="1.0" + width="77.781746" + height="77.781746" + id="svg2"> + <defs + id="defs7" /> + <rect + width="55" + height="55" + x="-27.5" + y="27.5" + transform="matrix(0.7071068,-0.7071068,0.7071068,0.7071068,0,0)" + id="rect4" + style="opacity:1;fill:#0000ff;fill-opacity:1" /> +</svg> diff --git a/images/Doff.svg b/images/Doff.svg new file mode 100644 index 0000000..99f3a23 --- /dev/null +++ b/images/Doff.svg @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + version="1.0" + width="77.781746" + height="77.781746" + id="svg2"> + <defs + id="defs7" /> + <rect + width="55" + height="55" + x="-27.5" + y="27.5" + transform="matrix(0.7071068,-0.7071068,0.7071068,0.7071068,0,0)" + id="rect4" + style="opacity:1;fill:#C0C080;fill-opacity:1" /> +</svg> diff --git a/images/Don.svg b/images/Don.svg new file mode 100644 index 0000000..dabbec8 --- /dev/null +++ b/images/Don.svg @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + version="1.0" + width="77.781746" + height="77.781746" + id="svg2"> + <defs + id="defs7" /> + <rect + width="55" + height="55" + x="-27.5" + y="27.5" + transform="matrix(0.7071068,-0.7071068,0.7071068,0.7071068,0,0)" + id="rect4" + style="opacity:1;fill:#ffff00;fill-opacity:1" /> +</svg> diff --git a/setup.py b/setup.py new file mode 100755 index 0000000..bd1e319 --- /dev/null +++ b/setup.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python +from sugar.activity import bundlebuilder +if __name__ == "__main__": + bundlebuilder.start() + diff --git a/sound.py b/sound.py new file mode 100755 index 0000000..d937703 --- /dev/null +++ b/sound.py @@ -0,0 +1,268 @@ +#! /usr/bin/env python +import os +import sys +from gettext import gettext as _ + +dirs = ['./Sounds/'] +orchlines = [] +scorelines = [] +instrlist = [] +fnum = [100] + +"""XXX: This function seems to be broken. (CSA) +def quit(self): + perf.Stop() + perf.Join() + cs.Reset() + cs = None +""" +def finddir(): + for d in dirs: + if os.path.isdir(d): + return d + +def defAdsr(attack=0.01, decay=0.1, sustain=0.8, release=0.1): + """Define an ADSR envelope. fnum = defADSR(attack = [0.01], decay = [0.1], sustain = [0.8], release = [0.1])""" + att = int(2048 * attack) + dec = int(2048 * decay) + rel = int(2048 * release) + bal = 2048 - (att + dec + rel) + sus = min(1., sustain) + + fnum[0] += 1 + scorelines.append("f%ld 0 2048 7 0 %ld 1. %ld %f %ld %f %ld 0\n" % (fnum[0], att, dec, sus, bal, sus, rel)) + return fnum[0] + +def defLineSegments(list=[0,10,1,10,0,10,1,10,0]): + """Define a breakpoints envelope. list=[0,10,1,10,0,10,1,10,0]. list begin with the start value of the function and is follow by any pair values (duration, value). The number of elements in the list should odd.""" + + totalLength = 0 + newlist = [] + for i in range(len(list)): + if (i % 2) == 1: + totalLength += list[i] + + for i in range(len(list)): + if (i % 2) == 0: newlist.append(list[i]) + else: newlist.append(int(2048 * (list[i] / float(totalLength)))) + + fnum[0] += 1 + scorelines.append("f" + str(fnum[0]) + " 0 2048 -7 " + " ".join([str(n) for n in newlist]) + '\n') + return fnum[0] + +def defComplexWave(list=[1,0,0,.3,0,.2,0,0,.1]): + """Define a complex waveform to be read with 'playComplex' function. list=[1,0,0,.3,0,.2,0,0,.1] +is a list of amplitude for succesive harmonics of a waveform""" + fnum[0] += 1 + scorelines.append("f" + str(fnum[0]) + " 0 2048 10 " + " ".join([str(n) for n in list]) + '\n') + return fnum[0] + +def playSine( pitch=1000, amplitude=5000, duration=1, starttime=0, pitch_envelope='default', amplitude_envelope='default'): + """Play a sine wave (pitch = [1000], amplitude = [5000], duration = [1], starttime = [0], pitch_envelope=['default'], amplitude_envelope=['default'])""" + _play(pitch, amplitude, duration, starttime, pitch_envelope, amplitude_envelope, 1) + +def playSquare( pitch=1000, amplitude=5000, duration=1, starttime=0, pitch_envelope='default', amplitude_envelope='default'): + """Play a square wave (pitch = [1000], amplitude = [5000], duration = [1], starttime = [0], pitch_envelope=['default'], amplitude_envelope=['default'])""" + _play(pitch, amplitude, duration, starttime, pitch_envelope, amplitude_envelope, 2) + +def playSawtooth( pitch=1000, amplitude=5000, duration=1, starttime=0, pitch_envelope='default', amplitude_envelope='default'): + """Play a sawtooth wave (pitch = [1000], amplitude = [5000], duration = [1], starttime = [0], pitch_envelope=['default'], amplitude_envelope=['default'])""" + _play(pitch, amplitude, duration, starttime, pitch_envelope, amplitude_envelope, 3) + +def playComplex( pitch=1000, amplitude=5000, duration=1, starttime=0, pitch_envelope='default', amplitude_envelope='default', wave='default'): + """Play a complex wave (pitch = [1000], amplitude = [5000], duration = [1], starttime = [0], pitch_envelope = ['default'], amplitude_envelope, wave = ['default'] )""" + if wave == 'default': wavetable = 10 + else: wavetable = wave + _play(pitch, amplitude, duration, starttime, pitch_envelope, amplitude_envelope, wavetable) + +def _play( pitch, amplitude, duration, starttime, pitch_envelope, amplitude_envelope, instrument): + if pitch_envelope == 'default': pitenv = 99 + else: pitenv = pitch_envelope + + if amplitude_envelope == 'default': ampenv = 100 + else: ampenv = amplitude_envelope + + if not 1 in instrlist: + orchlines.append("instr 1\n") + orchlines.append("kpitenv oscil 1, 1/p3, p6\n") + orchlines.append("aenv oscil 1, 1/p3, p7\n") + orchlines.append("asig oscil p5*aenv, p4*kpitenv, p8\n") + orchlines.append("out asig\n") + orchlines.append("endin\n\n") + instrlist.append(1) + + scorelines.append("i1 %s %s %s %s %s %s %s\n" % (str(starttime), str(duration), str(pitch), str(amplitude), str(pitenv), str(ampenv), str(instrument))) + +def playFrequencyModulation( pitch=500, amplitude=5000, duration=2, starttime=0, carrier=1, modulator=.5, index=5, pitch_envelope='default', amplitude_envelope='default', carrier_envelope='default', modulator_envelope='default', index_envelope='default', wave='default'): + """Play a frequency modulation synthesis sound (pitch = [100], amplitude = [5000], duration = [2], starttime = [0], carrier = [1], modulator = [.5], index = [5], pitch_envelope = ['default'], amplitude_envelope = ['default'], carrier_envelope = ['default'], modulator_envelope = ['default'], index_envelope = ['default'], wave = ['default'] )""" + if pitch_envelope == 'default': pitenv = 99 + else: pitenv = pitch_envelope + + if amplitude_envelope == 'default': ampenv = 100 + else: ampenv = amplitude_envelope + + if carrier_envelope == 'default': carenv = 99 + else: carenv = carrier_envelope + + if modulator_envelope == 'default': modenv = 99 + else: modenv = modulator_envelope + + if index_envelope == 'default': indenv = 99 + else: indenv = index_envelope + + if wave == 'default': wavetable = 1 + else: wavetable = wave + + if not 7 in instrlist: + orchlines.append("instr 7\n") + orchlines.append("kpitenv oscil 1, 1/p3, p10\n") + orchlines.append("kenv oscil 1, 1/p3, p11\n") + orchlines.append("kcarenv oscil 1, 1/p3, p12\n") + orchlines.append("kmodenv oscil 1, 1/p3, p13\n") + orchlines.append("kindenv oscil 1, 1/p3, p14\n") + orchlines.append("asig foscil p5*kenv, p4*kpitenv, p6*kcarenv, p7*kmodenv, p8*kindenv, p9\n") + orchlines.append("out asig\n") + orchlines.append("endin\n\n") + instrlist.append(7) + + scorelines.append("i7 %s %s %s %s %s %s %s %s %s %s %s %s %s\n" % (str(starttime), str(duration), str(pitch), str(amplitude), str(carrier), str(modulator), str(index), str(wavetable), str(pitenv), str(ampenv), str(carenv), str(modenv), str(indenv))) + +def playPluck( pitch=100, amplitude=5000, duration=2, starttime=0, pitch_envelope='default', amplitude_envelope='default'): + """Play a string physical modeling sound (pitch = [100], amplitude = [5000], duration = [2], starttime = [0], pitch_envelope = ['default'], amplitude_envelope )""" + if pitch_envelope == 'default': pitenv = 99 + else: pitenv = pitch_envelope + + if amplitude_envelope == 'default': ampenv = 100 + else: ampenv = amplitude_envelope + + if not 8 in instrlist: + orchlines.append("instr 8\n") + orchlines.append("kpitenv oscil 1, 1/p3, p6\n") + orchlines.append("kenv oscil 1, 1/p3, p7\n") + orchlines.append("asig pluck p5*kenv, p4*kpitenv, 40, 0, 6\n") + orchlines.append("asig butterlp asig, 4000\n") + orchlines.append("out asig\n") + orchlines.append("endin\n\n") + instrlist.append(8) + + scorelines.append("i8 %s %s %s %s %s %s\n" % (str(starttime), str(duration), str(pitch), str(amplitude), str(pitenv), str(ampenv))) + +def playWave(sound='horse', pitch=1, amplitude=1, loop=False, duration=1, starttime=0, pitch_envelope='default', amplitude_envelope='default'): + """Play a wave file (sound = ['horse'], pitch = [1], amplitude = [1], loop = [False], duration = [1], starttime = [0], pitch_envelope=['default'], amplitude_envelope=['default'])""" + + if '/' in sound: + fullname = sound + else: + fullname = finddir() + str(sound) + + if loop == False: lp = 0 + else: lp = 1 + + if pitch_envelope == 'default': pitenv = 99 + else: pitenv = pitch_envelope + + if amplitude_envelope == 'default': ampenv = 100 + else: ampenv = amplitude_envelope + + # orchlines = [] + if not 9 in instrlist: + orchlines.append("instr 9\n") + orchlines.append("kpitenv oscil 1, 1/p3, p8\n") + orchlines.append("aenv oscil 1, 1/p3, p9\n") + orchlines.append("asig diskin p4, p5*kpitenv, 0, p7\n") + orchlines.append("out asig*p6*aenv\n") + orchlines.append("endin\n\n") + instrlist.append(9) + + # scorelines = [] + scorelines.append('i9 %f %f "%s" %s %s %s %s %s\n' % (float(starttime), float(duration), fullname, str(pitch), str(amplitude), str(lp), str(pitenv), str(ampenv))) + print scorelines + +def getSoundList(): + list = finddir() + if list == None: + print _("Please install TamTamEdit's sound library.") + sys.exit(0) + return sorted(os.listdir(list)) + +temp_path=None +def audioOut(file=None): + """Compile a .csd file and start csound to run it. If a string is given as argument, it write a wave file on disk instead of sending sound to hp. (file = [None])""" + global temp_path + import os + if temp_path is None: + from sugar import env + import os.path + try: + temp_path = os.path.join(activity.get_activity_root(), "instance") + except: + # Early versions of Sugar (e.g., 656) didn't support + # get_activity_root() + temp_path = os.path.join( \ + os.environ['HOME'], \ + ".sugar/default/org.sugarlabs.ErikosActivity/instance") + path = temp_path + csd = open(path + "/temp.csd", "w") + csd.write("<CsoundSynthesizer>\n\n") + csd.write("<CsOptions>\n") + if file == None: + csd.write("-+rtaudio=alsa -odevaudio -m0 -d -b256 -B512\n") + else: + file = path + "/" + str(file) + ".wav" + csd.write("-+rtaudio=alsa -o%s -m0 -W -d -b256 -B512\n" % file) + csd.write("</CsOptions>\n\n") + csd.write("<CsInstruments>\n\n") + csd.write("sr=16000\n") + csd.write("ksmps=50\n") + csd.write("nchnls=1\n\n") + for line in orchlines: + csd.write(line) + csd.write("\n</CsInstruments>\n\n") + csd.write("<CsScore>\n\n") + csd.write("f1 0 2048 10 1\n") + csd.write("f2 0 2048 10 1 0 .33 0 .2 0 .143 0 .111\n") + csd.write("f3 0 2048 10 1 .5 .33 .25 .2 .175 .143 .125 .111 .1\n") + csd.write("f10 0 2048 10 1 0 0 .3 0 .2 0 0 .1\n") + csd.write("f99 0 2048 7 1 2048 1\n") + csd.write("f100 0 2048 7 0. 10 1. 1900 1. 132 0.\n") + for line in scorelines: + csd.write(line) + csd.write("e\n") + csd.write("\n</CsScore>\n") + csd.write("\n</CsoundSynthesizer>") + csd.close() + + os.system('csound ' + path + '/temp.csd >/dev/null 2>/dev/null') + # os.system('csound ' + path + '/temp.csd') + +def audioWrite(file): + """Compile a .csd file""" + + csd = open(file, "w") + csd.write("<CsoundSynthesizer>\n\n") + csd.write("<CsOptions>\n") + csd.write("-+rtaudio=alsa -odevaudio -m0 -d -b256 -B512\n") + csd.write("</CsOptions>\n\n") + csd.write("<CsInstruments>\n\n") + csd.write("sr=16000\n") + csd.write("ksmps=50\n") + csd.write("nchnls=1\n\n") + # csd.write(orchlines.pop()) + for line in orchlines: + csd.write(line) + csd.write("\n</CsInstruments>\n\n") + csd.write("<CsScore>\n\n") + csd.write("f1 0 2048 10 1\n") + csd.write("f2 0 2048 10 1 0 .33 0 .2 0 .143 0 .111\n") + csd.write("f3 0 2048 10 1 .5 .33 .25 .2 .175 .143 .125 .111 .1\n") + csd.write("f10 0 2048 10 1 0 0 .3 0 .2 0 0 .1\n") + csd.write("f99 0 2048 7 1 2048 1\n") + csd.write("f100 0 2048 7 0. 10 1. 1900 1. 132 0.\n") + csd.write(scorelines.pop()) + # for line in scorelines: + # csd.write(line) + csd.write("e\n") + csd.write("\n</CsScore>\n") + csd.write("\n</CsoundSynthesizer>") + csd.close() + diff --git a/sprite_factory.py b/sprite_factory.py new file mode 100644 index 0000000..dd19ebc --- /dev/null +++ b/sprite_factory.py @@ -0,0 +1,51 @@ +#Copyright (c) 2009, Walter Bender + +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: + +#The above copyright notice and this permission notice shall be included in +#all copies or substantial portions of the Software. + +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +#THE SOFTWARE. + +import pygtk +pygtk.require('2.0') +import gtk +import gobject +import os.path + +from sprites import * + +# +# class for defining individual cards +# +class Sprite: + def __init__(self, tw, name, x, y, w, h, name_label=False): + # create sprite from svg file + self.spr = sprNew(tw, x, y, + self.load_image(tw.path,name,w,h)) + if name_label is True: + self.spr.label = name + else: + self.spr.label = "" + + def draw_slider(self, layer=1000): + setlayer(self.spr, layer) + draw(self.spr) + + def load_image(self, file, name, w, h): + return gtk.gdk.pixbuf_new_from_file_at_size(os.path.join(file + + name + + '.svg'), + w, h) + diff --git a/sprites.py b/sprites.py new file mode 100644 index 0000000..2d11d6c --- /dev/null +++ b/sprites.py @@ -0,0 +1,153 @@ +# -*- coding: utf-8 -*- + +#Copyright (c) 2007-8, Playful Invention Company. +#Copyright (c) 2008-9, Walter Bender + +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: + +#The above copyright notice and this permission notice shall be included in +#all copies or substantial portions of the Software. + +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +#THE SOFTWARE. + +import pygtk +pygtk.require('2.0') +import gtk +import gobject +import pango +class taSprite: pass + +def findsprite(tw,pos): + list = tw.sprites[:] + list.reverse() + for s in list: + if hit(s,pos): return s + return None + +def redrawsprites(tw): + for s in tw.sprites: draw(s) + +def sprNew(tw,x,y,image,altlabel=False): + spr = taSprite() + spr.tw, spr.x, spr.y = tw,x,y + setimage(spr,image) + spr.label = None + spr.ds_id = None + if altlabel: + spr.draw_label = draw_label2 + else: spr.draw_label = draw_label1 + return spr + +def setimage(spr,image): + spr.image = image + if isinstance(image,gtk.gdk.Pixbuf): + spr.width = image.get_width() + spr.height = image.get_height() + else: spr.width,spr.height=image.get_size() + +def move(spr,pos): + inval(spr) + spr.x,spr.y = pos + inval(spr) + +def setshape(spr,image): + inval(spr) + setimage(spr,image) + inval(spr) + +def setshapex(spr): + inval(spr) + +def setlayer(spr, layer): + sprites = spr.tw.sprites + if spr in sprites: sprites.remove(spr) + spr.layer = layer + for i in range(len(sprites)): + if layer < sprites[i].layer: + sprites.insert(i, spr) + inval(spr) + return + sprites.append(spr) + inval(spr) + +def hide(spr): + if spr not in spr.tw.sprites: return + inval(spr) + spr.tw.sprites.remove(spr) + +def setlabel(spr,label): + spr.label = label + inval(spr) + +def inval(spr): + spr.tw.area.invalidate_rect(gtk.gdk.Rectangle(spr.x,spr.y,spr.width, \ + spr.height), False) + +def draw(spr): + if isinstance(spr.image,gtk.gdk.Pixbuf): + spr.tw.area.draw_pixbuf(spr.tw.gc, spr.image, 0, 0, spr.x, spr.y) + else: + spr.tw.area.draw_drawable(spr.tw.gc,spr.image,0,0,spr.x,spr.y,-1,-1) + if spr.label!=None: + if hasattr(spr, 'proto') and hasattr(spr.proto, 'name'): + name = spr.proto.name + else: + name = "" + spr.draw_label(spr,str(spr.label)) + +def hit(spr,pos): + x,y = pos + if x<spr.x: return False + if x>spr.x+spr.width: return False + if y<spr.y: return False + if y>spr.y+spr.height: return False + return True + +def draw_label(spr, label, myscale, center_flag="False", vert_pos="middle"): + fd = pango.FontDescription('Sans') + fd.set_size(int(myscale*spr.tw.scale*pango.SCALE)) + if type(label) == str or type(label) == unicode: + mylabel = label.replace("\0"," ") + l = len(mylabel) + pl = spr.tw.canvas.create_pango_layout(mylabel) + pl.set_font_description(fd) + if center_flag: + swidth = pl.get_size()[0]/pango.SCALE + centerx = spr.x+spr.width/2 + x = int(centerx-swidth/2) + else: + x = spr.x+4 # small offset from left edge + sheight = pl.get_size()[1]/pango.SCALE + centery = spr.y+spr.height/2 + if vert_pos == "middle": + y = int(centery-sheight/2) + elif vert_pos == "top": + y = int(sheight/2) + elif vert_pos == "bottom": + y = int(spr.height-sheight) + spr.tw.gc.set_foreground(spr.tw.msgcolor) + spr.tw.area.draw_layout(spr.tw.gc, x, y, pl) + else: + print type(label) + +# used for sliders +def draw_label1(spr, label): + draw_label(spr, label, 12, True, "middle") + +def draw_label2(spr, label): + draw_label(spr, str(label), 14, True, "top") + +def draw_label3(spr, label): + draw_label(spr, str(label), 14, True, "bottom") + diff --git a/window.py b/window.py new file mode 100644 index 0000000..787f0e9 --- /dev/null +++ b/window.py @@ -0,0 +1,223 @@ +# -*- coding: utf-8 -*- +#Copyright (c) 2009, Walter Bender + +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: + +#The above copyright notice and this permission notice shall be included in +#all copies or substantial portions of the Software. + +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +#THE SOFTWARE. + +from constants import * +from time import * +import pygtk +pygtk.require('2.0') +import gtk +import gobject +from sound import playWave, audioWrite +import os + +from gettext import gettext as _ +import math + +try: + from sugar.graphics import style + GRID_CELL_SIZE = style.GRID_CELL_SIZE +except: + GRID_CELL_SIZE = 0 + +from sprite_factory import * + +class srWindow: pass + +# +# handle launch from both within and without of Sugar environment +# +def new_window(canvas, path, parent=None): + tw = srWindow() + tw.path = path + tw.activity = parent + + # starting from command line + # we have to do all the work that was done in CardSortActivity.py + if parent is None: + tw.sugar = False + tw.canvas = canvas + + # starting from Sugar + else: + tw.sugar = True + tw.canvas = canvas + parent.show_all() + + tw.canvas.set_flags(gtk.CAN_FOCUS) + tw.canvas.add_events(gtk.gdk.BUTTON_PRESS_MASK) + tw.canvas.add_events(gtk.gdk.BUTTON_RELEASE_MASK) + tw.canvas.add_events(gtk.gdk.POINTER_MOTION_MASK) + tw.canvas.connect("expose-event", _expose_cb, tw) + tw.canvas.connect("button-press-event", _button_press_cb, tw) + tw.canvas.connect("button-release-event", _button_release_cb, tw) + tw.canvas.connect("motion-notify-event", _mouse_move_cb, tw) + tw.width = gtk.gdk.screen_width() + tw.height = gtk.gdk.screen_height()-GRID_CELL_SIZE + tw.area = tw.canvas.window + tw.gc = tw.area.new_gc() + tw.cm = tw.gc.get_colormap() + tw.msgcolor = tw.cm.alloc_color('black') + tw.sprites = [] + tw.scale = 1 + tw.level = 0 + tw.seq = [[0,1],[0,1,0,1],[0,1,2,3,0,1,2,3],[0,1,2,3,0,1,2,3,0,1,2,3]] + tw.counter = 0 + + # Open the sliders + tw.buttons_off = [Sprite(tw,"Aoff",tw.width/2-W/2,H/2,W/2,H/2),\ + Sprite(tw,"Boff",tw.width/2-W,H,W/2,H/2),\ + Sprite(tw,"Doff",tw.width/2,H,W/2,H/2),\ + Sprite(tw,"Coff",tw.width/2-W/2,H+H/2,W/2,H/2)] + tw.buttons_on = [Sprite(tw,"Aon",tw.width/2-W/2,H/2,W/2,H/2),\ + Sprite(tw,"Bon",tw.width/2-W,H,W/2,H/2),\ + Sprite(tw,"Don",tw.width/2,H,W/2,H/2),\ + Sprite(tw,"Con",tw.width/2-W/2,H+H/2,W/2,H/2)] + tw.sounds = ['dog','sheep','cat','bird'] + tw.sound_files = [] + + for i in tw.sounds: + playWave(i) + path = tw.activity.get_activity_root() + "/instance/" + i + ".csd" + tw.sound_files.append(path) + audioWrite(path) + + _all_off(tw) + + # Start calculating + tw.press = None + tw.dragpos = 0 + return tw + +# +# Play +# +def _play_the_game(tw): + _all_on(tw) + for i in tw.buttons_on: + hide(i.spr) + for i in tw.seq[tw.level]: + draw(tw.buttons_on[i].spr) + inval(tw.buttons_on[i].spr) + # need to learn how timeouts really work... + print tw.sound_files[i] + os.system('csound ' + tw.sound_files[i] + \ + '/temp.csd >/dev/null 2>/dev/null') + sleep(1) + gobject.timeout_add(1000,hide,tw.buttons_on[i].spr) + # hide(tw.buttons_on[i].spr) + tw.counter = 0 + +# +# Button press +# +def _button_press_cb(win, event, tw): + win.grab_focus() + x, y = map(int, event.get_coords()) + tw.dragpos = x + spr = findsprite(tw,(x,y)) + tw.press = spr + return True + +# +# Mouse move +# +def _mouse_move_cb(win, event, tw): + if tw.press is None: + tw.dragpos = 0 + return True + + win.grab_focus() + x, y = map(int, event.get_coords()) + + dx = x-tw.dragpos + + # reset drag position + tw.dragpos = x + +# +# Button release +# +def _button_release_cb(win, event, tw): + if tw.press == None: + return True + for i in range (0,4): + if tw.press == tw.buttons_off[i].spr: + draw(tw.buttons_on[i].spr) + inval(tw.buttons_on[i].spr) + # gobject.timeout_add(1000,hide,tw.buttons_on[i].spr) + print tw.sound_files[i] + os.system('csound ' + tw.sound_files[i]) + # os.system('csound ' + tw.sound_files[i] + \ + # '/temp.csd >/dev/null 2>/dev/null') + sleep(1) + hide(tw.buttons_on[i].spr) + if tw.seq[tw.level][tw.counter] == i: # correct reponse + """ + print str(tw.counter) + ": made a match between " + \ + str(i) + " and " + str(tw.seq[tw.counter]) + """ + tw.counter += 1 + if tw.counter == len(tw.seq[tw.level]): + _all_on(tw) + tw.counter = 0 + tw.level += 1 + if tw.level == len(tw.seq): + tw.level = 0 + sleep(1) + _all_off(tw) + else: # incorrect response + """ + print "mismatch: " + str(i) + " is not " + \ + str(tw.seq[tw.counter]) + """ + + """ + _all_gone(tw) + sleep(1) + _all_off(tw) + """ + tw.counter = 0 + tw.press = None + +def _all_on(tw): + for i in tw.buttons_off: + i.draw_slider() + for i in tw.buttons_on: + i.draw_slider() + +def _all_off(tw): + for i in tw.buttons_off: + i.draw_slider() + for i in tw.buttons_on: + hide(i.spr) + +def _all_gone(tw): + for i in tw.buttons_off: + hide(i.spr) + for i in tw.buttons_on: + hide(i.spr) + +def _expose_cb(win, event, tw): + redrawsprites(tw) + return True + +def _destroy_cb(win, event, tw): + gtk.main_quit() |