' Left, Right, Time
DATA 24,24,8
' unison
DATA 32,48,4
' Perfect fifth.
DATA 40,42,8
' Minor Semitone.
DATA 36,36,4
' Unison
DATA 32,28,6
' Septimal whole tone.
DATA 0,0,3
' Rest for three beats.
DATA 21,36,8
' Septimal major sixth.
DATA 28,38,4
' 19:14 Obscure -- vibrato harmony.
DATA 36,36,8
' Unison
DATA 32,32,4
' Unison
DATA 28,28,6
' Unison
DATA 0,0,3
' Rest
DATA 19,32,9
' Nonadecimal subharmonic. Diminished octave?
DATA 25,36,4
' Classic diminished fifth.
DATA 32,32,8
' Unison
DATA 28,28,4
' Unison
DATA 25,25,9
' Unison
DATA 0,0,2
' Rest
DATA 36,48,12
' Perfect fourth.
DATA 28,25,12
' Middle second.
DATA 0,0,3
DATA 40,24,9
' Major sixth.
DATA 32,40,4
' Major third.
DATA 24,36,8
' Perfect fifth.
DATA 21,32,4
' Wide fifth.
DATA 19,28,9
' Obscure. 20:30 is a perfect fifth.
DATA 0,0,2
DATA 24,42,12
' Jazz Seventh.
DATA 16,32,12
' Octave.
DATA 0, 0, 3
' Rest.
DATA 36,25,8
' Classic diminished fifth.
DATA 28,36,4
' Perfect fifth.
DATA 21,39,8
' http://www.huygens-fokker.org/docs/intervals.html says it's a 16/3-tone
' I think that means it is supposed to be a tritone.
DATA 19,32,4
' 19th subharmonic. Diminished octave?
DATA 18,28,8
' Septimal minor sixth.
DATA 0,0,2
' Rest.
DATA 21,48,12
' Septimal major ninth.
DATA 0,0,1
' Rest indicates staccato. The rest of it is legato.
DATA 18,36,11
' Octave.
DATA 0, 0, 3
DATA 40,48,8
' Minor third.
DATA 32,36,4
' Major second.
DATA 24,42,8
' Jazz Seventh.
DATA 32,48,4
' Perfect fifth.
DATA 36,21,8
' Septimal major sixth.
DATA 32,24,8
' Perfect fouth.
DATA 0,0,34
' Two seconds of tail. (That does not mean how it sounds. ):
OPTION BASE 1
DIM TwoPi AS DOUBLE
DIM pi AS DOUBLE
DIM temp AS DOUBLE
DIM BeatsPerSecond AS DOUBLE
DIM Angle(2) AS DOUBLE
DIM Velocity(2) AS DOUBLE
DIM Acceleration(2) AS DOUBLE
DIM Phase(2) AS DOUBLE
DIM Note(2) AS INTEGER
DIM LastNote(2) AS INTEGER
DIM length AS INTEGER
DIM Harmonics(2) AS SINGLE
DIM Samples AS LONG
DIM t AS LONG
DIM SampleRate AS LONG
DIM k AS INTEGER
DIM g AS INTEGER
DIM amp AS INTEGER
DIM basis AS INTEGER
DIM NumHarmonics AS INTEGER
DIM part(2) AS INTEGER
DIM Sign(2) AS INTEGER
DIM glide AS INTEGER
DIM test AS STRING
DIM TerminalAngle(2) AS DOUBLE
DIM DropAngle(2) AS DOUBLE
DIM PhaseDir(2) AS DOUBLE
PRINT
test = "0"
' I frequently flip that.
NumHarmonics = 2
BeatsPerSecond = 17#
pi = 3.141592653589793#
TwoPi = pi * 2
SampleRate = 8000
LastNote(1) = 0
LastNote(2) = 0
IF test = "0" THEN
OPEN "alfabet.bat" FOR OUTPUT AS #1
OPEN "\sox\alfabet.raw" FOR OUTPUT AS #4
PRINT #1, "e:\progra~1\freebasic\fbc -lang qb d:\basic\alfabet.bas"
PRINT #1, "alfabet.exe"
PRINT #1, "cd \sox"
PRINT #1, "sox -c 2 -r"; SampleRate; " -sw alfabet.raw alfabet.wav
stat"
CLOSE #1, #2
END IF
FOR k = 1 TO NumHarmonics
READ part(k), Harmonics(k)
Note(k) = 0
LastNote(k) = 0
NEXT k
glide = 30
100
FOR g = 1 TO 47
READ Note(1), Note(2), length
' IF g > 0 THEN
' SOUND Note(1) * 8, length
' END IF
IF test = "0" THEN
IF Note(1) = 0 AND LastNote(1) = 0 THEN
Samples = SampleRate * length / BeatsPerSecond
GOSUB 300
GOTO 75
END IF
IF Note(1) = 0 AND LastNote(1) <> 0 THEN
GOSUB 250
FOR k = 1 TO NumHarmonics
LastNote(k) = Note(k)
NEXT k
Samples = SampleRate * length / BeatsPerSecond
GOSUB 300
GOTO 75
END IF
IF LastNote(1) = 0 AND Note(1) <> 0 THEN
FOR k = 1 TO NumHarmonics
LastNote(k) = Note(k)
NEXT k
Samples = SampleRate * length / BeatsPerSecond
GOSUB 275
GOTO 75
END IF
IF Note(1) <> 0 AND LastNote(1) <> 0 THEN
Samples = SampleRate * length / BeatsPerSecond /
glide
GOSUB 300
Samples = SampleRate * length / BeatsPerSecond
FOR k = 1 TO NumHarmonics
LastNote(k) = Note(k)
NEXT k
GOSUB 300
GOTO 75
END IF
END IF
75 NEXT g
CLOSE #4
END
' *Neat* Silencer -- finishes a wave like 275 starts one.
250
FOR k = 1 TO NumHarmonics
temp = Angle(k) / TwoPi
Angle(k) = (temp - FIX(temp)) * TwoPi
IF Angle(k) > pi * 3 / 2 THEN
TerminalAngle(k) = pi * 3.5
PhaseDir(k) = 1
DropAngle(k) = pi * 2.5
ELSEIF Angle(k) > pi / 2 THEN
TerminalAngle(k) = pi * 2.5
PhaseDir(k) = 0
DropAngle(k) = pi * 3 / 2
ELSE
TerminalAngle(k) = pi * 3 / 2
PhaseDir(k) = -1
DropAngle(k) = pi / 2
END IF
NEXT k
260
FOR k = 1 TO NumHarmonics
Phase(k) = SIN(Angle(k))
SELECT CASE PhaseDir(k)
CASE 1
IF Angle(k) >= DropAngle(k) THEN
Phase(k) = Phase(k) / 2 + .5
END IF
CASE 0
IF Angle(k) >= DropAngle(k) THEN
Phase(k) = Phase(k) / 2 - .5
END IF
CASE -1
IF Angle(k) >= DropAngle(k) THEN
Phase(k) = Phase(k) / 2 + .5
END IF
END SELECT
IF Angle(k) < TerminalAngle(k) THEN
Angle(k) = Angle(k) + Velocity(k)
ELSE
Angle(k) = TerminalAngle(k)
END IF
NEXT k
GOSUB 400
FOR k = 1 TO NumHarmonics
IF Angle(k) < TerminalAngle(k) THEN GOTO 260
NEXT k
FOR k = 1 TO NumHarmonics
Angle(k) = Angle(k) - Angle(k)
NEXT k
RETURN
275
' This starts a wave from zero, using half the amplitude, a start
' from where sin(angle) = -1, and a bias of half. This cuts
' a leading click that I can hear on some equipment with some tunes.
FOR k = 1 TO NumHarmonics
IF part(k) <> 0 THEN
Velocity(k) = TwoPi * LastNote(part(k)) * Harmonics(part(k))
/ SampleRate
Acceleration(k) = (TwoPi * Note(part(k)) *
Harmonics(part(k)) / SampleRate - Velocity(k)) / Samples
ELSE
Velocity(k) = TwoPi * Note(k) * Harmonics(k) / SampleRate
Acceleration(k) = 0
END IF
PhaseDir(k) = 1
Angle(k) = 3 / 2 * pi
NEXT k
280
FOR k = 1 TO NumHarmonics
IF PhaseDir(k) = 1 THEN
Phase(k) = SIN(Angle(k)) / 2 + .5
ELSE
Phase(k) = SIN(Angle(k))
END IF
Angle(k) = Angle(k) + Velocity(k)
Velocity(k) = Velocity(k) + Acceleration(k)
NEXT k
Samples = Samples - 1
GOSUB 400
FOR k = 1 TO NumHarmonics
IF PhaseDir(k) = 1 THEN
Phase(k) = (Phase(k) - .5) * 2
END IF
IF Phase(k) > SIN(Angle(k)) THEN
PhaseDir(k) = -1
END IF
NEXT k
FOR k = 1 TO NumHarmonics
IF PhaseDir(k) = 1 GOTO 280
NEXT k
300
' Calculate constants of change for write loop.
FOR k = 1 TO NumHarmonics
Velocity(k) = TwoPi * LastNote(part(k)) * Harmonics(k) / SampleRate
Acceleration(k) = (TwoPi * Note(part(k)) * Harmonics(k) /
SampleRate - Velocity(k)) / Samples
NEXT k
' Main write loop. Static Phases problem solved at 250.
FOR t = 1 TO Samples
FOR k = 1 TO NumHarmonics
Phase(k) = SIN(Angle(k))
NEXT k
GOSUB 400
FOR k = 1 TO NumHarmonics
Angle(k) = Angle(k) + Velocity(k)
Velocity(k) = Velocity(k) + Acceleration(k)
NEXT k
NEXT t
RETURN
400
' Write a sample.
amp = CINT(Phase(1) * 31700)
PRINT #4, CHR$(amp AND 255);
PRINT #4, CHR$((amp AND 65280) / 256);
amp = CINT(Phase(2) * 31700)
PRINT #4, CHR$(amp AND 255);
PRINT #4, CHR$((amp AND 65280) / 256);
RETURN
' http://ecn.ab.ca/~brewhaha/ BrewJay's Babble Bin
In E!2, 13/7 is about 11 tonesteps, so too far from a tritone, which is
three major seconds (augmented 4th).
I think he means the size in terms of E12 whole-tones, that is, E6
tonesteps. One can find them for an interval r by computing the
continued fraction convergents of 6*log_2 r. (The Wikipedia continued
fractions page has a fast algorithm.)
If I do that for r = 13/7, then 6*log_2(13/7) = 5.3585..., and the
convergents are:
5/1, 11/2, 16/3, 59/11, 75/14, ...
Then 16/3 = 5.3333..., so it is quite close.
Perhaps some microtonal mailing list can help out. A netsearch found this
http://launch.groups.yahoo.com/group/MakeMicroMusic/
Hans
DATA 24,24,8
' Unison.
DATA 48,48,4
' Unison
DATA 60,42,8
' Euler's Tritone
DATA 54,36,4
' Perfect fifth
DATA 48,27,6
' Pythagorean minor seventh
DATA 0,0,3
' Rest. Phrase length: five notes, then a fourth phrase is short.
DATA 21,36,8
' Septimal major sixth
DATA 42,39,4
' 14:13 2/3-tone according to Huygens-Fokker. I do not know what that means.
DATA 54,36,8
' Perfect fifth.
DATA 48,33,4
' Obscure. Undecimal diminished fourth?
DATA 42,30,6
' Septimal tritone
DATA 0,0,3
' Rest.
DATA 19,33,8
' Obscure. Nonadecimal augmented fifth?
DATA 39,36,4
' Tridecimal 2/3-tone
DATA 50,33,8
' Three pentatones
DATA 45,27,4
' Neutral Sixth
DATA 39,24,6
' Tridecimal neutral sixth
DATA 0,0,2
' Rest
DATA 54,48,12
' Major Second
DATA 45,24,12
' Major Seventh
DATA 0,0,3
' Rest for three beats of seventeen beats per second.
DATA 60,21,8
' 20:7 Obscure. Euler's tritone plus an octave.
DATA 54,39,4
' 13:6 Tridecimal 2/3-tone, minus an octave.
DATA 36,36,8
' Unison.
DATA 30,33,4
' 4/5-tone, Ptolemy's second
DATA 27,30,6
' Minor whole tone
DATA 0,0,2
' Rest.
DATA 37,42,12
' Obscure. Reduced fraction.
DATA 25,33,12
' Two pentatones
DATA 0, 0, 3
' Rest
DATA 54,24,8
' Major Ninth
DATA 40,36,4
' Minor whole tone
DATA 33,39,8
' Tridecimal minor third
DATA 30,33,4
' 4/5-tone, Ptolemy's second
DATA 27,27,8
' Unison
DATA 0,0,2
' Rest
DATA 33,48,12
' Undecimal semi-diminished fifth
DATA 0,0,1
' Rest is really for vocals. I hav a three-note glide in mind for two
vowels.
DATA 27,36,12
' Perfect fourth
DATA 0, 0, 3
' Rest
DATA 60,48,8
' Major Third
DATA 48,36,4
' Perfect fourth
DATA 36,42,8
' Septimal Minor Third
DATA 48,48,4
' Gotta hit these things in duets
DATA 54,21,8
' 18:7 Obscure.
DATA 48,24,8
' Octave.
DATA 0,0,34
' Two seconds of rest
OPTION BASE 1
DIM TwoPi AS DOUBLE
DIM pi AS DOUBLE
DIM temp AS DOUBLE
DIM BeatsPerSecond AS DOUBLE
DIM Angle(2) AS DOUBLE
DIM Velocity(2) AS DOUBLE
DIM Acceleration(2) AS DOUBLE
DIM Phase(2) AS DOUBLE
DIM note(2) AS INTEGER
note(k) = 0
LastNote(k) = 0
NEXT k
glide = 30
100
FOR g = 1 TO 47
READ note(1), note(2), length
' IF g > 0 THEN
' SOUND note(2) * 12, length
' END IF
IF test = "0" THEN
IF note(1) = 0 AND LastNote(1) = 0 THEN
Samples = SampleRate * length / BeatsPerSecond
GOSUB 300
GOTO 75
END IF
IF note(1) = 0 AND LastNote(1) <> 0 THEN
GOSUB 250
FOR k = 1 TO NumHarmonics
LastNote(k) = note(k)
NEXT k
Samples = SampleRate * length / BeatsPerSecond
GOSUB 300
GOTO 75
END IF
IF LastNote(1) = 0 AND note(1) <> 0 THEN
FOR k = 1 TO NumHarmonics
LastNote(k) = note(k)
NEXT k
Samples = SampleRate * length / BeatsPerSecond
GOSUB 275
GOTO 75
END IF
IF note(1) <> 0 AND LastNote(1) <> 0 THEN
Samples = SampleRate * length / BeatsPerSecond /
glide
GOSUB 300
Samples = SampleRate * length / BeatsPerSecond
FOR k = 1 TO NumHarmonics
LastNote(k) = note(k)
END
Acceleration(k) = (TwoPi * note(part(k)) *
Harmonics(part(k)) / SampleRate - Velocity(k)) / Samples
ELSE
Velocity(k) = TwoPi * note(k) * Harmonics(k) / SampleRate
Acceleration(k) = (TwoPi * note(part(k)) * Harmonics(k) /
SampleRate - Velocity(k)) / Samples
NEXT k
' Main write loop. Static Phases problem solved at 250.
FOR t = 1 TO Samples
FOR k = 1 TO NumHarmonics
Phase(k) = SIN(Angle(k))
NEXT k
GOSUB 400
FOR k = 1 TO NumHarmonics
Angle(k) = Angle(k) + Velocity(k)
Velocity(k) = Velocity(k) + Acceleration(k)
NEXT k
NEXT t
RETURN
400
' Write a sample.
amp = CINT(Phase(1) * 31700)
PRINT #4, CHR$(amp AND 255);
PRINT #4, CHR$((amp AND 65280) / 256);
amp = CINT(Phase(2) * 31700)
PRINT #4, CHR$(amp AND 255);
PRINT #4, CHR$((amp AND 65280) / 256);
RETURN
' http://ecn.ab.ca/~brewhaha/ Highly Organized Babble
That is usually what goes into naming these things, unless they are off key,
and
harmony jenerally is off key. I know some choir directors mean for "off key"
to mean "out of tune". For me, a difference is between "off key" and "out of
tune".
One can actually be good, if you know what you are doing. In my first post
of this thread, I did not, and I was on the right track.
> One can find them for an interval r by computing the continued fraction
> convergents of 6*log_2 r. (The Wikipedia continued fractions page has a
> fast algorithm.)
>
> If I do that for r = 13/7, then 6*log_2(13/7) = 5.3585..., and the
> convergents are:
> 5/1, 11/2, 16/3, 59/11, 75/14, ...
> Then 16/3 = 5.3333..., so it is quite close.
>
> Perhaps some microtonal mailing list can help out. A netsearch found this
> http://launch.groups.yahoo.com/group/MakeMicroMusic/
I do not think I need anything other than huygens-fokker for a list of
possible aims. When I get into ChucK and Scala (they were on a USB key that
I lost), I think they will do fine for simulating instruments at these
pitches. The point is that 13:7 is a stable harmony, if a dissonant one that
requires a lot of prior context or explanation, and it is definitely off
key -- not that it is impossible that a piano will resonate with it, just
that synthesizers *might* not.
_______
ChucK has a mailing list, too. People on such lists are more likely to
be interested in code than here.
> The point is that 13:7 is a stable harmony, if a dissonant one that
> requires a lot of prior context or explanation, and it is definitely off
> key -- not that it is impossible that a piano will resonate with it, just
> that synthesizers *might* not.
It may depend on the instrument. For example, clarinets are inharmonic
in high and low regions beyond the 7th partial.
http://www.phys.unsw.edu.au/music/clarinet/B4.html
Hans
DATA 16 ,24 , 8
' Perfect Fifth
DATA 32 ,48 , 8
' Perfect Fifth
DATA 40 ,42 , 6
' Minor Semitone
DATA 36 ,36 , 3
' Unison
DATA 32 ,28 , 9
' Septimal Whole Tone
DATA 0 , 0 , 2
' Rest for two beats of fifteen beats per second.
DATA 14 ,36 , 8
' Obscure 18:7
DATA 28 ,40 , 8
' Euler's Tritone
DATA 36 ,36 , 6
' Unison
DATA 32 ,32 , 3
' Unison
DATA 28 ,28 , 9
' Unison
DATA 0 , 0 , 2
' Rest
DATA 13 ,34 , 8
' Obscure 34:13
DATA 26 ,36 , 8
' Tridecimal Augmented Fourth
DATA 34 ,34 , 6
' Unison
DATA 30 ,28 , 3
' Major Diatonic Semitone
DATA 26 ,24 , 9
' Tridecimal 2/3-tone.
DATA 0 , 0 , 2
' Rest
DATA 36 ,48 , 12
' Perfect Fifth
DATA 30 ,24 , 12
' Major Third
DATA 0 , 0 , 3
' Rest
DATA 40 ,22 , 8
' Large Minor Seventh
DATA 36 ,40 , 8
' Minor Whole Tone
DATA 24 ,36 , 4
' Perfect Fifth
DATA 20 ,34 , 3
' Septendecimal Diminished Seventh
DATA 18 ,30 , 8
' Small Ninth
DATA 24 ,42 ,15
' Obscure 21:12
DATA 16 ,32 ,12
' Octave
DATA 0 , 0 , 3
' Rest
DATA 36 ,24 , 8
' Perfect Fifth
DATA 26 ,36 , 8
' Tridecimal Augmented Fourth
DATA 22 ,40 , 4
' Large Minor Seventh
DATA 20 ,34 , 3
' Septendecimal Diminished Seventh
DATA 18 ,28 , 8
' Septimal Minor Sixth
DATA 22 ,48 ,15
' Obscure 24:11
DATA 18 ,36 ,12
' Octave
DATA 0 , 0 , 3
' Rest
DATA 40 ,48 , 8
' Minor Third
DATA 32 ,36 , 8
' Major Second
DATA 24 ,42 , 4
' Obscure 21:12
DATA 32 ,48 , 3
' Perfect Fifth
DATA 36 ,22 , 8
' Undecimal Neutral Sixth
DATA 32 ,24 , 8
' Perfect Fourth
DATA 0 , 0 ,34
' Two Seconds of Rest
OPTION BASE 1
DIM TwoPi AS DOUBLE
DIM pi AS DOUBLE
DIM temp AS DOUBLE
DIM BeatsPerSecond AS DOUBLE
DIM Angle(2) AS DOUBLE
DIM Velocity(2) AS DOUBLE
DIM Acceleration(2) AS DOUBLE
DIM Phase(2) AS DOUBLE
DIM note(2) AS INTEGER
DIM LastNote(2) AS INTEGER
DIM length AS INTEGER
DIM Harmonics(2) AS SINGLE
DIM Samples AS LONG
DIM t AS LONG
DIM SampleRate AS LONG
DIM k AS INTEGER
DIM g AS INTEGER
DIM amp AS INTEGER
DIM basis AS INTEGER
DIM NumHarmonics AS INTEGER
DIM part(2) AS INTEGER
DIM Sign(2) AS INTEGER
DIM glide AS INTEGER
DIM test AS STRING
DIM TerminalAngle(2) AS DOUBLE
DIM DropAngle(2) AS DOUBLE
DIM PhaseDir(2) AS DOUBLE
PRINT
test = "0"
' I frequently flip that.
NumHarmonics = 2
BeatsPerSecond = 15#
pi = 3.141592653589793#
TwoPi = pi * 2
SampleRate = 12000
LastNote(1) = 0
LastNote(2) = 0
' The following code must be customized for where your "Sound Exchange"
' and FreeBasic, FirstBasic, or QBASIC is installed.
OPEN "alfabet.bat" FOR OUTPUT AS #1
OPEN "\sox\alfabet.raw" FOR OUTPUT AS #4
PRINT #1, "e:\progra~1\freebasic\fbc -lang qb d:\basic\alfabet.bas"
PRINT #1, "alfabet.exe"
PRINT #1, "cd \sox"
PRINT #1, "sox -c 2 -r"; SampleRate; " -sw alfabet.raw alfabet.wav stat"
CLOSE #1, #2
FOR k = 1 TO NumHarmonics
READ part(k), Harmonics(k)
note(k) = 0
LastNote(k) = 0
NEXT k
' OPEN "alfabet.bas" FOR APPEND AS #2
' Enable that if you want to make basis frequencies in each channel equal.
glide = 30
100
' Here starts the main loop, counting notes.
FOR g = 1 TO 44
READ note(1), note(2), length
' PRINT USING "DATA ##,##,##"; cint(note(1) / 3); cint(note(2) / 2);
length;
' That is for feeding global changes back into this code.
' The trend for my hand calculations is to raise numbers,
' and with a little tweaking, the lower numbers often work.
' IF g > 0 THEN
' SOUND note(1) * 5, length
' I tend to hear at 2:1 above that, unless they are pure sine waves.
' IF note(2) <> 0 THEN
' PRINT note(2) / note(1);
' END IF
' END IF
IF test = "0" THEN
IF note(1) = 0 AND LastNote(1) = 0 THEN
Samples = SampleRate * length / BeatsPerSecond
GOSUB 300
GOTO 75
END IF
IF note(1) = 0 AND LastNote(1) <> 0 THEN
GOSUB 250
FOR k = 1 TO NumHarmonics
LastNote(k) = note(k)
NEXT k
Samples = SampleRate * length / BeatsPerSecond
GOSUB 300
GOTO 75
END IF
IF LastNote(1) = 0 AND note(1) <> 0 THEN
FOR k = 1 TO NumHarmonics
LastNote(k) = note(k)
NEXT k
Samples = SampleRate * length / BeatsPerSecond
GOSUB 275
GOTO 75
END IF
IF note(1) <> 0 AND LastNote(1) <> 0 THEN
Samples = SampleRate * length / BeatsPerSecond /
glide
GOSUB 300
Samples = SampleRate * length / BeatsPerSecond
FOR k = 1 TO NumHarmonics
LastNote(k) = note(k)
NEXT k
GOSUB 300
GOTO 75
END IF
END IF
75 NEXT g
CLOSE #4
END
' *Neat* Silencer -- finishes a wave like 275 starts one.
' When a wave peaks, then it is biased by half and the amplitude drops to
half.
' An error is probably in it, because it does not always work -- something
to do
' with the difference betweeen > and >=.
' A line break should not be above.
Acceleration(k) = (TwoPi * note(part(k)) *
Harmonics(part(k)) / SampleRate - Velocity(k)) / Samples
' No line break.
ELSE
Velocity(k) = TwoPi * note(k) * Harmonics(k) / SampleRate
Acceleration(k) = (TwoPi * note(part(k)) * Harmonics(k) /
SampleRate - Velocity(k)) / Samples
' NLB.
' I've never spent so much time on a duet, before.
' Left Part, basis frequency, Right Part, basis frequency.
DATA 1,9,2,9
' If you like tube distortion, chorusing, and reverb,
' then wait for my video. I make dry signal available for
' performance in person. You can fix it up, and please
' do not release recordings to anyone but me.
' Part 1, Part 2 -- normally left and right, but easily exchangable.
DATA 16 ,24 , 8
' Perfect Fifth
DATA 32 ,48 , 8
' Perfect Fifth
DATA 40 ,42 , 6
' Minor Semitone
DATA 35 ,35 , 3
' Unison
DATA 32 ,28 , 9
' Septimal Whole Tone
DATA 0 , 0 , 2
' Rest for two beats of fifteen beats per second.
DATA 14 ,36 , 8
' Obscure 18:7
DATA 28 ,40 , 8
' Euler's Tritone
DATA 36 ,36 , 6
' Unison
DATA 32 ,32 , 3
' Unison
DATA 28 ,28 , 9
' Unison
DATA 0 , 0 , 2
' Rest
DATA 12 ,32 , 8
' Perfect Eleventh
DATA 24 ,36 , 8
' Perfect Fifth
DATA 32 ,32 , 6
' Unison
DATA 30 ,27 , 3
' Minor Second
DATA 24 ,24 , 9
' Unison
DATA 0 , 0 , 2
' Rest. I was not singing that last phrase,
' and harmony works better this way, so I will learn it.
DATA 36 ,48 , 12
' Perfect Fifth
DATA 30 ,24 , 12
' Major Third
DATA 0 , 0 , 3
' Rest
DATA 40 ,21 , 8
' Acute Major Seventh
DATA 36 ,36 , 8
' Unison
DATA 24 ,32 , 4
' Perfect Fourth
DATA 20 ,30 , 3
' Perfect Fifth
DATA 18 ,27 , 8
' Perfect Fifth
DATA 24 ,40 ,15
' Major Sixth
DATA 16 ,30 ,12
' Classic Major Seventh
DATA 0 , 0 , 3
' Rest
DATA 36 ,24 , 8
' Perfect Fifth
DATA 27 ,36 , 8
' Perfect Fourth
DATA 22 ,40 , 4
' Large Minor Seventh
DATA 20 ,33 , 3
' Obscure 33:20 (Augmented undecimal fifth?)
DATA 18 ,27 , 8
' Perfect Fifth
DATA 22 ,48 ,15
' Obscure 24:11 (Augmented undecimal octave?)
DATA 18 ,36 ,12
' Octave
DATA 0 , 0 , 3
' Rest
DATA 40 ,48 , 8
' Minor Third
DATA 32 ,36 , 8
' Major Second
DATA 24 ,42 , 4
' Jazz Seventh
DATA 32 ,48 , 3
' Perfect Fifth
DATA 36 ,21 , 8
' Septimal Major Sixth
DATA 32 ,24 , 8
' Perfect Fourth
DATA 0 , 0 ,30
' Two Seconds of Rest
' snip source that is essentially the same, except for the following line:
' PRINT #2, USING "DATA ##-,##-,##"; cint(note(1)/2);cint(note(2)/2);
length
' That is for feeding experiments with basis frequencies back into this
code,
' commented out again once the job is done.
' Other than that, channel one and four are an octave higher than in
' duets previously in this thread, and my basis frequency is less than
' half, so no *practical* change to the first two parts. The vocals won't
' be at http://ecn.ab.ca/~brewhaha/Sound/Kompleet_Ingglish_Alfabet.mp3
' for at least three and perhaps seventy two hours. In the meantime,
' it will be at 18kbps, and synth only.
' Data: Left Part, Middle parts, Right Part, Length...
DATA 0, 0, 0, 0, 2
DATA 36, 36, 36, 54, 8
DATA 72, 24, 24, 108, 8
DATA 90, 30, 30, 96, 6
DATA 80, 27, 27, 80, 3
DATA 72, 24, 24, 64, 8
DATA 0, 0, 0, 0, 2
DATA 32, 32, 32, 80, 8
DATA 64, 21, 21, 84, 8
DATA 80, 27, 27, 80, 6
DATA 72, 24, 24, 72, 3
DATA 64, 21, 21, 64, 8
DATA 0, 0, 0, 0, 2
DATA 28, 28, 28, 72, 8
DATA 57, 19, 19, 80, 8
DATA 72, 24, 24, 72, 6
DATA 64, 21, 21, 60, 3
DATA 57, 19, 19, 57, 8
DATA 0, 0, 0, 0, 2
DATA 80, 33, 33, 108, 12
DATA 64, 27, 27, 54, 12
DATA 0, 0, 0, 0, 4
DATA 90, 30, 30, 48, 8
DATA 80, 33, 33, 80, 8
DATA 54, 36, 36, 72, 4
DATA 44, 33, 33, 66, 4
DATA 40, 30, 30, 60, 9
DATA 54, 36, 36, 90, 16
DATA 36, 30, 33, 66, 8
DATA 0, 0, 0, 0, 8
DATA 80, 27, 27, 54, 8
DATA 60, 30, 30, 80, 8
DATA 50, 33, 33, 90, 4
DATA 44, 30, 30, 72, 4
DATA 40, 27, 27, 60, 9
DATA 48, 33, 33, 108, 16
DATA 40, 27, 27, 80, 8
DATA 0, 0, 0, 0, 8
DATA 90, 30, 30, 108, 8
DATA 72, 33, 33, 80, 8
DATA 54, 37, 37, 96, 4
DATA 72, 30, 30, 108, 4
DATA 80, 22, 22, 48, 8
DATA 72, 30, 30, 54, 8
DATA 0, 0, 0, 0, 30
OPTION BASE 1
DIM TwoPi AS DOUBLE
DIM pi AS DOUBLE
DIM Temp AS DOUBLE
DIM BeatsPerSecond AS DOUBLE
DIM Angle(4) AS DOUBLE
DIM Velocity(4) AS DOUBLE
DIM Acceleration(4) AS DOUBLE
DIM Phase(4) AS DOUBLE
DIM note(4) AS INTEGER
DIM LastNote(4) AS INTEGER
DIM length AS INTEGER
DIM Harmonics(4) AS SINGLE
DIM Samples AS LONG
DIM t AS LONG
DIM SampleRate AS LONG
DIM k AS INTEGER
DIM g AS INTEGER
DIM amp AS INTEGER
DIM basis AS INTEGER
DIM numharmonics AS INTEGER
DIM part(4) AS INTEGER
DIM Sign(4) AS INTEGER
DIM glide AS INTEGER
DIM GlideTrim AS LONG
DIM test AS STRING
DIM TerminalAngle(4) AS DOUBLE
DIM DropAngle(4) AS DOUBLE
DIM PhaseDir(4) AS DOUBLE
PRINT
test = "0"
' I frequently flip that.
numharmonics = 4
BeatsPerSecond = 15#
pi = 3.141592653589793#
TwoPi = pi * 2
SampleRate = 8000
FOR k = 1 TO numharmonics
LastNote(k) = 0
NEXT k
IF test = "0" THEN
OPEN "alfabet.bat" FOR OUTPUT AS #1
OPEN "\sox\alfabet1.raw" FOR OUTPUT AS #4
OPEN "\sox\alfabet2.raw" FOR OUTPUT AS #5
OPEN "\sox\alfabet3.raw" FOR OUTPUT AS #6
PRINT #1, "e:\progra~1\freebasic\fbc -lang qb d:\basic\alfabet.bas"
PRINT #1, "alfabet.exe"
PRINT #1, "cd \sox"
PRINT #1, "sox -c 2 -r"; SampleRate; " -sw alfabet1.raw alfabet1.wav
stat"
PRINT #1, "pause"
PRINT #1, "sox -c 1 -r"; SampleRate; " -sw alfabet2.raw alfabet2.wav
stat"
PRINT #1, "pause"
PRINT #1, "sox -c 2 -r"; SampleRate; " -sw alfabet3.raw alfabet3.wav
stat"
CLOSE #1, #2
END IF
FOR k = 1 TO numharmonics
READ part(k), Harmonics(k)
note(k) = 0
LastNote(k) = 0
NEXT k
' OPEN "alfabet.bas" FOR APPEND AS #2
glide = 30
100
FOR g = 1 TO 45
READ note(1), note(2), note(3), note(4), length
' PRINT #2, USING "DATA ##-,##-,##-,###-,##"; CINT(note(1));
CINT(note(2));
CINT(note(3)); CINT(note(4) * 2); length
' That is for feeding global changes back into this code.
' The trend for my hand calculations is to raise numbers,
' and with a little tweaking, lower numbers often work.
' IF g > 0 THEN
' SOUND note(2) * 4, length
' I tend to hear at 2:1 above that, unless they are pure sine waves.
' IF note(2) <> 0 THEN
' PRINT note(2) / note(1);
' END IF
' END IF
IF test = "0" THEN
IF note(1) = 0 AND LastNote(1) = 0 THEN
Samples = SampleRate * length / BeatsPerSecond
GOSUB 300
GOTO 75
END IF
IF note(1) = 0 AND LastNote(1) <> 0 THEN
GOSUB 250
FOR k = 1 TO numharmonics
LastNote(k) = note(k)
NEXT k
Samples = SampleRate * length / BeatsPerSecond
GOSUB 300
GOTO 75
END IF
IF LastNote(1) = 0 AND note(1) <> 0 THEN
FOR k = 1 TO numharmonics
LastNote(k) = note(k)
NEXT k
Samples = SampleRate * length / BeatsPerSecond
GOSUB 275
GOTO 75
END IF
IF note(1) <> 0 AND LastNote(1) <> 0 THEN
Samples = SampleRate * length / BeatsPerSecond /
glide
GlideTrim = Samples
GOSUB 300
Samples = SampleRate * length / BeatsPerSecond -
GlideTrim
FOR k = 1 TO numharmonics
LastNote(k) = note(k)
NEXT k
GOSUB 300
GOTO 75
END IF
END IF
75 NEXT g
CLOSE #4
END
' *Neat* Silencer -- finishes a wave like 275 starts one.
' When it reaches a peak or a trough, then it cuts amplitude in half
' and biases it by half.
250
FOR k = 1 TO numharmonics
Temp = Angle(k) / TwoPi
Angle(k) = (Temp - FIX(Temp)) * TwoPi
IF Angle(k) > pi * 3 / 2 THEN
TerminalAngle(k) = pi * 3.5
PhaseDir(k) = 1
DropAngle(k) = pi * 2.5
ELSEIF Angle(k) > pi / 2 THEN
TerminalAngle(k) = pi * 2.5
PhaseDir(k) = 0
DropAngle(k) = pi * 3 / 2
ELSE
TerminalAngle(k) = pi * 3 / 2
PhaseDir(k) = -1
DropAngle(k) = pi / 2
END IF
NEXT k
260
FOR k = 1 TO numharmonics
Phase(k) = SIN(Angle(k))
SELECT CASE PhaseDir(k)
CASE 1
IF Angle(k) >= DropAngle(k) THEN
Phase(k) = Phase(k) / 2 + .5
END IF
CASE 0
IF Angle(k) >= DropAngle(k) THEN
Phase(k) = Phase(k) / 2 - .5
END IF
CASE -1
IF Angle(k) >= DropAngle(k) THEN
Phase(k) = Phase(k) / 2 + .5
END IF
END SELECT
IF Angle(k) < TerminalAngle(k) THEN
Angle(k) = Angle(k) + Velocity(k)
ELSE
Angle(k) = TerminalAngle(k)
END IF
NEXT k
GOSUB 400
FOR k = 1 TO numharmonics
IF Angle(k) < TerminalAngle(k) THEN GOTO 260
NEXT k
FOR k = 1 TO numharmonics
Angle(k) = Angle(k) - Angle(k)
NEXT k
RETURN
275
' This starts a wave from zero, using half the amplitude, a start
' from where sin(angle) = -1, and a bias of half. This cuts
' a leading click that I can hear on some equipment with some tunes.
FOR k = 1 TO numharmonics
IF part(k) <> 0 THEN
Velocity(k) = TwoPi * LastNote(part(k)) * Harmonics(part(k))
/ SampleRate
Acceleration(k) = (TwoPi * note(part(k)) *
Harmonics(part(k)) / SampleRate
- Velocity(k)) / Samples
ELSE
Velocity(k) = TwoPi * note(k) * Harmonics(k) / SampleRate
Acceleration(k) = 0
END IF
PhaseDir(k) = 1
Angle(k) = 3 / 2 * pi
NEXT k
280
FOR k = 1 TO numharmonics
IF PhaseDir(k) = 1 THEN
Phase(k) = SIN(Angle(k)) / 2 + .5
ELSE
Phase(k) = SIN(Angle(k))
END IF
Angle(k) = Angle(k) + Velocity(k)
Velocity(k) = Velocity(k) + Acceleration(k)
NEXT k
Samples = Samples - 1
GOSUB 400
FOR k = 1 TO numharmonics
IF PhaseDir(k) = 1 THEN
Phase(k) = (Phase(k) - .5) * 2
END IF
IF Phase(k) > SIN(Angle(k)) THEN
PhaseDir(k) = -1
END IF
NEXT k
FOR k = 1 TO numharmonics
IF PhaseDir(k) = 1 GOTO 280
NEXT k
300
' Calculate constants of change for write loop.
FOR k = 1 TO numharmonics
Velocity(k) = TwoPi * LastNote(part(k)) * Harmonics(k) / SampleRate
Acceleration(k) = (TwoPi * note(part(k)) * Harmonics(k) /
SampleRate - Velocity(k))
/ Samples
NEXT k
' Main write loop. Static Phases problem solved at 250.
FOR t = 1 TO Samples
FOR k = 1 TO numharmonics
Phase(k) = SIN(Angle(k))
NEXT k
GOSUB 400
FOR k = 1 TO numharmonics
Angle(k) = Angle(k) + Velocity(k)
Velocity(k) = Velocity(k) + Acceleration(k)
NEXT k
NEXT t
RETURN
400
' Write a sample.
' Stereo of all three parts.
amp = CINT(Phase(1) * -21600 + Phase(2) * -10800)
PRINT #4, CHR$(amp AND 255);
PRINT #4, CHR$((amp AND 65280) / 256);
amp = CINT(Phase(3) * 10800 + Phase(4) * 21600)
PRINT #4, CHR$(amp AND 255);
PRINT #4, CHR$((amp AND 65280) / 256);
' Mono of middle part.
amp = CINT(Phase(2) * 32700)
PRINT #5, CHR$(amp AND 255);
PRINT #5, CHR$((amp AND 65280) / 256);
' Stereo of parts one and four.
amp = CINT(Phase(1) * 32700)
PRINT #6, CHR$(amp AND 255);
PRINT #6, CHR$((amp AND 65280) / 256);
amp = CINT(Phase(4) * 32700)
PRINT #6, CHR$(amp AND 255);
PRINT #6, CHR$((amp AND 65280) / 256);
RETURN
' Subject-Was: A More Kompleet (and less redundant) Ingglish Alfabet Song in
Trio Harmony
' Reading is synesthesia. To connect sound and sight is to
' use two senses together. So, synesthesia can be induced,
' and you are an exhibit, unless something or someone is
' voicing this for you, uh, even then if someone is talking
' about tastes you remember.
' I wrote* all of my videos to date for: teaching phonics by
' inducing synesthesia. The hard part of doing that is to
' make video as interesting as possible, and systematic colour
' probably helps, because examples of synesthesia in a
' wikipedia article are about unprinted colours in text,
' which synesthetes see. Synesthesia can be induced, and
' "Sesame Street" has been proving that for a long time:
' Reading is synesthesia.
' * ,with curves and shaded fills,
' http://ecn.ab.ca/~brewhaha/font/Kompleet_Ingglish_Alfabet.wmv
' (1.033Mb/s).
' That full-screen version will change to become more like
' karaoke, displaying twelve glyphs at once, and zipping
' saturation (colour purity) for timing.
' http://ecn.ab.ca/~brewhaha/font/Kompleet_Ingglish_Alfabet_LR.wmv
' That is an 80x60 at 48kb/s, which will not change until I re-write
' the tune with three contrasting instruments.
' -CC- Released in a creative commons.
' -BY- Attribution required wherever you can see my work in yours.
' - - I do not care where this goes, how it gets there, or
' what it is associated with in the process, as long as it is intact.
' This http://ecn.ab.ca/~brewhaha/finance/CC-BY-ND.wmv
' should travel with it wherever text does not.
' -ND- Recordings are mine. Performance is not.
' left part, basis frequency, right part, fundamental frequency...
DATA 1,4,2,4,3,4,4,4
' It went to a three part mixed solo with chaynjez in timing,
' then I noticed some one-off errors. In particular, some fifty-sevens
' (instead of fifty-sixes) relate to nineteen at a tritave, the
' harmonic that probably gave the hammond B3 its name.
' Other than that, channel one and four are an octave higher than in
' duets previously in this thread, and my basis frequency is half,
' so no *practical* change to the first two parts.
' I will delete a recording at:
' http://ecn.ab.ca/~brewhaha/Sound/Kompleet_Ingglish_Alfabet.mp3 ,
' because two wmvs make it redundant.
' Data: Left Part, Middle parts, Right Part, Length...
' I am not naming all of my jumps and concert ratios, this time.
' If you like one of my triads, then quote it, and only that line,
' and I will tell you how (or if) you can get it on a western staff.
DATA 36, 32, 32, 64, 8
END
Samples
NEXT k
GOSUB 400
' http://ecn.ab.ca/~brewhaha/font/ Phonics
Er, no. Not synaesthesia, memory.
See this study by the Brain and Creativity Institute at the University of
SoCal in LA:
http://www.nature.com/neuro/journal/vaop/ncurrent/full/nn.2533.html#/
Reading, like imaging sounds when you watch a silent movie or the TV with
the sound off, works by the same principle and is reliant upon you having
heard, and learnt, the sound-visual combination beforehand. That's what we
do when we learn to read, we learn all the sound-visual combinations and the
rules so we can also decipher words we've never seen before. And for this
reason we don't hear anything in our mind's ear (except maybe a
stereotypical pastiche) when we see things written in unfamiliar scripts.
Fiona
Okay, so the article is about measuring synesthesia with Physics, by
classifying visual materials, and measuring how a subject's imajination
would fill in a blank; video only: Measure auditory cortical activity. Do
different classes of video yield anything predictable on a scan?
Memory is for cinnamon, and readers will connect first the package, or
someone's vocalization of the name. After that, whenever such a reader sees
"cinnamon", they can remember that it is brown and goes with apples,
oatmeal, and brown sugar. So, here you would be connecting senses. Seeing
the word evokes a vague memory of a taste. Hearing "cinnamon" does the same
thing.
Synesthesia is a connection between senses. In my example, three. To see
"cinnamon" evokes both a sound and memory of a taste. So, amid recent
publicity, I see that at some point associations (orijinally raised in a
Pavlovian manner) can be distracting, so the difference is how intensely
"red" reminds you of blood, traffic lights, and strawberries.
An introspective demonstration is somewhere illustrating that verbal
connections can be more powerful than actuality. IOW, if I paint the word
"red" with blue, then you will take longer to name how it is actually
coloured than to decode letters. I did not learn what that effect is called,
so I do not know where to look it up. I could re-create it with HTML.
_______
Sheesh. It's not about synesthesia at all.
Fiona
If it were not about a connection between senses,
then they would not be scanning auditory cortex
while stimulating visual cortex.
I unsnipped:
>> classifying visual materials, and measuring how a subject's imajination
>> would fill in a blank; video only: Measure auditory cortical activity. Do
>> different classes of video yield anything predictable on a scan?
>>
>> Memory is for cinnamon, and readers will connect first the package, or
>> someone's vocalization of the name. After that, whenever such a reader
>> sees "cinnamon", they can remember that it is brown and goes with apples,
>> oatmeal, and brown sugar. So, here you would be connecting senses. Seeing
>> the word evokes a vague memory of a taste. Hearing "cinnamon" does the
>> same thing.
>> Synesthesia is a connection between senses. In my example, three. To see
>> "cinnamon" evokes both a sound and memory of a taste. So, amid recent
>> publicity, I see that at some point associations (orijinally raised in a
>> Pavlovian manner) can be distracting, so the difference is how intensely
>> "red" reminds you of blood, traffic lights, and strawberries.
>> An introspective demonstration is somewhere illustrating that verbal
>> connections can be more powerful than actuality. IOW, if I paint the word
>> "red" with blue, then you will take longer to name how it is actually
>> coloured than to decode letters. I did not learn what that effect is
>> called, so I do not know where to look it up. I could re-create it with
>> HTML.
_______
http://ecn.ab.ca/~brewhaha/font/ Phonics
Ninety percent of art in teaching reading lies in a teacher reading it
first.
--Brenda Thompson, Reading Success, P.109, (tersened).