Daqarta
Data AcQuisition And Real-Time Analysis
Scope - Spectrum - Spectrogram - Signal Generator
Software for Windows
Science with your Sound Card!
The following is from the Daqarta Help system:

Features:

Oscilloscope

Spectrum Analyzer

8-Channel
Signal Generator

(Absolutely FREE!)

Spectrogram

Pitch Tracker

Pitch-to-MIDI

DaqMusiq Generator
(Free Music... Forever!)

Engine Simulator

LCR Meter

Remote Operation

DC Measurements

True RMS Voltmeter

Sound Level Meter

Frequency Counter
    Period
    Event
    Spectral Event

    Temperature
    Pressure
    MHz Frequencies

Data Logger

Waveform Averager

Histogram

Post-Stimulus Time
Histogram (PSTH)

THD Meter

IMD Meter

Precision Phase Meter

Pulse Meter

Macro System

Multi-Trace Arrays

Trigger Controls

Auto-Calibration

Spectral Peak Track

Spectrum Limit Testing

Direct-to-Disk Recording

Accessibility

Applications:

Frequency response

Distortion measurement

Speech and music

Microphone calibration

Loudspeaker test

Auditory phenomena

Musical instrument tuning

Animal sound

Evoked potentials

Rotating machinery

Automotive

Product test

Contact us about
your application!

!Spooky.GEN Setup File - Sci-Fi Theremin Simulator

Old science fiction movies often had a theme played on a "theremin" to give an eerie feeling to scenes. A theremin is a musical instrument that creates tones based on the position of the player's hands; one hand controls pitch, while the other controls volume. As the hands move to new positions, the sounds slide smoothly from one to the next.

The !Spooky.GEN setup doesn't actually allow you to control it with your hands, but it does allow smooth note transitions. Click the Generator Load Setup button and it will start playing as soon as you load select and load it.

Although this setup was originally intended as background sound for a Halloween display, the endless repetition of the same 4-note theme gets old rather quickly; the MIDI-based !Spooky4.DQM uses the same basic theme but with lots of variations to keep it interesting all night long.

Nevertheless, !Spooky.GEN allows easy user modifications, up to complete replacement of the original theme with any arbitrary tune, including your own compositions. To understand how to do this, here is how it was created.

!Spooky.GEN is based upon a list consisting of the duration of each note followed by the note frequency, one such pair per line. If a frequency is different from the prior line, then the duration gives the time to slide from the prior frequency to the new one. Here is the !Spooky_List.TXT source file, which is also in the Documents - Daqarta - User_Data folder:

;Duration  Frequency
-1           0             ;-1 = Duration code, 0 Hz = off
0.1        261.626         ;0.1 sec slide to C4 from 0
1.0        261.626         ;1 sec hold at C4
0.1        391.995         ;0.1 sec slide to G4 from C4
1.0        391.995         ;1 sec hold at G4
0.1        369.994         ;0.1 sec slide to F# from G4
1.0        369.994         ;1 sec hold at F#
0.1        349.228         ;0.1 sec slide to F from F#
0.5        349.228         ;1 sec hold at F
0.05         0             ;0.05 sec slide to 0 from F
0.3          0             ;0.3 sec hold at 0

Note that the very first entry (-1) is a special code that indicates the first column values are durations, instead of elapsed time (the default).

The Arb_From_List macro was then used to read !Spooky_List.TXT and interpolate values to create a wave shape, which it displays and prompts to be saved as an Arb file, as needed for !Spooky.GEN.

The waveform is automatically scaled by Arb_From_List such that the highest frequency is at full scale (1000 mV here, but meaningless since it depends upon calibration).

Note that the default file type saved by Arb_From_List is .TXT, whereas !Spooky.GEN loads !Spooky.DAT. You have to use the Save as type control at the bottom of the Save As dialog to select Raw Data Files (.DAT), then enter the !Spooky filename.

When you select !Spooky.GEN via the Generator Load Setup button, it looks for !Spooky.DAT and loads that as an Arb waveform. This is used by Left Stream 0 to modulate Left Stream 1, both for Amplitude Modulation (AM) and Frequency Modulation (FM).

The fact that the same waveform controls both amplitude and frequency means that the generated sound gets louder for the higher notes, and drops to nothing at the zero ends.

!Spooky.GEN defaults to running at a tone frequency of 1/8 Hz (0.12499) on Left Stream 0, which means the entire wave cycle takes 8 seconds. You can set this faster or slower as desired.

If you toggle Sgram/PT on and activate Pitch Track (after opening the Sgram/Pt dialog by clicking the thin unmarked button below Sgram/PT in the toolbar) you can see the note sequence on the labeled vertical axis. You will notice that the higher notes are dark orange, while the start note (C4) is rather pale because it is softer.

You can reduce the pitch by reducing the Stream Level below the default 100%. At 50% it will be an octave lower, starting at C3 instead of C4. However, the amplitude will also be much lower due to the same waveform driving the amplitude modulation in Left Stream 1. You can click on the AM dialog button there and toggle AM On off, and the amplitude will be maximum for all notes.

You can also change the waveform of the output tone. Go to Left Stream 1 and click on Wave, which will show all the options. The useful ones are Sine, Triangle, Ramp, Square, Pulse, and Arb. Sine is a pure tone, Triangle (default) has more harmonics, Square has more still, Ramp more than that, and Pulse most of all (though adjustable). Arb, when selected, defaults to Arb_Fake_Vowel which has limited harmonics and sounds somewhat like a human voice. Feel free to try other Arb waves; to do that click on Arb 3 and set Files of type in the Open dialog to .DAT to see all those that are included with Daqarta. Or use the Arb_From_Equation macro mini-app to create your own.

You can substitute your own tune for the default by modifying !Spooky_List.TXT, running Arb_From_List, and saving the Arb as !Spooky.DAT. An easy way to do this is to open the large Notes dialog and use the Load File button to put !Spooky_List into Notes, then edit as desired and start Arb_From_List with the SHIFT key held down so it will use Notes instead of prompting for a file name. This way you can make repeated adjustments without having to save and re-load the source list.

A simple modification of the default list is to change the relative durations of the notes, or the times to slide between notes.

Or create an entirely new list in Notes and save it under a .DAT name of your choice, then load !Spooky.GEN and open the Left Stream 0 Wave dialog, select Arb, click on the [X] next to !Spooky.DAT to delete it, and load your new .DAT to Arb 0. Then save the modified setup under a new name.

If your new list has a different maximum frequency than G4 (391.995 Hz), you'll need to change the Left Stream 1 FM deviation to match.


See also Machines.GEN Mad Scientist Lab Background Sound, DaqMusiq, !Spooky4.DQM MIDI Setup for Halloween

GO:

Questions? Comments? Contact us!

We respond to ALL inquiries, typically within 24 hrs.
INTERSTELLAR RESEARCH:
Over 35 Years of Innovative Instrumentation
© Copyright 2007 - 2023 by Interstellar Research
All rights reserved