Csound Csound-dev Csound-tekno Search About

Re: [Csnd] Win NT Problems take 2

Date1999-10-31 15:51
FromRichard Dobson
SubjectRe: [Csnd] Win NT Problems take 2
OK, I have tried this on v3.58 under Win2000, and there is indeed a
little problem.

The function to play sound at end is sndPlaySound(), and it is set to
SND_ASYNC. This means the function returns immediately after the call.
However, if 'Remain Active' is set, Winsound effectively relaunches,
killing the audio.

The quick fix is just to use SND_SYNC instead (as I find I did in
v3.55):

sndPlaySound(theApp.GetProfileString(csound_section, "Soundfile",""),
		       SND_SYNC);

So Winsound will wait for the sound to finish before restarting.

Presumably this applies also to v3.59; I will install this ere long and
investigate.



Richard Dobson




Richard Weisgerber wrote:
> 
> I tried this with Winsound on NT 4 SP5 wks with following results.
> 
> Used tried and true Trapped in Convert composition by Richard Boulanger for
> this test.
> 
> Remain Active & Play at end unchecked:
> Compiled piece and put press a key to close dialog, pressed enter and Winsound
> closed.  Played results in wave player, success.
> 
> Remain Active & Play at end checked:
> Compiled piece but DID NOT play the piece when finished.  Bug it
> Click on logging window, hit a key and up pops the Winsound control dialog.
> Played results in wave player, success.
> 
> Remain Active checked & Play at end unchecked:
> Compile piece, press a key and winsound closed,
> Played results in wave player, success.
> 

-- 
Test your DAW with my Soundcard Attrition Page!
http://wkweb5.cableinet.co.uk/rwd (LU: 17th September 1999)
CDP: http://www.bath.ac.uk/~masjpf/CDP/CDP.htm (LU: 14th June 1999)
--

Date1999-11-03 10:35
Fromjpff@maths.bath.ac.uk
SubjectRe: [Csnd] Win NT Problems take 2
>>>>> "Richard" == Richard Dobson  writes:

 Richard> OK, I have tried this on v3.58 under Win2000, and there is indeed a
 Richard> little problem.

 Richard> The function to play sound at end is sndPlaySound(), and it is set to
 Richard> SND_ASYNC. This means the function returns immediately after the call.
 Richard> However, if 'Remain Active' is set, Winsound effectively relaunches,
 Richard> killing the audio.

But the system sits in a loop waiting for a keyboard input before
continuing or doing the relaunch, so the ASYNC is right, and allows
aborting of hearing the audio.  This certainly works as designed on
Windows95.  Why is is different in NT?

 Richard> The quick fix is just to use SND_SYNC instead (as I find I did in
 Richard> v3.55):

but that loses the ability to abort the sound

 Richard> sndPlaySound(theApp.GetProfileString(csound_section, "Soundfile",""),
 Richard> 		       SND_SYNC);

 Richard> So Winsound will wait for the sound to finish before restarting.

==John ff

--
To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk


Received: from wallace.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa10930;
          3 Nov 99 17:24
Received: from wallace.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa07888;
          3 Nov 99 13:27 GMT
