electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » Lunettas - circuits inspired by Stanley Lunetta
Counter/dividers and the circle of fifths [edit: fourths!]
Post new topic   Reply to topic Moderators: mosc
Page 1 of 1 [24 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
trav



Joined: Sep 11, 2012
Posts: 70
Location: Auckland
Audio files: 14

PostPosted: Tue Feb 26, 2013 6:04 pm    Post subject: Counter/dividers and the circle of fifths [edit: fourths!] Reply with quote  Mark this post and the followings unread

I have been brainstorming today about generating musical intervals with logic chips. I think I am correct in saying that if you divide the frequency of an audio signal by three you obtain the musical fifth of the original note. [edit: whoops! actually it's the fourth; see below] So if you put in a C you'll get out a G [edit: F, actually] two octaves down. If you chain these together you start walking around the circle of fifths [edit: fourths], so, say you put in C8 and chain a few divide-by-three circuits together, you'd get:

C8 -> G6 -> D5 -> A3 -> E2

[edit: should be, starting instead on E8:
E8 -> A6 -> D5 -> G3 -> C2]

then divide each of the higher-frequency signals by the appropriate power of 2 to get them all into the same octave, rearrange them, and you can get a pentatonic scale:

major: C D E G A
minor: A C D E G

there's your top-octave pentatonic scale, and if you started with a high enough frequency you can divide by further powers of two to get the octaves below.

I am waiting on the chips to breadboard this, but how does the theory sound? It seems neater to me than tuning individual oscillators to achieve the same result.

Last edited by trav on Sun Mar 10, 2013 1:03 pm; edited 2 times in total
Back to top
View user's profile Send private message
trav



Joined: Sep 11, 2012
Posts: 70
Location: Auckland
Audio files: 14

PostPosted: Fri Mar 01, 2013 1:31 am    Post subject: Reply with quote  Mark this post and the followings unread

I scraped together enough chips to try out two chained divide-by-three counters and got encouraging results. In the recording the first group of three notes is the raw chain, the second group brings them within the same octave.

I am already at a fairly high chip-count: a NAND for the osc, a BCD and an AND for the divide-by-threes, and a divider to bring the higher frequencies down. I'll have a think about designing it better; perhaps rigging the BCD as a divide-by-six will help... Good to discover that the principle is sound, though; and I think it is simpler than trying to fine-tune musical intervals. A good way to learn about just intonation too!


fifths1.mp3
 Description:

Download
 Filename:  fifths1.mp3
 Filesize:  351.38 KB
 Downloaded:  159 Time(s)

Back to top
View user's profile Send private message
Uncle Krunkus
Moderator


Joined: Jul 11, 2005
Posts: 4759
Location: Sydney, Australia
Audio files: 52
G2 patch files: 1

PostPosted: Fri Mar 01, 2013 3:04 am    Post subject: Reply with quote  Mark this post and the followings unread

Really good work trav.
What you're basically doing is re-creating a Top Octave Generator similar to those found in old organs, but the whole thing can be simplified, as you've shown, by just extracting the pentatonic scale, rather than a whole chromatic octave, as the TOG does.
It should be relativly easy to tune the high frequency clock up or down by say 3-4 semitones, and then everything could be within easy reach, without the 20 or so chips needed to replicate a TOG, and you've built in more flexibility at the same time. Cool

_________________
What makes a space ours, is what we put there, and what we do there.
Back to top
View user's profile Send private message Visit poster's website
trav



Joined: Sep 11, 2012
Posts: 70
Location: Auckland
Audio files: 14

PostPosted: Sat Mar 02, 2013 2:15 am    Post subject: Reply with quote  Mark this post and the followings unread

of course, dividing by three and then dividing by three again is the same as dividing by nine, which got me thinking...

I did some more math and figured that in order to generate the five notes of a major pentatonic scale I needed to divide the high frequency clock by 64, 72, 81, 48, and 54, respectively. I noticed each of these has either 8 or 9 as a factor:

64 = 8 * 8
72 = 8 * 9
81 = 9 * 9
48 = 8 * 6
54 = 9 * 6

so, for example, I can generate the first note of the scale by sending the signal through a divide-by-eight and then on to another divide-by-eight. This keeps the number of chips low, since I can do the divide-by-eight and divide-by nine first, then divide once more for each note. That's 7 dividers: I can get that from four 4518s, with one divider left over to get the sub-octaves. The only other chips required will be some simple logic to get division by 6 and 9 out of the BCDs, and something for the high freq oscillator.
Back to top
View user's profile Send private message
trav



Joined: Sep 11, 2012
Posts: 70
Location: Auckland
Audio files: 14

PostPosted: Sat Mar 02, 2013 4:52 am    Post subject: Reply with quote  Mark this post and the followings unread

Here is a diagram of what I am talking about. 1 signal + 7 dividers = a pentatonic top octave.

Now, that is a lot of division: I wonder what the initial frequency will have to be... I was thinking of just having a pot to adjust the frequency, maybe a slider that I can use to "bend" to the in-between notes by ear.


fifths_dividers.png
 Description:
 Filesize:  7.76 KB
 Viewed:  6332 Time(s)

fifths_dividers.png


Back to top
View user's profile Send private message
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 20518
Location: The Netherlands, Enschede
Audio files: 147
G2 patch files: 318

PostPosted: Sat Mar 02, 2013 5:40 am    Post subject: Reply with quote  Mark this post and the followings unread

Was thinking that the odd numbered divisions tend to give a pulse instead of a square wave (i.e. less than 50% pulse width) so it may need post division by two to square the signal up ... anyway, something to look into for a practical realisation.

Then I thought why not use rate multipliers (like http://www.datasheetcatalog.org/datasheets/105/109353_DS.pdf for instance) ... but these work with pulse skipping .. so that would be a musical disaster Embarassed

Anyway, this is an interesting project.

_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
PHOBoS



Joined: Jan 14, 2010
Posts: 1687
Location: Moon Base
Audio files: 344

PostPosted: Sat Mar 02, 2013 5:41 am    Post subject: Reply with quote  Mark this post and the followings unread

great, I have been thinking about this for a while, that is taking a high frequency and dividing it down. I was personally thinking of doing
this with a PIC, But it's nice if you can do it with a handful of chips too. I don't know enough about scales and intervals yet, so for now
I just watch you do it Wink

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/ http://www.acidtrash.com/ Stickney Synthyards
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
cbm



Joined: Oct 25, 2005
Posts: 381
Location: San Francisco

PostPosted: Sat Mar 02, 2013 12:21 pm    Post subject: Reply with quote  Mark this post and the followings unread

Unless I'm missing something, this is not going to give equal-tempered results.
_________________
Chris Muir
http://www.eardrill.com <– My jobby (more than a hobby, less than a job)
Back to top
View user's profile Send private message Visit poster's website
richardc64



Joined: Jun 01, 2006
Posts: 614
Location: NYC
Audio files: 25

PostPosted: Sat Mar 02, 2013 2:43 pm    Post subject: Reply with quote  Mark this post and the followings unread

Seems like a lot of hardware for a pentatonic scale.

I was unable to find the post the circuit below came from. Basically, it was twelve such circuits to replace the 50240 top octave generator. Built 5 of 'em and there's your pentatonics, all in the same octave, and all of them square waves.


TOGSchematics1.jpg
 Description:
 Filesize:  92.97 KB
 Viewed:  230 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

TOGSchematics1.jpg



_________________
"I am endeavoring, ma'am, to create a mnemonic memory circuit... using stone
knives and bearskins." -- Spock to Edith Keeler
Back to top
View user's profile Send private message Visit poster's website
trav



Joined: Sep 11, 2012
Posts: 70
Location: Auckland
Audio files: 14

PostPosted: Sat Mar 02, 2013 6:13 pm    Post subject: Reply with quote  Mark this post and the followings unread

Yes 12-tone equal temperament has been done, and more elegantly. Thanks for that diagram, richardc64: very useful. The huge divisions are are why I've limited myself to 5 notes. I figure I can make this with just six chips, which I don't think is bad at all.

Rather than a rigorous TOG this is more of an experiment in just intonation and whether a few musical notes can be obtained by ruthlessly applying the same primitive (divide the frequency by three to get the next note)
Back to top
View user's profile Send private message
Uncle Krunkus
Moderator


Joined: Jul 11, 2005
Posts: 4759
Location: Sydney, Australia
Audio files: 52
G2 patch files: 1

PostPosted: Sat Mar 02, 2013 10:35 pm    Post subject: Reply with quote  Mark this post and the followings unread

Great thread this is turning out to be. Very Happy
_________________
What makes a space ours, is what we put there, and what we do there.
Back to top
View user's profile Send private message Visit poster's website
trav



Joined: Sep 11, 2012
Posts: 70
Location: Auckland
Audio files: 14

PostPosted: Sun Mar 10, 2013 2:20 am    Post subject: Reply with quote  Mark this post and the followings unread

So I was thinking about how to "play" these notes. Originally I thought I'd just have the keys gate the signal, which would give me polyphony too. Then I realized if I used the key press to select the appropriate divisions I could cut down the number of dividers needed, although I'd lose polyphony, since I wasn't doing all of the divisions all of the time. A worthwhile sacrifice, though, I told myself after spending quite some time failing to debug an overloaded breadboard.

First I chained two dividers: the first one divided by either 8 or 9, the second by either 6, 8, or 9. By cycling through the permutations I got my five tones. This cut the chip-count down to 3, but it required 2-pole switches to select the right combination of divisions for each note.

I went back and had a look at the ratios in the Just Diatonic scale:

C = 1
D = 9/8
E = 5/4
F = 4/3
G = 3/2
A = 5/3
B = 15/18
C = 2

I'm only interested in C D E G A. I took those ratios and divided through by 10 to get:

C = 1/10
D = 9/80
E = 1/8
G = 3/20
A = 1/6
C = 1/5

well, 9/80 is pretty close to 9/81 = 1/9. It's not so easy to turn 3/20 into 3/21 = 1/7, but when I saw that I could twist the above to get the following:

C = 1/10
D = 1/9
E = 1/8
G = 1/7
A = 1/6
C = 1/5

I saw something that I could easily rig up with a single BCD and a few AND gates. I've attached two recordings of me poking around the breadboard. In the first recording you can hear that the G is indeed flat and a bit nasty; but the D sounds good to my ear (I double-tap the D and the G the second time through the notes: they're the one whose ratios I massaged). In the second recording I use the other BCD on the chip to get some more octaves.

This one only requires the keys to be single-pole switches, I get the C at both ends of the scale, and it all happens on only three chips (not counting the oscillator). It's a shame the fifth is so nasty, but, hey, this is Lunetta-land. When I get brave enough I'll try the 12-tone generator richardc64 posted.


divisions.mp3
 Description:

Download
 Filename:  divisions.mp3
 Filesize:  402 KB
 Downloaded:  100 Time(s)


divisions_octaves.mp3
 Description:

Download
 Filename:  divisions_octaves.mp3
 Filesize:  640.5 KB
 Downloaded:  105 Time(s)

Back to top
View user's profile Send private message
trav



Joined: Sep 11, 2012
Posts: 70
Location: Auckland
Audio files: 14

PostPosted: Sun Mar 10, 2013 2:38 am    Post subject: Reply with quote  Mark this post and the followings unread

Here's how I wire the BCD up-counter:
Code:

0 0 0 0
0 0 0 1
0 0 1 0
0 0 1 1
0 1 0 0
0 1 0 1         BIT1 + BIT3 --> RST  (divide by 5)
0 1 1 0         BIT2 + BIT3 --> RST  (divide by 6)
0 1 1 1  BIT1 + BIT2 + BIT3 --> RST  (divide by 7)
1 0 0 0                BIT4 --> RST  (divide by 8)
1 0 0 1         BIT1 + BIT4 --> RST  (divide by 9)
                        GND --> RST  (divide by 10)

The keys just connect the reset pin to the appropriate signal. There is a pull-up resistor on RST so that when no key is pressed nothing comes through. I take the output from BIT3. As Blue Hell mentioned, this doesn't give a squarewave (except for division by 8), but the octave-down divisions fix this (you can hear the difference in the highest octave of the second recording above).
Back to top
View user's profile Send private message
PHOBoS



Joined: Jan 14, 2010
Posts: 1687
Location: Moon Base
Audio files: 344

PostPosted: Sun Mar 10, 2013 4:58 am    Post subject: Reply with quote  Mark this post and the followings unread

Nice to see your making progress with it. Maybe the CD4018 (presettable divide-by-n counter) is useful.

Quote:
well, 9/80 is pretty close to 9/81 = 1/9. It's not so easy to turn 3/20 into 3/21 = 1/7, but when I saw that I could twist the above to get the following:

C = 1/10
D = 1/9
E = 1/8
G = 1/7
A = 1/6
C = 1/5

waaait a minute,.. isn't that exactly what the 4017/4051 melody generator does ? Shocked

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/ http://www.acidtrash.com/ Stickney Synthyards
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
trav



Joined: Sep 11, 2012
Posts: 70
Location: Auckland
Audio files: 14

PostPosted: Sun Mar 10, 2013 12:18 pm    Post subject: Reply with quote  Mark this post and the followings unread

PHOBoS wrote:
Maybe the CD4018 (presettable divide-by-n counter) is useful.


Yep, I've been playing with 4518s because that's what the cmos challenge landed me with and what got me thinking. Note that the 4018 needs extra NAND gates for divisions by odd numbers.

Quote:
waaait a minute,.. isn't that exactly what the 4017/4051 melody generator does ? Shocked


Haha! Yes, this has all been an elaborate, round-about way of implementing a manual melody generator Smile The 4017 version would be very simple: just put a clock into the chip and have the keypress connect the reset pin to the right place. Or, to do the original idea, chain hardwired 4017s. I'll pick up some this week and try it out.
Back to top
View user's profile Send private message
trav



Joined: Sep 11, 2012
Posts: 70
Location: Auckland
Audio files: 14

PostPosted: Sun Mar 10, 2013 1:18 pm    Post subject: Reply with quote  Mark this post and the followings unread

err... so looking at those ratios made me realize that the assumption I made in my very first post was incorrect: dividing by three yields the perfect FOURTH two octaves down, not the perfect fifth. Embarassed
Code:

   Root   |  Fourth  |  Octave  | 2nd Octave
     1    |    4/3   |     2    |     4

You can see that if you start with a frequency of 4 then divide by 3 you get 4/3 = the perfect fourth two octaves below. I wondered why I had to re-rearrange my notes... I was still generating the right intervals (the fourth is the inverse of the fifth), just in the opposite direction. Edited the first post to correct my error.
Back to top
View user's profile Send private message
jonasx26



Joined: Sep 20, 2009
Posts: 5
Location: Sweden

PostPosted: Wed Mar 13, 2013 4:30 pm    Post subject: Reply with quote  Mark this post and the followings unread

I'm doing something similar with a PLL and programmable dividers.
The ratios between intervals is a irrational number, [2^(1/12)]^n.
Where n is the number of semitones between notes, Fout/Fin=n.
You'll have to approximate the irrational number with a fraction. Higher value for the denominator (which will be the nominal, unity frequency) will give better precision.
Just google 'twelfth root of two' and 'musical intervals'. It's all there, (almost) no math required. Just pick some multiple of the input, use that to form a fraction approximating the ratio and then divide down again if needed.

_________________
@jonasjberg Analog be harder than digital.
Back to top
View user's profile Send private message Visit poster's website
trav



Joined: Sep 11, 2012
Posts: 70
Location: Auckland
Audio files: 14

PostPosted: Fri Mar 15, 2013 6:12 am    Post subject: Reply with quote  Mark this post and the followings unread

jonasx26 wrote:
...(almost) no math required...


and "just keep dividing by three" is even less math than that Cool

here's a diagram of something I built tonight to get all the white notes. Just gonna build tuning+octaves circuits and then I'll post some sounds.


7_note_divisions.png
 Description:
 Filesize:  17.95 KB
 Viewed:  74 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

7_note_divisions.png


Back to top
View user's profile Send private message
trav



Joined: Sep 11, 2012
Posts: 70
Location: Auckland
Audio files: 14

PostPosted: Sat Apr 06, 2013 12:45 am    Post subject: Reply with quote  Mark this post and the followings unread

Well, here's a picture of two keyboards made out of a bunch of shitty switches. The top one is a simple monophonic pentatonic thing with a pot for tuning and 4-throw rotary switch for octave selection. The bottom one is a (kinda) polyphonic diatonic thing with a pot for tuning, 4x ON-OFF-MOM switches for octaves/sub-octaves, and the top three octaves brought ought to banana jacks for feeding notes into melody gens, gates, sequencers etc.

sounds to follow


keyboard-by-divisions.jpg
 Description:
 Filesize:  159.42 KB
 Viewed:  59 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

keyboard-by-divisions.jpg


Back to top
View user's profile Send private message
trav



Joined: Sep 11, 2012
Posts: 70
Location: Auckland
Audio files: 14

PostPosted: Sat Apr 06, 2013 6:20 am    Post subject: Reply with quote  Mark this post and the followings unread

The pentatonic circuit is really simple. Send a fairly high frequency into a 4017. RST is tied high by a pull-up resistor, so OUT is usually low, but closing one of the switches connects reset to one of the output pins, dividing the original frequency and putting it on OUT. I fed this into a ripple counter to square up the signal and get a few more octaves.

The diatonic circuit was a bit more complicated, but basically the diagram above plus a few more dividers to get a three-octave keyboard plus 4 octave/sub-octave switches to get a range of 6 octaves altogether. Polyphony sounds alright when only the top octave is activated, after that it gets all diode-crunchy. As for the build, I'm not much of a pianist; what I really am looking forward to is seeing what kind of melodies the lunetta can make on its own, hence the use of crappy switches for "keys" while the jacks are for patching the notes elsewhere.

have a listen, tell me what you think


5-tone_generator.png
 Description:
 Filesize:  8.02 KB
 Viewed:  5189 Time(s)

5-tone_generator.png



5-tone.mp3
 Description:

Download
 Filename:  5-tone.mp3
 Filesize:  513.75 KB
 Downloaded:  115 Time(s)


7-tone.mp3
 Description:

Download
 Filename:  7-tone.mp3
 Filesize:  1.04 MB
 Downloaded:  103 Time(s)

Back to top
View user's profile Send private message
PHOBoS



Joined: Jan 14, 2010
Posts: 1687
Location: Moon Base
Audio files: 344

PostPosted: Sun Nov 10, 2013 4:44 am    Post subject: Reply with quote  Mark this post and the followings unread

trav wrote:
The pentatonic circuit is really simple. Send a fairly high frequency into a 4017. RST is tied high by a pull-up resistor, so OUT is usually low, but closing one of the switches connects reset to one of the output pins, dividing the original frequency and putting it on OUT. I fed this into a ripple counter to square up the signal and get a few more octaves.

The diatonic circuit was a bit more complicated, but basically the diagram above plus a few more dividers to get a three-octave keyboard plus 4 octave/sub-octave switches to get a range of 6 octaves altogether. Polyphony sounds alright when only the top octave is activated, after that it gets all diode-crunchy. As for the build, I'm not much of a pianist; what I really am looking forward to is seeing what kind of melodies the lunetta can make on its own, hence the use of crappy switches for "keys" while the jacks are for patching the notes elsewhere.

have a listen, tell me what you think

hmm. I think I somehow missed your last post Embarassed
I like the simplicity of the 5-tone generator Very Happy and it does sound like the melody generator. 7-tone seems to be a bit of but it's not bad. I actually
found a circuit in an old elektor which is similar in concept to the one richardc64 posted. It's designed to play a fixed melody (Big Ben) but I think
it would be possible to use it in a similar way you made the 5-tone generator. I probably won't be trying that anytime soon though, and I allready
have a lunetta keyboard anyway Wink

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/ http://www.acidtrash.com/ Stickney Synthyards
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
commathe



Joined: Jul 26, 2013
Posts: 71
Location: Beijing
Audio files: 5

PostPosted: Sun Nov 10, 2013 6:30 pm    Post subject: Reply with quote  Mark this post and the followings unread

This is fantastic. I have been really interested in this sort of idea for a long time, mainly for creating big organ-like drones. I really appreciate the documentation
Back to top
View user's profile Send private message
trav



Joined: Sep 11, 2012
Posts: 70
Location: Auckland
Audio files: 14

PostPosted: Wed Nov 20, 2013 2:00 pm    Post subject: Reply with quote  Mark this post and the followings unread

PHOBoS wrote:
7-tone seems to be a bit of but it's not bad.

I just had a listen back to what was admittedly not a great demonstration. When you say it sounds a bit off, I think in the beginning I played a minor scale: is this the offness you mean? (You get some major arpeggios later) I think I wanted to demonstrate the full range, and you can see from the keyboard layout I begin and end on A (Cs are the red switches).

Of course, the whole thing is a bit ramshackle, so it may just be that. But it is fun to play with. I like to patch the tones into a multiplexor clocked by random bits: you can hear this on the attached patch.

PS, PHOBoS, I love the LUN·A·KEY! watched that thread with great admiration.


test.ogg
 Description:

Download
 Filename:  test.ogg
 Filesize:  2.9 MB
 Downloaded:  62 Time(s)

Back to top
View user's profile Send private message
Top Top



Joined: Feb 02, 2010
Posts: 198
Location: California

PostPosted: Sat Nov 23, 2013 3:03 pm    Post subject: Reply with quote  Mark this post and the followings unread

Great thread.

All of the Pythagorean harmonic relationships were via mathematical divisions of 2 and 3. I've done a bit of thinking and planning on the idea of how to divide down tones to get different intervals, but never actually built anything.

_________________
A. MAGIC PULSEWAVE ELECTRONICS
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: mosc
Page 1 of 1 [24 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Lunettas - circuits inspired by Stanley Lunetta
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
e-m mkii

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use