[Etoys] Sound tool refactoring and enhancement

karl karl.ramberg at comhem.se
Wed May 7 13:57:36 EDT 2008


polishookm wrote:
> Bert, the etoy you attached to your previous mail is fabulous; as best 
> as I can tell, it demonstrates what Karl has been suggesting in his 
> mails. From my point of view, it would be nice if
>
> 1. more tile scripting options existed for sounds (simple 
> transformations that could be applied ....)
> 2. something such as a sound holder or some other collection mechanism 
> existed (maybe it already does?)
>
> As best as I can tell, sound can (obviously) be scripted in response to 
> morphic events.
>
> I'm still wondering if morph events can be scripted in response to 
> conditions that exist in a sound? For example, is a sound file ended, 
> can a player then change its costume?
>
> Is there any documentation on the web or elsewhere about extending the 
> tile system? Or (my guess) is documentation mostly the class comments, 
> etc. in Etoys?
>   
I don't know of any documentation but take a look at the attached change 
set that adds tile scripting to StarMorphs.
Feel free to ask questions if you have any.

Karl

>
>
> Bert Freudenberg wrote:
>   
>> On 07.05.2008, at 09:38, karl wrote:
>>
>>     
>>> K. K. Subramaniam wrote:
>>>       
>>>> On Tuesday 06 May 2008 11:49:02 pm you wrote:
>>>>
>>>>         
>>>>> There are lots of possible pathways here to make nicer sound / music
>>>>> environment but it needs to be thought through and carefully designed.
>>>>>
>>>>>           
>>>> An interesting application of sound tiles for learning is seen in
>>>>
>>>> http://www.ccd.rpi.edu/Eglash/csdt/latino/rhythm/rhy_intr.htm
>>>>
>>>> It illustrates how units of sounds can be combined using simple 
>>>> algebras to
>>>> produce rhythms. In the process, children get to learn about 
>>>> similarity,
>>>> repetitions, multiples and so on.
>>>>
>>>> Regards .. Subbu
>>>>
>>>>
>>>>         
>>> Thats really cool.  You can kind of do the same with the Sound
>>> SequencerMorph, in a linear fashion. And the UI should be cleaned up a
>>> little.
>>>       
>> I made an Etoy a while ago, see attachment. Drag the yellow "notes" 
>> off the circle, and resize them to change pitch. Now, what would be 
>> really cool if we could make this use an instrument instead of the 
>> simple sine wave ...
>>
>> The same thing should be doable with percussions, just drop some 
>> sampled sounds into the world.
>>
>> On the XO it would be great to use TamTam instruments. We have OSC for 
>> Squeak ...
>>
>> - Bert -
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Etoys mailing list
>> Etoys at lists.laptop.org
>> http://lists.laptop.org/listinfo/etoys
>>     
>
>   

-------------- next part --------------
'From etoys3.0 of 24 February 2008 [latest update: #1985] on 26 April 2008 at 5:34:59 pm'!
"Change Set:		StarMorphScripting
Date:			26 April 2008
Author:			Karl Ramberg

Adds two scripting access points to StarMorphs."!


!Player methodsFor: 'vertices operation' stamp: 'kfr 4/26/2008 17:22'!
getStarRatio
	^ (self costume starRatio * 100) rounded! !

!Player methodsFor: 'vertices operation' stamp: 'kfr 4/26/2008 17:27'!
setStarRatio: aInteger
		| int float |
	int := aInteger min: 100 max: 1.
	float  := (100 / int) asFloat.
	^ self costume starRatio: float! !

!Player methodsFor: 'vertices operation' stamp: 'kfr 4/26/2008 17:09'!
setVerticesCount: aInteger 
	| verticesCount int |
	verticesCount := self getVerticesCount.
	int := aInteger.
	aInteger > verticesCount
		ifTrue: [int even
				ifFalse: [int := int + 1].
			self costume makeVertices: int]
		ifFalse: [int even
				ifFalse: [int := int - 1 max:4].
			self costume makeVertices: int]! !


!StarMorph class methodsFor: 'scripting' stamp: 'kfr 4/26/2008 17:31'!
additionsToViewerCategories
	"Answer a list of (<categoryName> <list of category specs>) pairs that characterize the phrases this kind of morph wishes to add to various Viewer categories."

	^ # (

(star (

(slot verticesCount 'How many vertices are within me' Number readWrite Player getVerticesCount Player setVerticesCount:)
(slot starRatio 'How long vertices are within me' Number readWrite Player getStarRatio Player setStarRatio:)


))

)! !


!StarMorph class reorganize!
('parts bin' descriptionForPartsBin)
('class initialization' initialize registerInFlapsRegistry unload)
('scripting' additionsToViewerCategories)
!



More information about the etoys-dev mailing list