Change Contents of the Bubble
Welcome to CS1315. Click on the python to add comments.

This page removed for FERPA compliance
View this PageEdit this Page (locked)Uploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Scale Generation

def makeSmoothStringNotes():
  file = 'string-c4.wav'
  source_note = makeSound(file)

  #writeSoundTo(new_note, '8string-c4.wav')
  

  changeNote(source_note, 0)
  changeNote(source_note, 2)
  changeNote(source_note, 4)
  changeNote(source_note, 5)
  changeNote(source_note, 7)
  changeNote(source_note, 9)
  changeNote(source_note, 11)
  #changeNote(source_note, 12)

def changeNote(source_note, steps):
  new_note= makeEmptySound(1)
  splice_begining = 7490
  splice_ending = 7659
  source_note_index = splice_begining
  for new_note_index in range(1, int(getSamplingRate(new_note)+1)):
    value = getSampleValueAt(source_note, int(source_note_index))
    setSampleValueAt(new_note, new_note_index, value)
    source_note_index = source_note_index + 2.0**(steps/12.0)
    if (source_note_index >= splice_ending):
      source_note_index = splice_begining
  notes = ['c','c#', 'd', 'd#','e','f','f#','g','g#','a','a#','b']
  blockingPlay(new_note)
  #writeSoundTo(new_note, 'smooth_string-'+notes[steps]+'4.wav')


  


Link to this Page