electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
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 
go to the radio page Live at electro-music.com radio 1 Please visit the chat
poster
 Forum index » DIY Hardware and Software » Lunettas - circuits inspired by Stanley Lunetta
ChipTune music box
Post new topic   Reply to topic Moderators: mosc
Page 1 of 2 [39 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Goto page: 1, 2 Next
Author Message
synaesthesia



Joined: May 27, 2014
Posts: 291
Location: Germany
Audio files: 85

PostPosted: Sat Oct 25, 2014 2:30 pm    Post subject: ChipTune music box
Subject description: simple chip tune generator
Reply with quote  Mark this post and the followings unread

This afternoon I was experimenting with my Lunetta Lab and started to patch something with the idea to extend the idea of the Crazy Fiddler circuit a bit. I was exploring how a shift register feedback can be used to generate waveform when I ran into this combination and optimized it until I had the following. The CHIPTUNE circuit plays a small tune that repeats endlessly. The tune is surprisingly long and generates harmonic tones in interesting self-similar sequences. After a while you will start to follow the melody of the tune.

How it works: oscillator U1B determines the basic pitch and clocks a shift register with a resistor network at the outputs Q0 to Q3. Depending on the feedback function for the shift register, different waveforms at different base frequencies are generated by the resistor network. The feedback function with arguments taken from Q1 to Q3 is implemented using an 8->1 selector U4. The bit pattern that describes the function is coming from the outputs of counter U2. Low frequency oscillator U1A generates the clock for the counter and can be used to vary the tempo. The value for binary input X7 is tied to ground to make sure that there is some tone generated when all bits in the shift register are at 1. You could also connect Q7 from the counter to X7, but then there will be a pause while the counter is between 0xC0 and 0xFF and the shift register is locked at a state with all 1s.

The generated melodies can be varied a bit by connecting Q1 to Q3 from the shift register to inputs A,B,C of U4 in different permutations.
Permutation Q3->A, Q2->B, Q1->C is used in the schematic. My favorite is Q2-A,Q3->B,Q1->C. I attached a recording for both tunes for your listening pleasure.


ChipTune.PNG
 Description:
 Filesize:  36.57 KB
 Viewed:  908 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

ChipTune.PNG



ChipTuneA3B2C1.mp3
 Description:

Download
 Filename:  ChipTuneA3B2C1.mp3
 Filesize:  827.41 KB
 Downloaded:  1653 Time(s)


ChipTuneA2B3C1.mp3
 Description:

Download
 Filename:  ChipTuneA2B3C1.mp3
 Filesize:  826.18 KB
 Downloaded:  1371 Time(s)

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



Joined: Jan 15, 2011
Posts: 427
Location: Montreal, Canada
Audio files: 4

PostPosted: Sun Oct 26, 2014 5:05 am    Post subject: Reply with quote  Mark this post and the followings unread

Interesting circuit! I'll add it to my pile of circuits to try. I wonder what chaining the second shift reg on the 4015 to make it 8-bit would do. Thanks for sharing.

-- James.
Back to top
View user's profile Send private message Visit poster's website
synaesthesia



Joined: May 27, 2014
Posts: 291
Location: Germany
Audio files: 85

PostPosted: Sun Oct 26, 2014 10:11 am    Post subject: Reply with quote  Mark this post and the followings unread

Depending on the feedback function the 4-bit shift register acts as a divider between 2 and 14, with 3,4,5,6,7 being the most frequent dividers and 10 and 11 missing. If you make the shift register longer, the dividers become bigger. The melody gets lost and some dis-harmonic sounds are added.

I tried adding a 4053 to create permutations for the A,B,C inputs, driven by some of the unused 4040 outputs. However, I haven't found a way to connect the outputs from the 4015 to the 4053 yet, so that each output from the 4015 is used only once for the A,B,C inputs of the 4051.
Back to top
View user's profile Send private message
synaesthesia



Joined: May 27, 2014
Posts: 291
Location: Germany
Audio files: 85

PostPosted: Sun Oct 26, 2014 11:56 am    Post subject: Reply with quote  Mark this post and the followings unread

Here is an automatic permutation that works quite nice. I have included Q0 and use Q7 to Q9 from the 4040 to switch between permutations.
Played back with higher speed the generated tune almost sounds like an arcade game and runs for a full 1 minute and 34 seconds before repeating.


ChipTunePermutation.PNG
 Description:
 Filesize:  12.25 KB
 Viewed:  30929 Time(s)

ChipTunePermutation.PNG



ChipTunePermutation.mp3
 Description:

Download
 Filename:  ChipTunePermutation.mp3
 Filesize:  1.44 MB
 Downloaded:  1302 Time(s)

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



Joined: May 27, 2014
Posts: 291
Location: Germany
Audio files: 85

PostPosted: Sun Oct 26, 2014 2:01 pm    Post subject: Reply with quote  Mark this post and the followings unread

Like this...


SuperChipTune.PNG
 Description:
 Filesize:  27.54 KB
 Viewed:  1007 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

SuperChipTune.PNG


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



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

PostPosted: Sun Oct 26, 2014 4:53 pm    Post subject: Reply with quote  Mark this post and the followings unread

Wow! The way it loops is surprisingly musical. It'd be really cool to run two alongside each other and maybe some percussion sounds! Instant 80s home-arcade style
Back to top
View user's profile Send private message
synaesthesia



Joined: May 27, 2014
Posts: 291
Location: Germany
Audio files: 85

PostPosted: Mon Oct 27, 2014 12:24 pm    Post subject: Reply with quote  Mark this post and the followings unread

One more improvement can be made. You can avoid the boring parts from the previous circuit when just two tones alternate by avoiding that one shift register output is switched to two of the selection inputs at the same time. In this variation I am using a 4052 instead of the 4053 and leave Q3 permanently connected to C. The 4052 can only create four permutations (given in the schematic) and the resulting tune is shorter because of that. Nevertheless, it sounds more interesting.

By the way, you could drop the resistor network and just connect Q3 to the output without much loss. The resulting waveform will be a simple square wave then.


SuperChipTune2.PNG
 Description:
 Filesize:  29.55 KB
 Viewed:  817 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

SuperChipTune2.PNG



SuperChipTune2.mp3
 Description:

Download
 Filename:  SuperChipTune2.mp3
 Filesize:  865.37 KB
 Downloaded:  1401 Time(s)

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



Joined: May 27, 2014
Posts: 291
Location: Germany
Audio files: 85

PostPosted: Tue Oct 28, 2014 1:21 pm    Post subject: Reply with quote  Mark this post and the followings unread

And one more variant, this time playing a random tune. The principle is the same: a shift register with a programmable feedback function implements a divider. Only this time I am using a second shift register to generate a (pseudo) random bit pattern for the feedback function. Plus, I am using the LFO output itself to provide one additional bit for the function synthesis.

The randomization comes from shifting in the output of the oscillator with each LFO clock. This makes it almost random, except that there always will be identical pairs of notes because one of the feedback function bits toggles before the next random bit is shifted in. I dropped the resistor network this time and use just the square wave from one of the divider (shift register) outputs. This circuit creates a nice swing with a minimum number of parts.

I used a spreadsheet to calculate the divider for each feedback function between 10000000 and 11111110. The assignment of the shift register outputs to the 4051 is carefully selected to avoid the divider 2 to occur, because this creates a rather high note that does not sound nice in the melody. The dividers that can occur with this schematic are 3,4,5,6,7,8,9,12 and 13. That makes 16 possible pairs of 9 possible notes.


RandomChipTune.PNG
 Description:
 Filesize:  26.9 KB
 Viewed:  901 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

RandomChipTune.PNG



RandomChipTune.mp3
 Description:

Download
 Filename:  RandomChipTune.mp3
 Filesize:  1.02 MB
 Downloaded:  1306 Time(s)

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



Joined: Jan 14, 2010
Posts: 5581
Location: Moon Base
Audio files: 705

PostPosted: Wed Oct 29, 2014 1:50 pm    Post subject: Reply with quote  Mark this post and the followings unread

great stuff! Very Happy
I thought I'd replied already but apprently not Embarassed
nice groove in the SuperChipTune2.
Was thinking of making some kind of bit permutator/shuffler using muxes, funny to see you do the same thing Laughing

I think what could make it more intersting is a 2nd one running at a slower speed.

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
synaesthesia



Joined: May 27, 2014
Posts: 291
Location: Germany
Audio files: 85

PostPosted: Wed Oct 29, 2014 2:18 pm    Post subject: Reply with quote  Mark this post and the followings unread

Yeah. I am currently thinking about a second voice as well.. Very Happy

The divider in the second voice better has to be coupled somehow to a short sequence of the first voice, like four notes, so that they play together nicely.
Maybe just copy the bit pattern from the first to the second and hard-wire some of the bits to 0 or 1. Investigating...

By the way, I already spent a lot of time looking at generating bit permutations using switches. Let me draw a circuit of my current idea and share it in another thread. I would be very interested in other ideas.
Back to top
View user's profile Send private message
PHOBoS



Joined: Jan 14, 2010
Posts: 5581
Location: Moon Base
Audio files: 705

PostPosted: Wed Oct 29, 2014 2:47 pm    Post subject: Reply with quote  Mark this post and the followings unread

synaesthesia wrote:
The divider in the second voice better has to be coupled somehow to a short sequence of the first voice, like four notes, so that they play together nicely.
Maybe just copy the bit pattern from the first to the second and hard-wire some of the bits to 0 or 1. Investigating...

That's exactly what I had in mind Very Happy (like playing chords and a melody)

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
synaesthesia



Joined: May 27, 2014
Posts: 291
Location: Germany
Audio files: 85

PostPosted: Sat Nov 01, 2014 3:19 pm    Post subject: Reply with quote  Mark this post and the followings unread

Not really chords, but it is a second voice. The output from the 4051 drives a second shift register that is connected as a divider by 2. The shift register is held in reset while input X0 is at 1. This way the second voice is only active if X0 is 0 and if there is no pause. A pause occurs if X0 is 0 and the current feedback function generates a sequence of zeroes. This is how it sounds.


ChipTune2.PNG
 Description:
 Filesize:  42.76 KB
 Viewed:  613 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

ChipTune2.PNG



ChipTune2.mp3
 Description:

Download
 Filename:  ChipTune2.mp3
 Filesize:  1.14 MB
 Downloaded:  1212 Time(s)

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



Joined: Jan 14, 2010
Posts: 5581
Location: Moon Base
Audio files: 705

PostPosted: Mon Nov 03, 2014 6:36 am    Post subject: Reply with quote  Mark this post and the followings unread

sounds great Very Happy
_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
synaesthesia



Joined: May 27, 2014
Posts: 291
Location: Germany
Audio files: 85

PostPosted: Sun Nov 23, 2014 3:22 pm    Post subject: Reply with quote  Mark this post and the followings unread

After the WalkingBass circuit idea, what else could I do? Of course, I had to combine the two circuits. The ChipTuneSymphony circuit includes the melody generator from the ChipTune circuit, the second voice, and the walking bass. This makes for about 13 minutes of ChipTune music before the pattern repeats. If you don't have the patience to listen to the recording of the full cycle, skip to 09:30 and listen for a minute to enjoy the best parts. Cool


ChipTuneSymphony.PNG
 Description:
 Filesize:  40.96 KB
 Viewed:  690 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

ChipTuneSymphony.PNG



ChipTuneSymphony.mp3
 Description:

Download
 Filename:  ChipTuneSymphony.mp3
 Filesize:  12.09 MB
 Downloaded:  1312 Time(s)

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



Joined: May 27, 2014
Posts: 291
Location: Germany
Audio files: 85

PostPosted: Sun Nov 23, 2014 3:47 pm    Post subject: Reply with quote  Mark this post and the followings unread

Ok, if that was a bit too much repetition from the walking bass then change the input for XOR U3A from Q0 of U2 to Q2 and listen to this..


ChipTuneMusic.mp3
 Description:

Download
 Filename:  ChipTuneMusic.mp3
 Filesize:  3.03 MB
 Downloaded:  1063 Time(s)

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



Joined: May 27, 2014
Posts: 291
Location: Germany
Audio files: 85

PostPosted: Mon Nov 24, 2014 1:14 pm    Post subject: Reply with quote  Mark this post and the followings unread

Playing around with the counter outputs and changing Q2 to Q7 yields this..


MoreChipTuneMusic.mp3
 Description:

Download
 Filename:  MoreChipTuneMusic.mp3
 Filesize:  2.99 MB
 Downloaded:  1104 Time(s)

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



Joined: May 27, 2014
Posts: 291
Location: Germany
Audio files: 85

PostPosted: Sun Mar 08, 2015 3:14 am    Post subject: Reply with quote  Mark this post and the followings unread

Here is a ChipTune circuit that plays a random melody forever. I used the same principle as in the RandomChime circuits, but without the XOR gate. Instead, I use a 4051 analog switch and inverters in the feedback path of the divider.

There are two oscillators, a fast one for the base pitch and a slow one for the tempo. The frequency from the fast oscillator U1A is fed into shift register U2 and using the feedback from selector U4 is divided by 8,10,12,14 or 16. Typically, the feedback to U2 is inverted to create a Johnson counter. However, for some of the inputs an extra inverter is used and that results in the current state of the shift register to be rotated instead, which results in additional waveforms with higher frequencies. This way the divider generates not only five tones, but a few more depending on the pattern in U2 at the time the control inputs A,B,C of U4 change. If all bits of the shift register happen to be the same and the output is not inverted, a pause will be heard.

The slow oscillator U1B drives shift register U3 which generates the control inputs A,B,C for U4. These signals determine the division and the mode of shift register U2. The input for U3 is taken directly from the fast oscillator as a random source. Of course, you could drive inputs A,B,C from other sources, like separate oscillators, as well.


Opus4015.PNG
 Description:
 Filesize:  48.84 KB
 Viewed:  576 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

Opus4015.PNG



Opus4015.mp3
 Description:

Download
 Filename:  Opus4015.mp3
 Filesize:  1.35 MB
 Downloaded:  1024 Time(s)

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



Joined: Jan 14, 2010
Posts: 5581
Location: Moon Base
Audio files: 705

PostPosted: Mon Mar 09, 2015 12:57 pm    Post subject: Reply with quote  Mark this post and the followings unread

nice Very Happy
I wonder how it would sound slowed down with delay (or more than 1 circuit) so you have more notes sounding at the same time.

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
synaesthesia



Joined: May 27, 2014
Posts: 291
Location: Germany
Audio files: 85

PostPosted: Mon Mar 09, 2015 2:18 pm    Post subject: Reply with quote  Mark this post and the followings unread

Good idea. It would sound much better. I used Audacity for -33% tempo change and 0.5s delay because my PT2399 circuit is still in the layout phase and not ready yet Smile


Opus4015WithDelaySlow.mp3
 Description:

Download
 Filename:  Opus4015WithDelaySlow.mp3
 Filesize:  1.83 MB
 Downloaded:  902 Time(s)

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



Joined: May 27, 2014
Posts: 291
Location: Germany
Audio files: 85

PostPosted: Sat Mar 14, 2015 3:22 pm    Post subject: Reply with quote  Mark this post and the followings unread

Here is one more patch with XOR gates in the feedback path again. This time I am generating a second voice by clocking another shift register from one output of the first. This gives a high frequency from the first, and a lower frequency from the second shift register. The outputs of both shift registers are mixed with a simple passive resistor mixer. The chosen values emphasize the higher tones.

To make the melody more interesting two analog switches X and Y are used to vary the feedback path of each shift register between the 3rd and 4th output stage. This way the generated frequencies change but will always be harmonic. I used a counter driven by a slow clock to control the analog switches.

Just because there was a third switch available I used it to change the counter output that drives the switch for the lower frequency feedback. This varies the rhythm of the melody a bit. The first recording is the raw signal. The second has a delay of 0.5s added using Audacity.


Opus4053.PNG
 Description:
 Filesize:  42.51 KB
 Viewed:  505 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

Opus4053.PNG



Opus4053.mp3
 Description:

Download
 Filename:  Opus4053.mp3
 Filesize:  2.3 MB
 Downloaded:  956 Time(s)


Opus4053withDelay.mp3
 Description:

Download
 Filename:  Opus4053withDelay.mp3
 Filesize:  2.34 MB
 Downloaded:  907 Time(s)

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



Joined: Jan 14, 2010
Posts: 5581
Location: Moon Base
Audio files: 705

PostPosted: Fri Mar 27, 2015 1:27 pm    Post subject: Reply with quote  Mark this post and the followings unread

When you posted the Opus4015 I did a test mixing the recording with a version at half speed.
It sounded kinda nice but it was a bit short so I didn't post it.
But the Opus4053 is longer so i tried it again and used some of your other recordings aswell.
It's not reallly a track more an example of how a couple of your circuits together could sound. Laughing


Synaestatic.mp3
 Description:
Synaestatic, some synaesthesia recordings mixed together.

Download
 Filename:  Synaestatic.mp3
 Filesize:  2.46 MB
 Downloaded:  1116 Time(s)


_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
rico C



Joined: Feb 27, 2014
Posts: 26
Location: Redondo Beach

PostPosted: Sat Mar 28, 2015 9:05 am    Post subject: Reply with quote  Mark this post and the followings unread

I'm strolling around a casino in a distant galaxy...as the aliens win big, the arcade machines begin to levitate...
Back to top
View user's profile Send private message
synaesthesia



Joined: May 27, 2014
Posts: 291
Location: Germany
Audio files: 85

PostPosted: Sat Mar 28, 2015 3:12 pm    Post subject: Reply with quote  Mark this post and the followings unread

I finally found a way to avoid the annoying pauses when using a shift register with XOR feedback. The pauses happen when switching from inverting mode to rotating mode and the content happens to be all 0's or 1's. The following snippet uses 2 XORs to detect and correct this.
The first(!) bit from the shift register is sent to the first XOR (A) which generates brief positive pulses for each change between 0 and 1. These pulses are used to charge a small capacitor which is also discharged by a variable resistance (the pot). If enough pulses are detected, the capacitor will remain charged positive enough to hold the lower input of the second XOR at a logic high level. When the pulses are missing long enough the capacitor discharges and the lower input of the XOR becomes low. This will cause the XOR to stop inverting and it will pass its upper input (B) through unchanged.
When inserted properly in the feedback path, this circuit will avoid any state with all 0's or 1's by momentarily changing the feedback mode, so that the shift register contains 0's as well as 1's again.


PulseDetector.PNG
 Description:
 Filesize:  9.41 KB
 Viewed:  493 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

PulseDetector.PNG


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



Joined: May 27, 2014
Posts: 291
Location: Germany
Audio files: 85

PostPosted: Sun Mar 29, 2015 6:22 am    Post subject: Reply with quote  Mark this post and the followings unread

And three recordings using two shift registers with different lengths and mode switch clocks (details in the MP3 tags). The first voice (higher) has the pause-free circuit added. The second voice (lower) is derived by using the output of the first as a clock. Because I had no more XOR's left, I omitted the pause-free circuit there.


DoubleXorFeedbackShiftRegister.mp3
 Description:

Download
 Filename:  DoubleXorFeedbackShiftRegister.mp3
 Filesize:  1.74 MB
 Downloaded:  951 Time(s)


DoubleXorFeedbackShiftRegisterFast.mp3
 Description:

Download
 Filename:  DoubleXorFeedbackShiftRegisterFast.mp3
 Filesize:  1.86 MB
 Downloaded:  918 Time(s)


DoubleXorFeedbackShiftRegisterSlow.mp3
 Description:

Download
 Filename:  DoubleXorFeedbackShiftRegisterSlow.mp3
 Filesize:  2.13 MB
 Downloaded:  882 Time(s)

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



Joined: Jan 14, 2010
Posts: 5581
Location: Moon Base
Audio files: 705

PostPosted: Sun Mar 29, 2015 6:55 am    Post subject: Reply with quote  Mark this post and the followings unread

will have to listen to those.

one idea that came to mind is using a binary (or decimal) counter with a mux to vary the tempo/note length.
you could also go analog with a resistor ladder and a 4046 which can also be used to create different 'base notes' .
not sure if you already did something like this, you're posting so many fun circuits I can't keep up with them all.


rico C wrote:
I'm strolling around a casino in a distant galaxy...as the aliens win big, the arcade machines begin to levitate...
cheesy
_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic Moderators: mosc
Page 1 of 2 [39 Posts]
View unread posts
View new posts in the last week
Goto page: 1, 2 Next
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


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