Csound Csound-dev Csound-tekno Search About

[Csnd] Good soundfont produces silence with csound, but not other programs.

Date2009-11-15 20:41
FromTobiah
Subject[Csnd] Good soundfont produces silence with csound, but not other programs.
I found an old drum kit soundfont from years ago that I forgot I had.
It's extremely well put together.  Each drum sound has a dozen or so
volume levels with separate samples for left and right channel.

I loaded the soundfont into swami, and I can play it just fine with
my MIDI keyboard.  When I try it with csound and sfplay, it loads fine
and runs without any errors, but I get no sound output.

Here is the orchestra, and score, and csound output.  If anyone has the
means to download a 200M soundfont and try it, it can be found here:

http://tobiah.org/drums

There is also an excellent and very convincing grand piano soundfont there  for
comparison that you might like to grab.

Thanks for any help on getting this killer drum patch to work with csound.

Tobiah


## orchestra:  Works with the piano soundfont, but no sound with the drums

; vim: set filetype=csound:

sr	=	44100
kr	=	10
nchnls	=	2
0dbfs	=	1.0

	gi_sf			sfload		"ns_kit7free.sf2"
	;gi_sf		sfload		"grand_3_layer.sf2"
				sfpassign	0, gi_sf
				sfplist		gi_sf
				sfilist		gi_sf

	gi_master_volume	init		1.0 / 32767.0

instr 1
	
	i_dur			init		p3
	i_vel			        init		p4
	i_notenum		init		p5
	i_xamp			init		1.0
	i_xfreq			init		1.0
	i_sample_base	init		0
	i_flag			init		0

	a_left, a_right		sfplay	i_vel, i_notenum, i_xamp, i_xfreq,
i_sample_base, i_flag

				        outs	        a_left * gi_master_volume , a_right * gi_master_volume
endin

## score:

i1 0.0 4.0 120.0 0
i1 0.1 4.0 120.0 1
i1 0.2 4.0 120.0 2
i1 0.3 4.0 120.0 3
i1 0.4 4.0 120.0 4
i1 0.5 4.0 120.0 5

; .... and so on.  Tried every note number

i1 12.3 4.0 120.0 123
i1 12.4 4.0 120.0 124
i1 12.5 4.0 120.0 125
i1 12.6 4.0 120.0 126
i1 12.7 4.0 120.0 127


PortMIDI real time MIDI plugin for Csound
virtual_keyboard real time MIDI plugin for Csound
PortAudio real-time audio module for Csound
0dBFS level = 32768.0
Csound version 5.08 (double samples) Apr 16 2008
libsndfile-1.0.17
orchname:  drums.orc
scorename: drums.sco
rtmidi: PortMIDI module enabled
rtaudio: ALSA module enabled
orch compiler:
32 lines read
	instr	1	
Elapsed time at end of orchestra compile: real: 0.001s, CPU: 0.000s
sorting score ...
	... done
Elapsed time at end of score sort: real: 0.030s, CPU: 0.000s
Csound version 5.08 (double samples) Apr 16 2008
displays suppressed
0dBFS level = 1.0

Preset list of "ns_kit7free.sf2"
  0) ns_kit7free         	prog:0   bank:0


Instrument list of "ns_kit7free.sf2"
  0) ns_kit7free

orch now loaded
audio buffered in 256 sample-frame blocks
writing 1024-byte blks of shorts to test.wav (WAV)
SECTION 1:
new alloc for instr 1:
B  0.000 ..  0.100 T  0.100 TT  0.100 M:  0.00000  0.00000
new alloc for instr 1:
B  0.100 ..  0.200 T  0.200 TT  0.200 M:  0.00000  0.00000
new alloc for instr 1:
B  0.200 ..  0.300 T  0.300 TT  0.300 M:  0.00000  0.00000
new alloc for instr 1:
B  0.300 ..  0.400 T  0.400 TT  0.400 M:  0.00000  0.00000
new alloc for instr 1:
B  0.400 ..  0.500 T  0.500 TT  0.500 M:  0.00000  0.00000

;;  And so on......


B 16.200 .. 16.300 T 16.300 TT 16.300 M:  0.00000  0.00000
B 16.300 .. 16.400 T 16.400 TT 16.400 M:  0.00000  0.00000
B 16.400 .. 16.500 T 16.500 TT 16.500 M:  0.00000  0.00000
B 16.500 .. 16.600 T 16.600 TT 16.600 M:  0.00000  0.00000
B 16.600 .. 16.700 T 16.700 TT 16.700 M:  0.00000  0.00000
Score finished in csoundPerform().
inactive allocs returned to freespace
end of score.		   overall amps:  0.00000  0.00000
	   overall samples out of range:        0        0