Received: from [138.38.32.81] (helo=mercury.bath.ac.uk ident=qmailr)
	by wallace.maths.bath.ac.uk with smtp (Exim 2.12 #1)
	id 11izRD-0002jd-00
	for j.p.ffitch@maths.bath.ac.uk; Wed, 3 Nov 1999 12:22:51 +0000
Received: (qmail 15151 invoked from network); 3 Nov 1999 13:02:41 -0000
Received: from amos.bath.ac.uk (qmailr@138.38.32.36)
  by mercury.bath.ac.uk with SMTP; 3 Nov 1999 13:02:41 -0000
Received: (qmail 23283 invoked by uid 1457); 3 Nov 1999 12:58:14 -0000
Mailing-List: contact csound-help@lists.bath.ac.uk; run by ezmlm
Precedence: bulk
X-Mailing-List: csound
Delivered-To: mailing list csound@lists.bath.ac.uk
Received: (qmail 23276 invoked from network); 3 Nov 1999 12:58:12 -0000
Received: from pat.bath.ac.uk (138.38.32.2)
  by amos.bath.ac.uk with SMTP; 3 Nov 1999 12:58:12 -0000
Received: (qmail 24547 invoked from network); 3 Nov 1999 12:57:32 -0000
Received: from wallace.maths.bath.ac.uk (3.8.10] by hermes via SMTP (RAA1295684); Wed, 3 Nov 1999 17:18:53 GMT
Received: from exeter.ac.uk by maths.ex.ac.uk; Wed, 3 Nov 1999 17:18:51 GMT
Received: from root@popmail.cortland.com [207.229.90.94] by hermes via ESMTP (RAA1183491); Wed, 3 Nov 1999 17:18:50 GMT
Received: from ben (162-135-35.cortland.com [209.162.135.35])
	by popmail.cortland.com (8.9.1/8.9.1) with SMTP id JAA03777
	for ; Wed, 3 Nov 1999 09:16:59 -0800
Message-Id: <3.0.1.32.19991103092011.0125ae20@sunhawk.com>
X-S3.8.10] by hermes via SMTP (RAA1295684); Wed, 3 Nov 1999 17:18:53 GMT
Received: from exeter.ac.uk by maths.ex.ac.uk; Wed, 3 Nov 1999 17:18:51 GMT
Received: from root@popmail.cortland.com [207.229.90.94] by hermes via ESMTP (RAA1183491); Wed, 3 Nov 1999 17:18:50 GMT
Received: from ben (162-135-35.cortland.com [209.162.135.35])
	by popmail.cortland.com (8.9.1/8.9.1) with SMTP id JAA03777
	for ; Wed, 3 Nov 1999 09:16:59 -0800
Message-Id: <3.0.1.32.19991103092011.0125ae20@sunhawk.com>
X-Sender: benmca@sunhawk.com
X-Mailer: Windows Eudora Pro Version 3.0.1 (32)
Date: Wed, 03 Nov 1999 09:20:11 -0800
To: csound@maths.ex.ac.uk
From: Ben McAllister 
In-Reply-To: 
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Subject: [Csnd] NT bugs

Thanks everyone for the feedback -- I KNEW it couldn't be only MY machine! 

Thanks,

Ben McAllister
Senior, Composition
Student#9535795
benmca@u.washington.edu
--
To unsubscribe, send e.uk with SMTP; 4 Nov 1999 00:15:48 -0000
Received: (qmail 23542 invoked by uid 1457); 4 Nov 1999 00:14:12 -0000
Mailing-List: contact csound-help@lists.bath.ac.uk; run by ezmlm
Precedence: bulk
X-Mailing-List: csound
Delivered-To: mailing list csound@lists.bath.ac.uk
Received: (qmail 23536 invoked from network); 4 Nov 1999 00:14:12 -0000
Received: from pat.bath.ac.uk (138.38.32.2)
  by amos.bath.ac.uk with SMTP; 4 Nov 1999 00:14:12 -0000
Received: (qmail 18110 invoked from network); 4 Nov 1999 00:14:12 -0000
Received: from jaguars-int.cableinet.net (HELO jaguars.cableinet.net) (193.38.113.9)
  by pat.bath.ac.uk with SMTP; 4 Nov 1999 00:14:12 -0000
Received: (qmail 18788 invoked from network); 3 Nov 1999 22:54:00 -0000
Received: from unknown (HELO cableinet.co.uk) (194.117.146.211)
  by jaguars with SMTP; 3 Nov 1999 22:54:00 -0000
