Skip to content

Commit

Permalink
fix bug on Rhythm ,add new methods to create jungle rhythms
Browse files Browse the repository at this point in the history
  • Loading branch information
lucretiomsp committed Oct 23, 2024
1 parent 9df42a4 commit 7f5889e
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 5 deletions.
41 changes: 41 additions & 0 deletions src/Coypu/Integer.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,47 @@ Integer >> into: anArray [
^ anArray fullScale asArray wrap: self
]

{ #category : '*Coypu' }
Integer >> jungleKick [
" create an array of self size of jungle kick rhythm. "

| pattern announcement |
announcement := RhythmAnnouncement new rhythm:
self asString , ' jungleRim'.
PerformanceRecorder uniqueInstance announce: announcement.
pattern := '00145145' hexBeat gates.

^ pattern
]

{ #category : '*Coypu' }
Integer >> jungleRim [
" create an array of self size of jungle rim rhythm. "

| pattern announcement |
announcement := RhythmAnnouncement new rhythm:
self asString , ' jungleRim'.
PerformanceRecorder uniqueInstance announce: announcement.
pattern := '88000000' hexBeat gates.

^ pattern
]

{ #category : '*Coypu' }
Integer >> jungleSnare [
" create an array of self size of jungle snare rhythm. "

| pattern announcement |
announcement := RhythmAnnouncement new rhythm:
self asString , ' jungleSnare'.
PerformanceRecorder uniqueInstance announce: announcement.
pattern := '00820820' hexBeat gates.

^ pattern

"implement shifting to the left"
]

{ #category : '*Coypu' }
Integer >> melodyFrom: aScale [

Expand Down
11 changes: 6 additions & 5 deletions src/Coypu/Rhythm.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ The Rhythm class contains an Array with allRhythmNames and convenience methods
"
Class {
#name : 'Rhythm',
#superclass : 'Object',
#superclass : 'Array',
#type : 'variable',
#classInstVars : [
'allRhythmNames'
Expand All @@ -15,13 +15,14 @@ Class {

{ #category : 'accessing' }
Rhythm class >> allRhythmNames [

"return all the possible Rhythms obtainable sending messages to integers"

| rhythmList |
rhythmList := #( #adowa '#aksak #banda #bomba #bossa #breves #semibreves #claveSon #downbeats #gahu #quavers' #semiquavers #rumba #shiko #sikyi #soukous #tresillo #trueAksak #tumbao #upbeats ).

^ rhythmList
rhythmList := #( #adowa '#aksak #banda #bomba #bossa #breves #semibreves #claveSon #downbeats #gahu #quavers'
#semiquavers #randomTrigs #rumba #shiko #sikyi #soukous #tresillo
#trueAksak #tumbao #upbeats ).

^ rhythmList
]

{ #category : 'accessing' }
Expand Down

0 comments on commit 7f5889e

Please sign in to comment.