0 errors in performance
Elapsed time at end of performance: real: 5.216s, CPU: 1.630s
2877 1024-byte soundblks of shorts written to test.wav (WAV)


Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-11-15 20:54
FromVictor Lazzarini
Subject[Csnd] Re: Good soundfont produces silence with csound, but not other programs.
Why don't you try the fluidsynth opcodes?

On 15 Nov 2009, at 20:41, Tobiah wrote:

> I found an old drum kit soundfont from years ago that I forgot I had.
> It's extremely well put together.  Each drum sound has a dozen or so
> volume levels with separate samples for left and right channel.
>
> I loaded the soundfont into swami, and I can play it just fine with
> my MIDI keyboard.  When I try it with csound and sfplay, it loads fine
> and runs without any errors, but I get no sound output.
>
> Here is the orchestra, and score, and csound output.  If anyone has  
> the
> means to download a 200M soundfont and try it, it can be found here:
>
> http://tobiah.org/drums
>
> There is also an excellent and very convincing grand piano soundfont  
> there  for
> comparison that you might like to grab.
>
> Thanks for any help on getting this killer drum patch to work with  
> csound.
>
> Tobiah
>
>
> ## orchestra:  Works with the piano soundfont, but no sound with the  
> drums
>
> ; vim: set filetype=csound:
>
> sr	=	44100
> kr	=	10
> nchnls	=	2
> 0dbfs	=	1.0
>
> 	gi_sf			sfload		"ns_kit7free.sf2"
> 	;gi_sf		sfload		"grand_3_layer.sf2"
> 				sfpassign	0, gi_sf
> 				sfplist		gi_sf
> 				sfilist		gi_sf
>
> 	gi_master_volume	init		1.0 / 32767.0
>
> instr 1
> 	
> 	i_dur			init		p3
> 	i_vel			        init		p4
> 	i_notenum		init		p5
> 	i_xamp			init		1.0
> 	i_xfreq			init		1.0
> 	i_sample_base	init		0
> 	i_flag			init		0
>
> 	a_left, a_right		sfplay	i_vel, i_notenum, i_xamp, i_xfreq,
> i_sample_base, i_flag
>
> 				        outs	        a_left * gi_master_volume , a_right *  
> gi_master_volume
> endin
>
> ## score:
>
> i1 0.0 4.0 120.0 0
> i1 0.1 4.0 120.0 1
> i1 0.2 4.0 120.0 2
> i1 0.3 4.0 120.0 3
> i1 0.4 4.0 120.0 4
> i1 0.5 4.0 120.0 5
>
> ; .... and so on.  Tried every note number
>
> i1 12.3 4.0 120.0 123
> i1 12.4 4.0 120.0 124
> i1 12.5 4.0 120.0 125
> i1 12.6 4.0 120.0 126
> i1 12.7 4.0 120.0 127
>
>
> PortMIDI real time MIDI plugin for Csound
> virtual_keyboard real time MIDI plugin for Csound
> PortAudio real-time audio module for Csound
> 0dBFS level = 32768.0
> Csound version 5.08 (double samples) Apr 16 2008
> libsndfile-1.0.17
> orchname:  drums.orc
> scorename: drums.sco
> rtmidi: PortMIDI module enabled
> rtaudio: ALSA module enabled
> orch compiler:
> 32 lines read
> 	instr	1	
> Elapsed time at end of orchestra compile: real: 0.001s, CPU: 0.000s
> sorting score ...
> 	... done
> Elapsed time at end of score sort: real: 0.030s, CPU: 0.000s
> Csound version 5.08 (double samples) Apr 16 2008
> displays suppressed
> 0dBFS level = 1.0
>
> Preset list of "ns_kit7free.sf2"
>  0) ns_kit7free         	prog:0   bank:0
>
>
> Instrument list of "ns_kit7free.sf2"
>  0) ns_kit7free
>
> orch now loaded
> audio buffered in 256 sample-frame blocks
> writing 1024-byte blks of shorts to test.wav (WAV)
> SECTION 1:
> new alloc for instr 1:
> B  0.000 ..  0.100 T  0.100 TT  0.100 M:  0.00000  0.00000
> new alloc for instr 1:
> B  0.100 ..  0.200 T  0.200 TT  0.200 M:  0.00000  0.00000
> new alloc for instr 1:
> B  0.200 ..  0.300 T  0.300 TT  0.300 M:  0.00000  0.00000
> new alloc for instr 1:
> B  0.300 ..  0.400 T  0.400 TT  0.400 M:  0.00000  0.00000
> new alloc for instr 1:
> B  0.400 ..  0.500 T  0.500 TT  0.500 M:  0.00000  0.00000
>
> ;;  And so on......
>
>
> B 16.200 .. 16.300 T 16.300 TT 16.300 M:  0.00000  0.00000
> B 16.300 .. 16.400 T 16.400 TT 16.400 M:  0.00000  0.00000
> B 16.400 .. 16.500 T 16.500 TT 16.500 M:  0.00000  0.00000
> B 16.500 .. 16.600 T 16.600 TT 16.600 M:  0.00000  0.00000
> B 16.600 .. 16.700 T 16.700 TT 16.700 M:  0.00000  0.00000
> Score finished in csoundPerform().
> inactive allocs returned to freespace
> end of score.		   overall amps:  0.00000  0.00000
> 	   overall samples out of range:        0        0
> 0 errors in performance
> Elapsed time at end of performance: real: 5.216s, CPU: 1.630s
> 2877 1024-byte soundblks of shorts written to test.wav (WAV)
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
> "unsubscribe csound"



Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-11-15 20:57
FromVictor Lazzarini
Subject[Csnd] Re: Good soundfont produces silence with csound, but not other programs.
By the way, I think you should divide by 32768 to normalise the  
volume, not 32767.

