Difference between revisions of "AdamFoxFinalProject"

From CSWiki
Jump to: navigation, search
(Rhythm Guitar Hero)
(Playing the Lead Guitar)
 
(11 intermediate revisions by the same user not shown)
Line 6: Line 6:
 
=== Rhythm Guitar Hero ===
 
=== Rhythm Guitar Hero ===
  
The first instrument uses the [http://en.wikipedia.org/wiki/Karplus-Strong_string_synthesis Karplus Strong algorithm] to simulate a six-string acoustic guitar that strums chords.  The chords are preprogrammed, such that each voicing is consistent with that of a real acoustic guitar.  Some of the methods implemented for the class are:
+
The first instrument uses the [http://en.wikipedia.org/wiki/Karplus-Strong_string_synthesis Karplus Strong algorithm] to simulate a six-string acoustic guitar that strums chords.  The chords are preprogrammed, such that each voicing is consistent with that of a real acoustic guitar.  Some of the methods implemented for the class RhythmGuitarHero are:
  
* void capo(int fretPosition) ... tunes the guitar up by half-steps, simulating a capo
+
* .capo(int, READ/WRITE) ... tunes the guitar up by half-steps, simulating a capo
  
* void setStrumSpeed(float number) ... sets the strum speed (0 is very fast, 1 is very slow)
+
* .setStrumSpeed(float, READ/WRITE) ... sets the strum speed (0 is instantaneous, 1 is a slow arpeggio)
  
=== This is another subsection ===
+
* .startPlaying() ... puts the guitar in interactive mode, allowing live performance
  
[http://www.google.com with a link off the wiki]
+
=== How to Play the Rhythm Guitar ===
  
[[PLOrk_spring2008 | and a link on the wiki]]
+
Once the .startPlaying method is accessed, the interactive mode is turned on. 
 +
*One can perform a "strum" with button 8.  It is possible to strum in either direction, up or down.
 +
*Holding down buttons 1-4 correspond to six different chords in one key; the default key is C.  The guitar does not support diminished triads or diminished 7th chords.
 +
*Simultaneously holding the A button will alter the chord.  (The "most common alteration" is used)
 +
*Button 6 shifts the key up one half step.  Button 7 shifts the key down one half step.
  
=== What to include on your project page ===
+
=== Chord Fingerings and Alterations ===
* A description of your project
+
* I Chord: Button 1.  Alteration:  Dominant 7th
* Your code
+
* ii Chord: Buttons 1, 2.  Alteration: Major 3rd
** If it's short, you can make a new page for it like [http://wiki.cs.princeton.edu/index.php/Poly_demo.ck this one]
+
* iii Chord:  Buttons 1, 2, 3.  Alteration:  Major 3rd
** Or, if there's a lot of it, put it in a .zip file so that people can upload it.
+
* IV Chord:  Buttons 1, 2, 3, 4.  Alteration:  Minor 3rd
*** We suggest: put it in your public_html directory on your network drive, then make a link, e.g. to http://www.princeton.edu/~yourname/yourfile.zip. Let us know if you need any help!
+
* V Chord:  Buttons 2, 3, 4.  Alteration:  Dominant 7th
* Instructions on how to run your code
+
* vi Chord:  Buttons 3, 4.  Alteration: Major 3rd
* A sound (or video!) recording of your piece, if possible
+
 
** See directions above on putting it on your network drive and linking to it
+
The rhythm guitar does not support the diminished vii chord.
 +
 
 +
=== LeadGuitarHero Class ===
 +
The second class LeadGuitarHero is designed to give the freedom to play some riffs and "hammer" solos.  The sound is implemented with an enveloped SndBuf (guitar sound is provided [http://www.cs.princeton.edu/~fiebrink/314/features/perrysriff.wav here)]. Right now, LeadGuitarHero supports solos on the [http://en.wikipedia.org/wiki/Blues_scale blues scale], although it would be simple enough to integrate a method .setNotes in order to have the guitar play any such scale. 
 +
 
 +
* .gain(float, READ/WRITE) ... this sets the gain of the guitar (default is 1.0)
 +
 
 +
=== Playing the Lead Guitar ===
 +
* Button 8 triggers the enveloping (turns the guitar on and off)
 +
* Similar to the rhythm guitar, the buttons 1-4 correspond to notes on the blues scale.
 +
**First note:  1
 +
**Second note: 1, 2
 +
**Third note: 1, 2, 3
 +
**Fourth note: 1, 2, 3, 4
 +
**Fifth note: 2, 3, 4
 +
**Sixth note: 3, 4
 +
**Seventh note: 4
 +
* The button 6 increases the key by one half step.  Similarly, the button 7 decreases the key.
 +
* The A button is not functional in this class.
 +
 
 +
=== Instructions for Running the Code ===
 +
* Ensure that the file [http://www.princeton.edu/~afox/leadguitar.wav leadguitar.wav] is in the running ChucK directory
 +
* Download the .ck files [http://wiki.cs.princeton.edu/index.php/RhythmGuitarHero.ck RhythmGuitarHero], [http://wiki.cs.princeton.edu/index.php/LeadGuitarHero.ck LeadGuitarHero].
 +
* Have fun!

Latest revision as of 16:49, 13 May 2008

Adam Fox's Final Project: Guitar Hero Interface

For my final project, I used ChucK to build an two different instruments that can be played with a Guitar Hero controller.

Guitar Hero Controller

Rhythm Guitar Hero

The first instrument uses the Karplus Strong algorithm to simulate a six-string acoustic guitar that strums chords. The chords are preprogrammed, such that each voicing is consistent with that of a real acoustic guitar. Some of the methods implemented for the class RhythmGuitarHero are:

  • .capo(int, READ/WRITE) ... tunes the guitar up by half-steps, simulating a capo
  • .setStrumSpeed(float, READ/WRITE) ... sets the strum speed (0 is instantaneous, 1 is a slow arpeggio)
  • .startPlaying() ... puts the guitar in interactive mode, allowing live performance

How to Play the Rhythm Guitar

Once the .startPlaying method is accessed, the interactive mode is turned on.

  • One can perform a "strum" with button 8. It is possible to strum in either direction, up or down.
  • Holding down buttons 1-4 correspond to six different chords in one key; the default key is C. The guitar does not support diminished triads or diminished 7th chords.
  • Simultaneously holding the A button will alter the chord. (The "most common alteration" is used)
  • Button 6 shifts the key up one half step. Button 7 shifts the key down one half step.

Chord Fingerings and Alterations

  • I Chord: Button 1. Alteration: Dominant 7th
  • ii Chord: Buttons 1, 2. Alteration: Major 3rd
  • iii Chord: Buttons 1, 2, 3. Alteration: Major 3rd
  • IV Chord: Buttons 1, 2, 3, 4. Alteration: Minor 3rd
  • V Chord: Buttons 2, 3, 4. Alteration: Dominant 7th
  • vi Chord: Buttons 3, 4. Alteration: Major 3rd

The rhythm guitar does not support the diminished vii chord.

LeadGuitarHero Class

The second class LeadGuitarHero is designed to give the freedom to play some riffs and "hammer" solos. The sound is implemented with an enveloped SndBuf (guitar sound is provided here). Right now, LeadGuitarHero supports solos on the blues scale, although it would be simple enough to integrate a method .setNotes in order to have the guitar play any such scale.

  • .gain(float, READ/WRITE) ... this sets the gain of the guitar (default is 1.0)

Playing the Lead Guitar

  • Button 8 triggers the enveloping (turns the guitar on and off)
  • Similar to the rhythm guitar, the buttons 1-4 correspond to notes on the blues scale.
    • First note: 1
    • Second note: 1, 2
    • Third note: 1, 2, 3
    • Fourth note: 1, 2, 3, 4
    • Fifth note: 2, 3, 4
    • Sixth note: 3, 4
    • Seventh note: 4
  • The button 6 increases the key by one half step. Similarly, the button 7 decreases the key.
  • The A button is not functional in this class.

Instructions for Running the Code