Percussion Workbench

Percussion Workbench preview image

1 collaborator

Uri_dolphin3 Uri Wilensky (Author)

Tags

(This model has yet to be categorized with any tags)
Model group CCL | Visible to everyone | Changeable by group members (CCL)
Model was written in NetLogo 5.0.4 • Viewed 201 times • Downloaded 32 times • Run 1 time
Download the 'Percussion Workbench' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

extensions [ sound ]

globals [ drum-index memory ]

;; initializes the drum-index and the memory bank

to startup
  set drum-index 0
  set memory (list "" "" "" "")
end 

;; plays the current note and prints it to the output area

to play
  run generate-command
  output-print generate-command
end 

;; generates a NetLogo command to play the current drum
;; at the current pitch with the current velocity

to-report generate-command
  report (word "sound:play-drum "
               "\"" ( item drum-index sound:drums ) "\" "
               velocity)
end 

;; saves the current command in the nth memory slot

to save [ n ]
  set memory replace-item n memory generate-command
end 

;; arrow keys to scroll through the drum list

to first-drum
  set drum-index 0
  play
end 

to last-drum
  set drum-index length sound:drums - 1
  play
end 

to next-drum
  if drum-index < length sound:drums - 1 [
    set drum-index drum-index + 1
    play
  ]
end 

to prev-drum
  if drum-index > 0 [
    set drum-index drum-index - 1
    play
  ]
end 


; Public Domain:
; To the extent possible under law, Uri Wilensky has waived all
; copyright and related or neighboring rights to this model.

There are 10 versions of this model.

Uploaded by When Description Download
Uri Wilensky over 11 years ago Updated to NetLogo 5.0.4 Download this version
Uri Wilensky about 12 years ago Updated version tag Download this version
Uri Wilensky almost 13 years ago Updated to NetLogo 5.0 Download this version
Uri Wilensky over 14 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 14 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 14 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 14 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 14 years ago Model from NetLogo distribution Download this version
Uri Wilensky over 14 years ago Percussion Workbench Download this version
Uri Wilensky over 14 years ago Percussion Workbench Download this version

Attached files

File Type Description Last updated
Percussion Workbench.png preview Preview for 'Percussion Workbench' over 11 years ago, by Uri Wilensky Download

This model does not have any ancestors.

This model does not have any descendants.