|
Post by hitsware on Mar 20, 2022 0:21:44 GMT
*VOICE 3,6
DIM n%(1000),p%(7),c%(29),m%(3),o%(3),e%(3)
FOR j% = 12 TO 100
n%(j%) = INT(48 * (LOG(j%)/LOG(2))+0.5)-172
NEXT j%
FOR x% = 0 TO 7: READ p%(x%): NEXT x%
FOR x% = 1 TO 3: READ o%(x%),e%(x%): NEXT x%
DATA 2,4,1,1,3,4,1,1, 1,5,2,6,4,7
FOR x% = 0 TO 29: READ c%(x%): NEXT x%
DATA 5,6,9,5, 5,6,9,9, 5,6,9,5, 8,9,5,5
DATA 4,5,9,9, 4,5,9,9, 4,5,9,9, 4,9
FOR x% = 0 TO 3: READ m%(x%): NEXT x%
DATA 2,4,3,4
ENVELOPE 1,0,0,0,0,0,0,0,070,-10,0,0,070,0
ENVELOPE 2,0,0,0,0,0,0,0,090,-10,0,0,090,0
ENVELOPE 3,0,0,0,0,0,0,0,110,-10,0,0,110,0
ENVELOPE 4,0,0,0,0,0,0,0,000,-00,0,0,000,0
ENVELOPE 5,0,0,0,0,0,0,0,120,-01,0,0,120,0
ENVELOPE 6,0,0,0,0,0,0,0,100,-10,0,0,100,0
ENVELOPE 7,0,0,0,0,0,0,0,080,-01,0,0,080,0
FOR x% = 0 TO 3: SOUND 0,1,4,12: NEXT x%: WAIT 240
REPEAT: FOR x% = 0 TO 29
SOUND 1,-6,n%(4*c%(x%)),24
SOUND 2,-6,n%(6*c%(x%)),24
FOR y% = 0 TO 3: r%=RND(3)
SOUND 3,e%(r%),n%(c%(x%)*m%(y%)*o%(r%)),6
FOR z% = 0 TO 1: u% = (2*y%)+z%
SOUND 0,p%(u%),4,3
NEXT z%: NEXT y%: NEXT x%: UNTIL FALSE
|
|
ddrm
New Member
Posts: 3
|
Post by ddrm on Mar 22, 2022 8:18:54 GMT
Glad to see someone using this forum!
An interesting example - thanks. I like the use of the negative decay rate in the envelopes - I might have a little play with that!
D
|
|
|
Post by hitsware on Mar 24, 2022 2:03:31 GMT
Glad to see someone using this forum! An interesting example - thanks. I like the use of the negative decay rate in the envelopes - I might have a little play with that! D Me Too ! Negative decay is much more natural than positive .
|
|
|
Post by Richard Russell on Mar 24, 2022 12:58:06 GMT
Me Too ! Negative decay is much more natural than positive . Indeed, if the rate-of-change is positive it isn't a decay at all! The ENVELOPE statement supports signed values for the 'attack' and 'decay' phases but in most circumstances I would expect the first to be positive (or zero) and the second negative (or zero). The sustain and release phases don't officially support positive values at all (although they may work, I'm not sure).
|
|
ddrm
New Member
Posts: 3
|
Post by ddrm on Mar 25, 2022 8:41:45 GMT
Richard, welcome! That's interesting: I'd obviously misunderstood! I assumed the decay would mean positive values REDUCED the value - that probably explains why I struggle to get the effects I want! I'll definitely need to revisit my (few) programs using envelopes.... ;-)
D
|
|
|
Post by Richard Russell on Mar 25, 2022 14:01:27 GMT
I assumed the decay would mean positive values REDUCED the value Why "assume" when the documentation is quite explicit: AA −127 to 127 Change of amplitude per step during the attack phase. AD −127 to 127 Change of amplitude per step during the decay phase. AS −127 to 0 Change of amplitude per step during the sustain phase. AR −127 to 0 Change of amplitude per step during the release phase.
The very reason for the use of the phrase " change of amplitude" (and the range of values being signed) is to eliminate any ambiguity. P.S. You never reply to, or even acknowledge, emails which I send to you, which is quite disconcerting. P.P.S. I am not a member of this forum, nor will I ever be. However it accepts posts from anonymous guests (although I consider this an unwise setting).
|
|
|
Post by Richard Russell on Mar 26, 2022 10:18:57 GMT
As you know, the definition there is not quite the same as is used by BBC BASIC, because it assumes that the 'sustain' phase is a constant level. In BBC BASIC it need not be: it is possible to set the level to reduce during the 'sustain' phase rather than remain constant. This may be useful, for example, in simulating instruments like a piano in which the resonant element (e.g. string) is undamped, but unexcited, during the sustain phase so the sound continues, but nevertheless decays slowly. The envelope I use for the entertainer.bbc and figleaf.bbc example programs (both Scott Joplin ragtime piano pieces) is: ENVELOPE 1,1,0,0,0,0,0,0,40,-8,-1,-1,119,89
Here the 'attack' rate is set to 40, the 'decay' to -8 and the 'sustain' to -1. The reason for the 'release' phase being set to -1 rather than a much faster rate, as would normally be the case because the string is damped again, is related to the source material originating from my old Z80 MUSIC program which does not guarantee that the piano key will be released at the correct instant; you could try changing the release rate to -8 if that is not an issue.
|
|
ddrm
New Member
Posts: 3
|
Post by ddrm on Mar 26, 2022 22:21:17 GMT
Hi Richard, this isn't the forum for it, but I haven't seen any emails from you recently, despite having sent you a couple over the last couple of weeks. Are you sending them to my old work account? I'll try to remember to check tomorrow.
|
|
|
Post by Richard Russell on Mar 27, 2022 10:43:09 GMT
Are you sending them to my old work account? No, all sent to your 'edu' address (often in reply to one from you). Here are some emails I have sent to you but to which I've received no reply: 23/01/2022 10:06 23/01/2022 14:43 25/01/2022 14:22 26/01/2022 15:07 13/02/2022 23:39 23/03/2022 16:15
|
|
|
Post by Richard Russell on Mar 27, 2022 12:00:16 GMT
As you know, the definition there is not quite the same as is used by BBC BASIC Something else which I know you're aware of, but not everybody may be, is that because there are so few tone generators in BBC BASIC (three or four depending on how it's configured with *TEMPO) the 'release' phase won't sound at all unless you are careful to ensure that it does. For example here the release phase never happens - the output is immediately forced to silence because the code explicitly calls for that: ENVELOPE 1,1,0,0,0,0,0,0,40,-8,-1,-4,119,89
REPEAT
SOUND 1,1,148,10
SOUND 1,0,0,10
UNTIL FALSE
Whereas here the release phase does happen, because channel 1 is told to 'hold': ENVELOPE 1,1,0,0,0,0,0,0,40,-8,-1,-4,119,89
REPEAT
SOUND 1,1,148,10
SOUND &1001,1,0,10
UNTIL FALSE
|
|
|
Post by hitsware on Mar 27, 2022 16:07:31 GMT
Yes ..... And therein is a real weakness of the ' reality ' of most of the standard 4 voice systems. It is difficult to have one note start while another is yet dying out .... Which is necessesary for an illusion of depth .
|
|