Victor


On 15 Nov 2009, at 20:41, Tobiah wrote:

> I found an old drum kit soundfont from years ago that I forgot I had.
> It's extremely well put together.  Each drum sound has a dozen or so
> volume levels with separate samples for left and right channel.
>
> I loaded the soundfont into swami, and I can play it just fine with
> my MIDI keyboard.  When I try it with csound and sfplay, it loads fine
> and runs without any errors, but I get no sound output.
>
> Here is the orchestra, and score, and csound output.  If anyone has  
> the
> means to download a 200M soundfont and try it, it can be found here:
>
> http://tobiah.org/drums
>
> There is also an excellent and very convincing grand piano soundfont  
> there  for
> comparison that you might like to grab.
>
> Thanks for any help on getting this killer drum patch to work with  
> csound.
>
> Tobiah
>
>
> ## orchestra:  Works with the piano soundfont, but no sound with the  
> drums
>
> ; vim: set filetype=csound:
>
> sr	=	44100
> kr	=	10
> nchnls	=	2
> 0dbfs	=	1.0
>
> 	gi_sf			sfload		"ns_kit7free.sf2"
> 	;gi_sf		sfload		"grand_3_layer.sf2"
> 				sfpassign	0, gi_sf
> 				sfplist		gi_sf
> 				sfilist		gi_sf
>
> 	gi_master_volume	init		1.0 / 32767.0
>
> instr 1
> 	
> 	i_dur			init		p3
> 	i_vel			        init		p4
> 	i_notenum		init		p5
> 	i_xamp			init		1.0
> 	i_xfreq			init		1.0
> 	i_sample_base	init		0
> 	i_flag			init		0
>
> 	a_left, a_right		sfplay	i_vel, i_notenum, i_xamp, i_xfreq,
> i_sample_base, i_flag
>
> 				        outs	        a_left * gi_master_volume , a_right *  
> gi_master_volume
> endin
>
> ## score:
>
> i1 0.0 4.0 120.0 0
> i1 0.1 4.0 120.0 1
> i1 0.2 4.0 120.0 2
> i1 0.3 4.0 120.0 3
> i1 0.4 4.0 120.0 4
> i1 0.5 4.0 120.0 5
>
> ; .... and so on.  Tried every note number
>
> i1 12.3 4.0 120.0 123
> i1 12.4 4.0 120.0 124
> i1 12.5 4.0 120.0 125
> i1 12.6 4.0 120.0 126
> i1 12.7 4.0 120.0 127
>
>
> PortMIDI real time MIDI plugin for Csound
> virtual_keyboard real time MIDI plugin for Csound
> PortAudio real-time audio module for Csound
> 0dBFS level = 32768.0
> Csound version 5.08 (double samples) Apr 16 2008
> libsndfile-1.0.17
> orchname:  drums.orc
> scorename: drums.sco
> rtmidi: PortMIDI module enabled
> rtaudio: ALSA module enabled
> orch compiler:
> 32 lines read
> 	instr	1	
> Elapsed time at end of orchestra compile: real: 0.001s, CPU: 0.000s
> sorting score ...
> 	... done
> Elapsed time at end of score sort: real: 0.030s, CPU: 0.000s
> Csound version 5.08 (double samples) Apr 16 2008
> displays suppressed
> 0dBFS level = 1.0
>
> Preset list of "ns_kit7free.sf2"
>  0) ns_kit7free         	prog:0   bank:0
>
>
> Instrument list of "ns_kit7free.sf2"
>  0) ns_kit7free
>
> orch now loaded
> audio buffered in 256 sample-frame blocks
> writing 1024-byte blks of shorts to test.wav (WAV)
> SECTION 1:
> new alloc for instr 1:
> B  0.000 ..  0.100 T  0.100 TT  0.100 M:  0.00000  0.00000
> new alloc for instr 1:
> B  0.100 ..  0.200 T  0.200 TT  0.200 M:  0.00000  0.00000
> new alloc for instr 1:
> B  0.200 ..  0.300 T  0.300 TT  0.300 M:  0.00000  0.00000
> new alloc for instr 1:
> B  0.300 ..  0.400 T  0.400 TT  0.400 M:  0.00000  0.00000
> new alloc for instr 1:
> B  0.400 ..  0.500 T  0.500 TT  0.500 M:  0.00000  0.00000
>
> ;;  And so on......
>
>
> B 16.200 .. 16.300 T 16.300 TT 16.300 M:  0.00000  0.00000
> B 16.300 .. 16.400 T 16.400 TT 16.400 M:  0.00000  0.00000
> B 16.400 .. 16.500 T 16.500 TT 16.500 M:  0.00000  0.00000
> B 16.500 .. 16.600 T 16.600 TT 16.600 M:  0.00000  0.00000
> B 16.600 .. 16.700 T 16.700 TT 16.700 M:  0.00000  0.00000
> Score finished in csoundPerform().
> inactive allocs returned to freespace
> end of score.		   overall amps:  0.00000  0.00000
> 	   overall samples out of range:        0        0
> 0 errors in performance
> Elapsed time at end of performance: real: 5.216s, CPU: 1.630s
> 2877 1024-byte soundblks of shorts written to test.wav (WAV)
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
> "unsubscribe csound"



Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-11-15 21:16
FromTobiah
Subject[Csnd] Re: Re: Good soundfont produces silence with csound, but not other programs.
On Sun, Nov 15, 2009 at 12:57 PM, Victor Lazzarini
 wrote:
> By the way, I think you should divide by 32768 to normalise the volume, not
> 32767.
>

I suppose so.  I'm actually working in floats so anywhere in the
ballpark is cool.

I'll give the fluidsynth a try.  I was actually just looking at the docs.
I generally look to sfplay first, because I can process each note that way.
It seems that with fluidsynth, all I get is a stereo output for everything
that's happening in the system.  No chance to modulate or analyze individual
events.

For this drum soundfont however, it would be just fine.

Tobiah


Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-11-15 21:34
FromVictor Lazzarini
Subject[Csnd] Re: Re: Re: Good soundfont produces silence with csound, but not other programs.
Well, 32768 is the correct figure:
  - 32768/32767 =-1.000030518509476
which is an overflow in a float stream. That's what I meant.

Victor

On 15 Nov 2009, at 21:16, Tobiah wrote:

> On Sun, Nov 15, 2009 at 12:57 PM, Victor Lazzarini
>  wrote:
>> By the way, I think you should divide by 32768 to normalise the  
>> volume, not
>> 32767.
>>
>
> I suppose so.  I'm actually working in floats so anywhere in the
> ballpark is cool.
>
> I'll give the fluidsynth a try.  I was actually just looking at the  
> docs.
> I generally look to sfplay first, because I can process each note  
> that way.
> It seems that with fluidsynth, all I get is a stereo output for  
> everything
> that's happening in the system.  No chance to modulate or analyze  
> individual
> events.
>
> For this drum soundfont however, it would be just fine.
>
> Tobiah
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
> "unsubscribe csound"



Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-11-15 22:37
FromTobiah
Subject[Csnd] Re: Re: Re: Re: Good soundfont produces silence with csound, but not other programs.
I agree about the number.  I was just extraneously mentioning
that the exact number wasn't the first thing on my mind when
I wrote that line, because I'm using floating point files and scale
at the end.

> Well, 32768 is the correct figure:
>  - 32768/32767 =-1.000030518509476
> which is an overflow in a float stream. That's what I meant.

>> I suppose so.  I'm actually working in floats so anywhere in the
>> ballpark is cool.


Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-11-16 17:02
FromTobiah
Subject[Csnd] Re: Re: Good soundfont produces silence with csound, but not other programs.
On Sun, Nov 15, 2009 at 12:54 PM, Victor Lazzarini
 wrote:
> Why don't you try the fluidsynth opcodes?

I tried fluidSynth, but got the same results.  The drumkit that I can
play with Swami,
produces silence, while the grand piano soundfont in the same
orchestra plays fine.

Could it be that Csound can't handle a 200M soundfont?


sr      =        44100
kr      =        10
nchnls  =        2
0dbfs   =        1.0

        gi_fluid          fluidEngine
        ;i_sf             fluidLoad           "ns_kit7free.sf2", gi_fluid, 1
        i_sf              fluidLoad           "grand_3_layer.sf2", gi_fluid, 1
                          fluidProgramSelect  gi_fluid, 0, i_sf, 0, 0

instr 1

        i_notenum         init                p4
        i_velocity        init                p5

                          fluidNote           gi_fluid, 0, i_notenum, i_velocity

        a_left, a_right   fluidOut            gi_fluid
                          outs                a_left, a_right
endin


Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-11-17 00:18
FromSteven Yi
Subject[Csnd] Re: Re: Re: Good soundfont produces silence with csound, but not other programs.
Hi Tobiah,

I'm downloading this now and will see if I can find out anything.

Thanks,
steven

On Mon, Nov 16, 2009 at 12:02 PM, Tobiah  wrote:
> On Sun, Nov 15, 2009 at 12:54 PM, Victor Lazzarini
>  wrote:
>> Why don't you try the fluidsynth opcodes?
>
> I tried fluidSynth, but got the same results.  The drumkit that I can
> play with Swami,
> produces silence, while the grand piano soundfont in the same
> orchestra plays fine.
>
> Could it be that Csound can't handle a 200M soundfont?
>
>
> sr      =        44100
> kr      =        10
> nchnls  =        2
> 0dbfs   =        1.0
>
>        gi_fluid          fluidEngine
>        ;i_sf             fluidLoad           "ns_kit7free.sf2", gi_fluid, 1
>        i_sf              fluidLoad           "grand_3_layer.sf2", gi_fluid, 1
>                          fluidProgramSelect  gi_fluid, 0, i_sf, 0, 0
>
> instr 1
>
>        i_notenum         init                p4
>        i_velocity        init                p5
>
>                          fluidNote           gi_fluid, 0, i_notenum, i_velocity
>
>        a_left, a_right   fluidOut            gi_fluid
>                          outs                a_left, a_right
> endin
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-11-17 20:47
FromSteven Yi
Subject[Csnd] Re: Re: Re: Good soundfont produces silence with csound, but not other programs.
I'm seeing the same results as Tobiah so far with no sounds. I've got
some older projects using fluidsynth that I need to copy some
soundfonts from another computer.  I'll try with 5.11 when I get those
copied and will see if those projects run.

On Mon, Nov 16, 2009 at 7:18 PM, Steven Yi  wrote:
> Hi Tobiah,
>
> I'm downloading this now and will see if I can find out anything.
>
> Thanks,
> steven
>
> On Mon, Nov 16, 2009 at 12:02 PM, Tobiah  wrote:
>> On Sun, Nov 15, 2009 at 12:54 PM, Victor Lazzarini
>>  wrote:
>>> Why don't you try the fluidsynth opcodes?
>>
>> I tried fluidSynth, but got the same results.  The drumkit that I can
>> play with Swami,
>> produces silence, while the grand piano soundfont in the same
>> orchestra plays fine.
>>
>> Could it be that Csound can't handle a 200M soundfont?
>>
>>
>> sr      =        44100
>> kr      =        10
>> nchnls  =        2
>> 0dbfs   =        1.0
>>
>>        gi_fluid          fluidEngine
>>        ;i_sf             fluidLoad           "ns_kit7free.sf2", gi_fluid, 1
>>        i_sf              fluidLoad           "grand_3_layer.sf2", gi_fluid, 1
>>                          fluidProgramSelect  gi_fluid, 0, i_sf, 0, 0
>>
>> instr 1
>>
>>        i_notenum         init                p4
>>        i_velocity        init                p5
>>
>>                          fluidNote           gi_fluid, 0, i_notenum, i_velocity
>>
>>        a_left, a_right   fluidOut            gi_fluid
>>                          outs                a_left, a_right
>> endin
>>
>>
>> Send bugs reports to this list.
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>


Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"