Welcome, Guest. Please login or register.


Author Topic: how to put a musicbox tune into program code? (Read 4375 times)

Offline ssr86

  • EP user
  • *
  • Posts: 359
  • Country: pl
  • OS:
  • Windows NT 6.2 Windows NT 6.2
  • Browser:
  • Firefox 36.0 Firefox 36.0
    • View Profile
Re: how to put a musicbox tune into program code?
« Reply #15 on: 2015.April.01. 17:28:14 »
Imanaged to find the way to "choose" instruments. When you enter the pattern edit menu, you can select a note which parameters you want to edit just like you choose the pattern to edit - press at the right side and an arrow will appear.

Could someone explain me what do the three adsr do? What are these?
(And maybe other parameters too)
Also, when I edit envelope, then I quickly run out of memory (and the envelopes are only couple of values long).

Offline szipucsu

  • EP addict
  • *
  • Posts: 8089
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 36.0 Firefox 36.0
    • View Profile
    • Webnyelv.hu - Tanuljunk nyelveket!
Re: how to put a musicbox tune into program code?
« Reply #16 on: 2015.April.01. 23:02:30 »
I think Musicbox is a bit difficult to use. I prefer Rockdigi.
SOUND SOURCE 3,STYLE 16,LEFT 16,RIGHT 64,SYNC 2
SOUND SOURCE 2,STYLE 128,PITCH 25.2,SYNC 2
SOUND PITCH 25,SYNC 2
Videos

Offline ssr86

  • EP user
  • *
  • Posts: 359
  • Country: pl
  • OS:
  • Windows NT 6.2 Windows NT 6.2
  • Browser:
  • Firefox 36.0 Firefox 36.0
    • View Profile
Re: how to put a musicbox tune into program code?
« Reply #17 on: 2015.April.01. 23:10:30 »
But isn't rockdigi only for sample-based music?
However - is there an english manual for this?

I also find musicbox to be not very intuitive but it's the only tracker there is (?) for chip tunes...

EDIT:
what's the cost of playing a 4-channel mod in the background?
« Last Edit: 2015.April.01. 23:17:03 by ssr86 »

Offline Zozosoft

  • EP addict
  • *
  • Posts: 13529
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 36.0 Firefox 36.0
    • View Profile
    • http://enterprise.iko.hu/
Re: how to put a musicbox tune into program code?
« Reply #18 on: 2015.April.01. 23:49:41 »
Another idea: I created a player for the ZX Spectrum PT3 files. The player code is combination of the original PT3 player code (available on the net) and the commonly used AY emulation routine from IstvanV and Geco.

The usage is similar to Musicbox tunes, call the irq player in every 1/50 sec.

For the PT3 files there is an editor on PC.

The problem: not all AY ability can be emulated on Dave. But many PT3 files sounds good on Enterprise.
« Last Edit: 2015.April.02. 13:48:52 by szipucsu »

Offline ssr86

  • EP user
  • *
  • Posts: 359
  • Country: pl
  • OS:
  • Windows NT 6.2 Windows NT 6.2
  • Browser:
  • Firefox 36.0 Firefox 36.0
    • View Profile
Re: how to put a musicbox tune into program code?
« Reply #19 on: 2015.April.02. 00:14:34 »
But I would really like to use the dave specific features - like the guitar distortion sound szipucsu achieved... AY deosn't have distortion and ring modulation...

Although it seems that I'll have to go with your solution in the end...

Offline szipucsu

  • EP addict
  • *
  • Posts: 8089
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 36.0 Firefox 36.0
    • View Profile
    • Webnyelv.hu - Tanuljunk nyelveket!
Re: how to put a musicbox tune into program code?
« Reply #20 on: 2015.April.02. 13:46:33 »
But I would really like to use the dave specific features - like the guitar distortion sound szipucsu achieved... AY deosn't have distortion and ring modulation...
Sadly, the Musicbox does not support that sort of distortion to gain the guitar sound. Even if it supported that, more precise values would be needed for that distortion. E.g. in the basic you cannot use PITCH 60 with STYLE 16 because it has an useless sounding, you have to use PITCH 60.3 instead. As I know the Music Box doesn't support these non-integer number values...
So, there is no tracker program to reach the guitar sound. Somebody should write such a program first.