Message-ID: <3820CFF2.5D3CBF4B@cableinet.co.uk>
Date: Thu, 04 Nov 1999 00:14:42 +0000
From: Richard Dobson 
Organization: Composers Desktop Project
X-Mailer: Mozilla 4.51 [en] (WinNT; I)
X-Accept-Language: en
MIME-Version: 1.0
To: csound@lists.bath.AC.UK
References: <199910292228.PAA08348@emerald.oz.net> <381C6584.B5BBC5E1@cableinet.co.uk> <3028-Wed03Nov1999103543+0000-jpff@maths.bath.ac.uk>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Subject: Re: [Csnd] Win NT Problems take 2

After long application of that cutting-edge computer science technique
called trial and error, I have found a new culprit for this problem, and
a new solution.

(Not least because the problem even arises running under Win95 on my
machine!)

It would seem that the message generated by the first 'Type a key to
Continue' is also triggering the second 'playing...type a key..)
message; i.e the one key-press is being read both times.


I have added a call to the function cwin_discard_input() in the function
cwin_exit() immediately after the block:

if (cwin_pause_at_end)
    {
        cwin_ensure_screen();
	//        DoFinishBox();                  // just says OK to give a
pause
		if (nonstop) {
			strcpy(cMid, "Type Character to Continue");
			theWindow->SetWindowText(MainTitle);
			// Need to wait for Menu Exit
			theWindow->AwaitInput();
		}
		else DoFinishBox();
        cwin_unTop();
    }

--> cwin_discard_input();		/* clear away the key-press */

I suppose it can go anywhere after the call to AwaitInput(), really.


This is still not an ideal solution, as the message 'playing...type any
key...' takes a while to appear (the dreaded message loop); however,
pressing a key ~before~ this message appears still has the desired
effect (on my machine, after sunset, no rain...).


Richard Dobson



jpff@maths.bath.ac.uk wrote:
> 

> 
> But the system sits in a loop waiting for a keyboard input before
> continuing or doing the relaunch, so the ASYNC is right, and allows
> aborting of hearing the audio.  This certainly works as designed on
> Windows95.  Why is is different in NT?
> 


-- 
Test your DAW with my Soundcard Attrition Page!
http://wkweb5.cableinet.co.uk/rwd (LU: 23rd August 1999)
CDP: http://www.bath.ac.uk/~masjpf/CDP/CDP.htm (LU: 14th June 1999)
--
To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk


Received: from shaun.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa12889;
          4 Nov 99 9:32 GMT
