Introduction

When generating audio stimuli for psychoacoustic experiemention, it is important to to be as accurate as possible (generally down to the sub-millisecond and sub-dB level). For this reason, we generally use applications such as PD, CSound, CMusic or Max/MSP. These tools allow us to generate waveforms with sample-accuracy, specific rise/fall times, specific amplitude levels and, in some cases, phase-continuity. However, when prototyping, these applications (and the necessity for precision) can be obtrusive and a more friendly environment is desired. This document covers some basics about using consumer audio software to generate audio simulus.

Limitations

The obvious limitation consumer audio software is the inprecision. Often, amplitude is specified by midi velocity (which changes from instrument to instrument), rise and fall times are built in, timng is specified by MIDI (or custom) sequences, edits are on zero-crossings and pitch is specified by midi note number. To get around these limitation, we can map what we know to what we want to know.

Using Reason to general Sine Wave Stimuli

Reason (from http://propellerheads.se) is a great "virtual rack" style tool for music creation. It has several virtual instruments. The "Subtractor" synthesizer is a 2-oscillator synth with various filters and LFOs. If all of the extras are disabled, it makes a great function generator. This ".zyp" file is a Reason Subtractor patch for sine wave generation (note that most functions are disabled, Osc 1 is a sine wave and the velocity knob is 100% clockwise).

Simple_Sine.zyp.zip

To calibrate the output of this instrument, I created a MIDI sequence (amplitude_range.mid) on C4 with 128 notes (each note a different velocity). A WAV file (amplitude_range.wav) was generated from the direct output of the Subtractor patch (i.e. Subtractor is patched directly to the device output with no mixer or other devices in the rack) and the "find Peak" DSP function in Peak 5.2 was used to determine the amplitude (in dB). Here are the results:

  MIDI
Velocity
dB
(peak)
 
  0 OFF  
  1 -73.41  
  2 -69.48  
  3 -66.79  
  4 -64.73  
  5 -63.07  
  7 -60.21  
  9 -58.05  
  11 -56.16  
  13 -54.46  
  17 -51.52  
  21 -49.02  
  25 -46.79  
  29 -44.83  
  33 -43  
  37 -41.27  
  41 -39.65  
  45 -38.12  
  49 -36.63  
  53 -35.22  
  57 -33.85  
  61 -32.51  
  65 -31.22  
  69 -29.96  
  73 -28.73  
  77 -27.51  
  81 -26.32  
  85 -25.16  
  89 -24.01  
  93 -22.88  
  97 -21.77  
  101 -20.67  
  105 -19.58  
  109 -18.51  
  113 -17.45  
  117 -16.39  
  121 -15.35  
  125 -14.32  
  127 -13.81  

subtractor_amp_vs_vel.txt

With the above map and Subtractor patch, it is now possible to generate sine wave output with dB-level precision (better by extrapolating). Here is an example of a wave file with 4 1-second Sine waves using MIDI velocities 85, 87, 89 and 91:

4-note_amp_example.wav

Note the following:

  • Amplitude -
  • Pitch -
  • Rise/Fall times -
  • Duration -

Links

Reason
Logic
PERL MIDI::Simple
Sambamatic

Examples and Utilities

Simple_Sine.tiff
Simple_Sine.zyp
amplitude_range.mid
amplitude_range.rns
amplitude_range.wav


Random Image
Random Image
Random Image
Random Image
Random Image
Random Image