I would be very happy if an Enterprise game could use that guitar distortion sound. No game has used it so far - except my "games". :D
SOUND SOURCE 3,STYLE 16,LEFT 16,RIGHT 64,SYNC 2
SOUND SOURCE 2,STYLE 128,PITCH 25.2,SYNC 2
SOUND PITCH 25,SYNC 2
Videos

Offline szipucsu

  • EP addict
  • *
  • Posts: 8089
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 36.0 Firefox 36.0
    • View Profile
    • Webnyelv.hu - Tanuljunk nyelveket!
Re: how to put a musicbox tune into program code?
« Reply #21 on: 2015.April.02. 14:18:45 »
what's the cost of playing a 4-channel mod in the background?
It is only possible with very simple games. The only game that uses this is Swap.

Here it is on Youtube.
« Last Edit: 2015.April.02. 14:23:26 by szipucsu »
SOUND SOURCE 3,STYLE 16,LEFT 16,RIGHT 64,SYNC 2
SOUND SOURCE 2,STYLE 128,PITCH 25.2,SYNC 2
SOUND PITCH 25,SYNC 2
Videos

Offline ssr86

  • EP user
  • *
  • Posts: 359
  • Country: pl
  • OS:
  • Windows NT 6.2 Windows NT 6.2
  • Browser:
  • Firefox 36.0 Firefox 36.0
    • View Profile
Re: how to put a musicbox tune into program code?
« Reply #22 on: 2015.April.02. 20:00:48 »
Sadly, the Musicbox does not support that sort of distortion to gain the guitar sound. Even if it supported that, more precise values would be needed for that distortion. E.g. in the basic you cannot use PITCH 60 with STYLE 16 because it has an useless sounding, you have to use PITCH 60.3 instead. As I know the Music Box doesn't support these non-integer number values...
So, there is no tracker program to reach the guitar sound. Somebody should write such a program first.
:(
I thought (looking at the basic code) that the effect is achieved by setting distortion and ring modulation on the two channels and then treating them as two notes of a fifth or fourth chord... Haven't thought about the real numbers in your code... But even if a tracker doesn't support frequencies outside the standard notes, wouldn't it be possible to modify the frequencies after compiling the tune... Although it would be a looooot of work (and not a good solution I guess)...

It is only possible with very simple games. The only game that uses this is Swap.

But for a title screen or something like that (off-game screens) and with additional 64k (enough?) it should be ok:).
I've never worked with such trackers (sample-based) so I don't have a clue how to operate them...
Could someone give me the basics?

Offline szipucsu

  • EP addict
  • *
  • Posts: 8089
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 36.0 Firefox 36.0
    • View Profile
    • Webnyelv.hu - Tanuljunk nyelveket!
Re: how to put a musicbox tune into program code?
« Reply #23 on: 2015.April.02. 20:43:02 »
I thought (looking at the basic code) that the effect is achieved by setting distortion and ring modulation on the two channels and then treating them as two notes of a fifth or fourth chord... Haven't thought about the real numbers in your code... But even if a tracker doesn't support frequencies outside the standard notes, wouldn't it be possible to modify the frequencies after compiling the tune... Although it would be a looooot of work (and not a good solution I guess)...
Well, this Dave-specific 4 bit distortion is a very special thing and there are no programs that can deal it in the right way. I think this is a problem that nobody has dealt with so far.
First of all, there are only 1-2 tracker programs for the Enterprise. Secondly, they don't take in consideration the Dave characteristics. We would really need a music maker program that uses all the Dave possibilities. Is there no chance to write one?

Anyway, Geco mentioned a method to create a song in IS-BASIC, then load and save it as an escape sequence. I don't know how it works.
Or, you have to write the music player routine in your program code itself. I don't know how difficult it can be. Is it not possible?

But for a title screen or something like that (off-game screens) and with additional 64k (enough?) it should be ok:).
I think it should work without any additional 64k too. Unless you use a very large number of samples that occupy the whole memory. I think, e.g. 32 or 48k is enough for a tracker song, we have a lot of memory left. However I am not very good at coding.

Quote
I've never worked with such trackers (sample-based) so I don't have a clue how to operate them...
Could someone give me the basics?
As I can see Rockdigi has a "Compile" option in the main menu. It should be similar to the MusixBox "Compile" option, I think. But I have never used it...
« Last Edit: 2015.April.02. 20:52:57 by szipucsu »
SOUND SOURCE 3,STYLE 16,LEFT 16,RIGHT 64,SYNC 2
SOUND SOURCE 2,STYLE 128,PITCH 25.2,SYNC 2
SOUND PITCH 25,SYNC 2
Videos

Offline ssr86

  • EP user
  • *
  • Posts: 359
  • Country: pl
  • OS:
  • Windows NT 6.2 Windows NT 6.2
  • Browser:
  • Firefox 36.0 Firefox 36.0
    • View Profile
Re: how to put a musicbox tune into program code?
« Reply #24 on: 2015.April.02. 21:04:55 »
Quote
As I can see Rockdigi has a "Compile" option in the main menu. It should be similar to the MusixBox "Compile" option, I think. But I have never used it...
What I meant was - how do i make a new song to compile?
Sorry for asking before even trying to figure it out by myself, but I thought that maybe someone already used it a bit and could lead me through the basics... (maybe a ep128emu demo sequence...) This would be really helpful. (I don't want to reinvent the wheel, I have can't find any manual that I could fully understand)

Offline szipucsu

  • EP addict
  • *
  • Posts: 8089
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 36.0 Firefox 36.0
    • View Profile
    • Webnyelv.hu - Tanuljunk nyelveket!
Re: how to put a musicbox tune into program code?
« Reply #25 on: 2015.April.02. 21:42:38 »
What I meant was - how do i make a new song to compile?
1 - load RDIGI.COM

2 - Select F1 (file functions), select F2 (load sample) and load a sample you wish. After loading a sample you can try it by pressing space. If you don't like it you can delete it from the memory by pressing F6 (del last). If you like the loaded sampe you should load more samples by pressing F2. You can choose different kinds of drums and other things. The samples I prefer are OUTLAW, PIZZA, KFLITER, KORGDOI but you can try anything you want. In the subfolder SAMPLES you can find a lot of samples and other subfolders: BESZED (speech), DOBOK (drums), EFFEKTEK (effects). ZONGORA (piano).
So, you loaded some synth samples and some drums.
From the file menu you can return to the main menu by pressing ESC.

3 - Select F2 (set variables). Here, press F2 (stop position) several times. If you don't do so you will hear only the very first part of your song. Later you can modify here where the song should stop.
Press F3, F4, F5, F6 after one another so you turn on all the 4 digi channels. It is very important, otherwise you won't hear anything.
Hold pressed SHIFT+F7 for some time so you can decrease the tempo. 256 as default is not OK very slow, you need something about 60-80 at least.
Tip: if you edit your song and add more and more patterns but they aren't played, you should increase the stop position.
Press ESC to return to main menu

4 - Select F3: 1st edit mode. Here you can set the patterns. Here you cannot name the patterns (like in Musicbox) but you have to refer to them by the memory adresses. Here you can see CH-1 to CH-4,  the 4 digi channels and the pattern references under them. If you set e.g. 1000 under one of the CHs, the program will play the notes in that CH beginning with 1000 address. In the first coloum under DN you can set the duration. You have to set these values in hex digits.

5 - F4 2nd edit mode. In the 1st edit mode you set e.g. 1000 under one of the channels, you have to go to 1000 in the 2nd edit mode and write there the notes. First you can write the name of the note (C, D, E, F ...), then the octave (from 1 to 4 as I remember) then the number of the sample loaded. E.g. : C_1-01 ( _ stands for space)-this is a C in the 1st octave with the sample 01.

In the main menu you can test your song by F6 (hear music). In the main menu you can even try the actual sample by pressing the keys as if the keyboard were a piano. With the internal joystick you can choose between the loaded samples.

Maybe this is useful for the first time. :)
« Last Edit: 2015.April.02. 22:04:23 by szipucsu »
SOUND SOURCE 3,STYLE 16,LEFT 16,RIGHT 64,SYNC 2
SOUND SOURCE 2,STYLE 128,PITCH 25.2,SYNC 2
SOUND PITCH 25,SYNC 2
Videos

Offline Zozosoft

  • EP addict
  • *
  • Posts: 13529
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 36.0 Firefox 36.0
    • View Profile
    • http://enterprise.iko.hu/
Re: how to put a musicbox tune into program code?
« Reply #26 on: 2015.April.02. 22:00:47 »
Anyway, Geco mentioned a method to create a song in IS-BASIC, then load and save it as an escape sequence. I don't know how it works.
It is easy, just close the SOUND channel, and reopen as file. Then all sound command saved to the file.
For the playback just send the file data to SOUND channel.

But a machine code program will not use EXOS SOUND device...
Another possible method: with LUA script record the DAVE register writes from the SOUND IRQ routine. Then possible playback these data from machine code program, with a simple IRQ player.

Anyway needed to write new Enterprise music editor!

Sándor Gyányi converted lot of Spactrum games to Enterprise, including Spectrum 128 games. Then coming the idea for make editor/player for the converted Spectrum musics. Then the basis of the Musicbox are the Spectrum musics. If you see the included example musics, most of are from Spectrum games.
This is the reason why the Musicbox not know all Dave ability :-(

For a sound effects can be used IstvanV's Dave simulator (running on PC), where can play all Dave settings.

Offline geco

  • EP addict
  • *
  • Posts: 5430
  • Country: hu
  • OS:
  • Linux Linux
  • Browser:
  • Firefox 31.0 Firefox 31.0
    • View Profile
Re: how to put a musicbox tune into program code?
« Reply #27 on: 2015.April.03. 09:03:34 »
Another possible method: with LUA script record the DAVE register writes from the SOUND IRQ routine. Then possible playback these data from machine code program, with a simple IRQ player.
I would use modified EXOS interrupt to do it :)
If you can do the guitar song, or effect in Basic what you would use in your music, or even the whole song in Basic I can catch the Dave register values at every 50Hz, in this way you could insert them to your song. What do you think about it?

Offline szipucsu

  • EP addict
  • *
  • Posts: 8089
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 36.0 Firefox 36.0
    • View Profile
    • Webnyelv.hu - Tanuljunk nyelveket!
Re: how to put a musicbox tune into program code?
« Reply #28 on: 2015.April.03. 22:49:28 »
in this way you could insert them to your song.
You mean "insert them into your program code"? :D
SOUND SOURCE 3,STYLE 16,LEFT 16,RIGHT 64,SYNC 2
SOUND SOURCE 2,STYLE 128,PITCH 25.2,SYNC 2
SOUND PITCH 25,SYNC 2
Videos

Offline ssr86

  • EP user
  • *
  • Posts: 359
  • Country: pl
  • OS:
  • Windows NT 6.2 Windows NT 6.2
  • Browser:
  • Firefox 36.0 Firefox 36.0
    • View Profile
Re: how to put a musicbox tune into program code?
« Reply #29 on: 2015.April.04. 01:46:10 »
I would use modified EXOS interrupt to do it :)
If you can do the guitar song, or effect in Basic what you would use in your music, or even the whole song in Basic I can catch the Dave register values at every 50Hz, in this way you could insert them to your song. What do you think about it?

I'll try to learn is-basic sound making sometime later then (because your solution seems the most reasonable for a chance of including the sound) - that is if I think of a good use for the guitar sound.

Meanwhile...
I started composing a guitarless track... One channel drums, one channel melody, one channel bass...
A wip midi is in the attachement.

I'm quite "proud" :oops: of how it came out, although there's something wrong with how it goes to the last part (from 0:28) and the number of bars is odd... (which I think is rather a bad sign). Looping is not that great too, now I think... Can't get the rhytm right in the last section... The theme has only 39 seconds so I don't know if it's not too short for an ingame tune... Maybe doesn't even end up used... However I'm so happy with it now that I felt like showing it:P Finally menaged to use one riff from about 6 years back

I show you the midi, because I have some troubles with vortex tracker (I'm not a chiptune guy)...
« Last Edit: 2015.April.04. 04:55:54 by ssr86 »