Received: from [138.38.32.81] (helo=mercury.bath.ac.uk ident=qmailr)
	by shaun.maths.bath.ac.uk with smtp (Exim 2.12 #1)
	id 11jJG4-0007MU-00
	for j.p.ffitch@maths.bath.ac.uk; Thu, 4 Nov 1999 09:32:40 +0000
Received: (qmail 27196 invoked from network); 4 Nov 1999 09:22:51 -0000
Received: from amos.bath.ac.uk (qmailr@138.38.32.36)
  by mercury.bath.ac.uk with SMTP; 4 Nov 1999 09:22:51 -0000
Received: (qmail 22087 invoked by uid 1457); 4 Nov 1999 09:18:51 -0000
Mailing-List: contact csound-help@lists.bath.ac.uk; run by ezmlm
Precedence: bulk
X-Mailing-List: csound
Delivered-To: mailing list csound@lists.bath.ac.uk
Received: (qmail 22054 invoked from network); 4 Nov 1999 09:18:50 -0000
Received: from pat.bath.ac.uk (138.38.32.2)
  by amos.bath.ac.uk with SMTP; 4 Nov 1999 09:18:50 -0000
Received: (qmail 21583 invoked from network); 4 Nov 1999 09:18:50 -0000
Received: from fornax.tiscalinet.it (HELO smtp.tiscalinet.it) (195.130.224.67)
  by pat.bath.ac.uk with SMTP; 4 Nov 1999 09:18:50 -0000
Received: (qmail 15509 invoked by uid 7770); 4 Nov 1999 09:07:11 -0000
Received: from unknown (HELO agora.stm.it) (212.123.95.15)
  by fornax.tiscalinet.it with SMTP; 4 Nov 1999 09:07:11 -0000
Message-ID: <3821513F.30D6A122@agora.stm.it>
Date: Thu, 04 Nov 1999 10:26:23 +0100
From: Gabriel Maldonado 
X-Mailer: Mozilla 4.7 [en] (Win95; I)
X-Accept-Language: en
MIME-Version: 1.0
To: Csound Mailing List 
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Subject: [Csnd] [Beta Tester Team] template example

After the suggestions of Rasmus Ekman, I wrote this template example orchestra. The importat things are the comment lines at the beginning of the orchestra. It must inform about which platform the orchestra has been tested with, as well as the sr, kr etc. Eventually it should remark if some bug rises under determinate circumstances. 
Any comments, additions and suggestions are welcome.

;////////////////////////////////
;OPCODES TESTED: oscil, oscili
;------------------------------------
;sr = 22050	OK
;sr = 44100	OK
;sr = 48000	OK
;sr = 96000	OK
;------------------------------------
;kr = sr	OK
;kr = sr/2	OK
;kr = sr/10	OK
;kr = sr/100	OK
;mono		OK
;stereo	out	not available
;4-chan	out	not available
;8-chan	out	not available
;Linux		not tested		
;Mac		Bug: bug description
;DOS (console)  OK
;Win95		OK
;Win98		not tested
;WinNT		Bug: bug description
;SGI		not tested
;Irix		not tested
;Realtime	Win95 MME --> OK, Win95 DirectSound -->OK, Win95 DirectSound3D -->OK, Linux -->Not tested, MAC -->not tested
;Realtime MIDI  not tested
;MIDI file activated   not tested
;NOTES & COMMENTS: _______________________
;_________________________________________
;
;/////////////////////////////////////


sr=48000
kr=48000
ksmps=1
nchnls=2

;i-rate constant arguments
	instr	1
a1	oscili	440,100,1
a2	oscili	440,-100,1
	outs	a1,a2
	endin

;audio rate input arguments
	instr	2
afreq	expon	0,p3,sr
aenv	linseg	0,p3/3,1,p3/3,1,p3/3,0
a1	oscili	aenv,afreq,1
a2	oscili	-aenv,-afreq,1
	outs	a1,a2
	endin

;k-rate input arguments
	instr	3
kfreq	expon	0,p3,kr/2
kenv	linseg	0,p3/3,1,p3/3,1,p3/3,0
a1	oscili	kenv,kfreq,1
a2	oscili	-kenv,-kfreq,1
	outs	a1,a2
	endin

;k-rate output
	instr	4
kfreq	expon	0,p3,sr
kenv	linseg	0,p3/3,1,p3/3,1,p3/3,0
k1	oscili	kenv,kfreq,1
k2	oscili	-kenv,-kfreq,1
a1	interp	k1
a2	interp	k2
	outs	a1,a2
	endin


	instr	nn
...
...
	endin

;SCORE
i1 0 3
i2 4 3
i3 8 3
i4 12 3



-- 
Gabriel Maldonado

http://web.tiscalinet.it/G-Maldonado

--
To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk


Received: from shaun.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa12895;
          4 Nov 99 9:33 GMT
Received: from [138.38.32.81] (helo=mercury.bath.ac.uk ident=qmailr)
	by shaun.maths.bath.ac.uk with smtp (Exim 2.12 #1)
	id 11jJGg-0007MY-00
	for j.p.ffitch@maths.bath.ac.uk; Thu, 4 Nov 1999 09:33:18 +0000
Received: (qmail 25836 invoked from network); 4 Nov 1999 09:20:25 -0000
Received: from amos.bath.ac.uk (qmailr@138.38.32.36)
  by mercury.bath.ac.uk with SMTP; 4 Nov 1999 09:20:25 -0000
Received: (qmail 22038 invoked by uid 1457); 4 Nov 1999 09:18:48 -0000
Mailing-List: contact csound-help@lists.bath.ac.uk; run by ezmlm
Precedence: bulk
X-Mailing-List: csound
Delivered-To: mailing list csound@lists.bath.ac.uk
Received: (qmail 22031 invoked from network); 4 Nov 1999 09:18:47 -0000
Received: from pat.bath.ac.uk (138.38.32.2)
  by amos.bath.ac.uk with SMTP; 4 Nov 1999 09:18:47 -0000
Received: (qmail 21577 invoked from network); 4 Nov 1999 09:18:47 -0000
Received: from fornax.tiscalinet.it (HELO smtp.tiscalinet.it) (195.130.224.67)
  by pat.bath.ac.uk with SMTP; 4 Nov 1999 09:18:47 -0000
Received: (qmail 15497 invoked by uid 7770); 4 Nov 1999 09:07:09 -0000
Received: from unknown (HELO agora.stm.it) (212.123.95.15)
  by fornax.tiscalinet.it with SMTP; 4 Nov 1999 09:07:09 -0000
Message-ID: <38214567.7210E595@agora.stm.it>
Date: Thu, 04 Nov 1999 09:35:51 +0100
From: Gabriel Maldonado 
X-Mailer: Mozilla 4.7 [en] (Win95; I)
X-Accept-Language: en
MIME-Version: 1.0
To: Csound Mailing List 
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Subject: [Csnd] DirectCsound 3.031 available

wguide1 bug fixed thanks to jpff (never used a-rate mode).
resony now has the optional extra argument isepmode, allowing the user
to choose 
logarithmical or linear separation.

resony manual:
-------------
ar  resony   asig, kbf, kbw, inum, ksep [,isepmode , iscl, istor]

DESCRIPTION
A bank of second-order bandpass filters, connected in parallel.

INITIALIZATION
inum - number of filters. 

isepmode - determines if the separation center frequencies of each
filter must be generated in logarithmically (using octave as unit of
measure) or linearly (using Hertz). Default value is 0, corresponding to
logarithmic mode.

iscl - coded scaling factor for resonators. A value of 1 signifies a
peak response factor of 1, i.e. all frequencies other than kcf are
attenuated in accordance with the (normalized) response curve. A value
of 2 raises the response factor so that its overall RMS value equals 1.
(This intended equalization of input and output power assumes all
frequencies are physically present; hence it is most applicable to white
noise.) A zero value signifies no scaling of the signal, leaving that to
some later adjustment (e.g. see balance). The default value is 0. 

istor - initial disposition of internal data space. Since filtering
incorporates a feedback loop of previous output, the initial status of
the storage space used is significant. A zero value will clear the
space; a non-zero value will allow previous information to remain. The
default value is 0.



PERFORMANCE
asig - audio input signal 

kbf - base frequency, i.e. center frequency of lowest filter in Hz 

kbw - bandwidth in Hz 

ksep - separation of the center frequency of filters (in octaves or in
Hertz, depending by isepmode flag)
resony is a bank of second-order bandpass filters, with k-rate variant
frequency separation, base frequency and bandwidth, connected in
parallel (i.e. the resulting signal is a mixing of the output of each
filter). The center frequency of each filter depends of kbf and ksep
variables. The maximum number of filters is set to 100.

EXAMPLE:
In this example the global variable gk1 modifies kbf, gk2 modifies kbw,
gk3 inum, gk4 ksep and gk5 the main volume.

	instr	1
a1	soundin "myfile.aif"
a2	resony	a1,   gk1 , gk2 ,i(gk3),gk4 ,2	
	out	a2 * gk5 
	endin




-- 
Gabriel Maldonado

http://web.tiscalinet.it/G-Maldonado


--
To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk