Skip to content

Instantly share code, notes, and snippets.

@Agnostic
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save Agnostic/0ca2536acd908d5db056 to your computer and use it in GitHub Desktop.

Select an option

Save Agnostic/0ca2536acd908d5db056 to your computer and use it in GitHub Desktop.

Revisions

  1. Agnostic revised this gist Aug 8, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion c_major_bass.scm
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,7 @@
    (au:update-graph)

    ; Variables
    (define initialNote 48) ; DO
    (define initialNote 48) ; C / Do

    ; Internal Variables
    (define note initialNote)
  2. Agnostic revised this gist Aug 8, 2014. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions c_major_bass.scm
    Original file line number Diff line number Diff line change
    @@ -13,8 +13,7 @@
    (au:update-graph)

    ; Variables
    (define initialNote 48)
    (define scales 3)
    (define initialNote 48) ; DO

    ; Internal Variables
    (define note initialNote)
  3. Agnostic revised this gist Aug 8, 2014. 1 changed file with 2 additions and 4 deletions.
    6 changes: 2 additions & 4 deletions c_major_bass.scm
    Original file line number Diff line number Diff line change
    @@ -103,10 +103,8 @@
    (set! tone 0)
    )

    ; If note < max scales
    (if (< note (+ initialNote (* 12 scales) ) )
    (callback (+ (now) (* 0.20 *second*)) loop )
    )
    ; Calling loop again
    (callback (+ (now) (* 0.20 *second*)) loop )

    )
    )
  4. Agnostic revised this gist Aug 8, 2014. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions c_major_bass.scm
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,8 @@
    ; C Major Chord
    ; By Gilberto Avalos

    ; You need Impromptu to run this script
    ; http://impromptu.moso.com.au/downloads.html

    ; Clear all
    (au:clear-graph)
  5. Agnostic created this gist Aug 8, 2014.
    112 changes: 112 additions & 0 deletions c_major_bass.scm
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,112 @@
    ; C Major Chord
    ; By Gilberto Avalos

    ; Clear all
    (au:clear-graph)

    ; Define piano instrument
    (define piano (au:make-node "aumu" "dls " "appl"))
    (au:connect-node piano 0 *au:output-node* 0)
    (au:update-graph)

    ; Variables
    (define initialNote 48)
    (define scales 3)

    ; Internal Variables
    (define note initialNote)
    (define notes 0)

    ; Play function
    (define play
    (lambda (base_note bass)

    ; Bass
    (if (> bass 0)
    (play-note (now) piano bass 80 15000)
    )

    (if (and (= notes 0) (> note base_note) )
    (set! note (+ note 1))
    )

    (if (= notes 2)
    (set! notes -1)
    )

    ; (print "Play Note" note notes)

    ; Play note
    (play-note (now) piano note 100 10000)

    (if (< notes 1)
    (set! note (+ note 4))
    )

    (if (= notes 1)
    (set! note (+ note 3))
    )

    (set! notes (+ notes 1))
    )
    )

    ; Tone
    (define tone 0)

    ; Loop function
    (define loop
    (lambda ()
    (define bass 0)

    ; First tone
    (if (= tone 0)
    (set! note initialNote)
    )

    ; Bass 1
    (if (= tone 0)
    (set! bass (- initialNote 12))
    )

    ; Second tone
    (if (= tone 3)
    (set! note (+ initialNote 2))
    )

    ; Bass 2
    (if (= tone 3)
    (set! bass (- (+ initialNote 4) 12))
    )

    ; Third tone
    (if (= tone 6)
    (set! note (+ initialNote 7))
    )

    ; Bass 3
    (if (= tone 6)
    (set! bass (- (+ initialNote 7) 12))
    )

    ; Call Play
    (play note bass)

    ; Increase tone
    (set! tone (+ tone 1))

    ; Reset tone to 0
    (if (= tone 9)
    (set! tone 0)
    )

    ; If note < max scales
    (if (< note (+ initialNote (* 12 scales) ) )
    (callback (+ (now) (* 0.20 *second*)) loop )
    )

    )
    )

    ; Call loop
    (loop)